Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-03-23 16:34:34

Algaris
Member
From: England
Registered: 2006-01-27
Posts: 535

Allow website users to create new articles

Is it possible to do the following with txp plugins?

1. Create a web form that when submitted by website users creates a new article based on the information entered into the forms fields. I’m thinking of having the following fields:

Date the visitor wishes the article to be published
Custom field
Article Title
Article

and for the article to be laid out as follows:

Title
Custom field
Date
Article Body

2. Sets the article to hidden
3. Emails the webmaster so he can proof read the article before publishing it on the date specified.

Offline

#2 2010-03-23 16:52:45

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,007
Website GitHub Mastodon Twitter

Re: Allow website users to create new articles

Hi Ross

There is the mem_self_register which allows users to be registered for the back end. This plugin is as close to what you are looking for.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#3 2010-03-23 16:58:17

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

Re: Allow website users to create new articles

You’re probably likely to get where you want to go with mem_form, mem_simple_form or perhaps the grand-daddy mem_public_article.

I’m not sure how to configure them all to do what you want in terms of layout of the form fields, nor whether they can e-mail a webmaster, but I’m pretty sure they can get you most of the way there in terms of creating the article in TXP from the web site.

Last edited by Bloke (2010-03-23 16:59:15)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#4 2010-03-23 17:59:17

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,578
Website

Re: Allow website users to create new articles

One further plugin in that collection not already mentioned but built expressly for this purpose is mem_moderation. It uses mem_form for the actual building of the form (which is very similar to zem_contact_reborn if you’ve used that before), which you can design however you want it to look. When the form is submitted, it sends the relevant data to the respective fields (e.g. custom fields) and puts the article in a moderation queue which is not yet a textpattern article. In an extra admin pane in the backend, you as the admin can then edit, reject or accept the submitted data prior to it becoming a proper article in the backend. As the admin you receive a mail notification when a submission is made.

I use this, for example, to allow people (strangers) to submit events to a homepage without them having to have an account. The admin checks if the details are okay and accepts submissions whereupon a textpattern article is created with the right input in the correct custom fields and appears on the calendar. I added a honeypot trap to hinder bots from submitting rubbish which helps to reduce spam somewhat.

To help you tell the different plugins apart:

  • mem_moderation – submits articles to a moderation queue. The moderation queue prevents unauthorised submissions from reaching the site. There are a series of mem_moderation helper plugins for files, links, images… the submitting authors don’t have to be registered or have a login. Authors cannot edit their submission.
  • mem_simple_form – can be used to submit an article directly to the database. You need to password-protect access to this form to stop unauthorised publishing. Authors cannot edit their submissions.
  • mem_public_article – allows you to edit a textpattern article using a public-side form. It likewise needs password-protecting. You also need to build a way of retrieving the articles a user may edit and put measures in place to prevent authors from editing other articles that they shouldn’t.
  • mem_self_register allows user to sign up to receive access to the backup. They can then use the textpattern backend.

TXP Builders – finely-crafted code, design and txp

Offline

#5 2010-03-23 19:53:31

Algaris
Member
From: England
Registered: 2006-01-27
Posts: 535

Re: Allow website users to create new articles

Wow, thank you so much. Looking through what you’ve all said I think:

mem_form or
mem_simple_form or
mem_public_article

in conjunction with:

mem_moderation

would be the way to go. Basically I work for a school updating their website, daily bulletins and information screens. Every day I’m sent a stack of emails, images or left bits of paper on my desk. I then have to go through all of this data formatting it into various different document types (web pages, Intranet pages, word documents for print, PowerPoint presentations etc). Today I thought to myself If I could get the staff to submit their information directly to the website, for me to proof read and then publish to the correct section and date, I could let Textpattern take care of all the fiddly stuff like correctly formatting sorting and compiling it. This would save me a hell of a lot of work if I could pull it off.

The only downside is there’s no way they would want to touch the Textpattern back end, if I suggested it I would have a revolt on my hands and they’d go back to the current method. Hence the reason why I was asking about simple forms they could fill out submit and forget about.

Last edited by Algaris (2010-03-23 20:18:45)

Offline

#6 2010-03-24 12:33:55

Algaris
Member
From: England
Registered: 2006-01-27
Posts: 535

Re: Allow website users to create new articles

Okay I’ve managed to build the form using mem_simple_form, that bit was pretty easy. What I would like to do now is to have the content uploaded to an article where the form data auto populates the title, body, and custom fields for me. I see I can enter a table name for the content to be uploaded to. Would there be any way to use this achieve what I want?

I also took a look at the mem_moderation plugin help to see how to send everything submitted from the form to the moderation queue. The information there pretty much blew my mind.

If it’s not too cheeky to ask would it be possible for someone to post some code examples to at least get me started in the right direction please?

Thanks.

Offline

#7 2010-03-24 23:23:51

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: Allow website users to create new articles

I struggled with several solutions for a similar problem, and I settled on using mem_simple_form in conjunction with mem_form, mem_self_register, and ign_password_protect. Right after I resolved the issue, mem_public_article was published— that plugin might have been better than what I created, but I haven’t worked with it.

Anyway, for the design pattern you want, I would use mem_moderation and mem_moderation_article without reservation. It seems just right for gathering content from the public-facing site to be moderated. I tested these before choosing the freshly-minted mem_simple_form.

My mem_simple_forms hook directly into the textpattern table, and the content is available on the site immediately after submission— there is no moderation, and I don’t think building a moderation workflow with mem_simple_form is tenable.

I hope this helps!

Offline

#8 2010-03-24 23:43:25

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: Allow website users to create new articles

By the way, do you know how to use Subversion? I notice that Manfre’s public repository has more current versions of several plugins than those available on his site. If you are using a Unix-like OS (like Mac or Ubuntu), you can enter this in your command line to get the latest versions:

svn co http://manfre.net/project/699/public-svn

The repository includes a directory for each plugin. Once you navigate into a plugin directory, you can compile the plugin by typing this (replacing plugin_name with the name of the plugin you’re compiling):

php mem_plugin_name.php | mem_plugin_name.txt

Then you can install the each plugin into Textpattern from the generated text files.

To run mem_moderation_article I’m pretty sure you need all of the following installed and active:

  • mem_admin_parse
  • mem_form
  • mem_moderation
  • mem_moderation_article

Offline

#9 2010-03-25 08:39:12

Algaris
Member
From: England
Registered: 2006-01-27
Posts: 535

Re: Allow website users to create new articles

Thanks for the reply.

Unfortunately moderation is essential. Even though I work in a school the amount of grammatical errors, spelling mistakes, wrong dates/information I get passed for publication means I need to proof read it before the article goes live. Also I need to assign the article to the correct section of the website (unless there’s a way to pass that data through the form too). Effectively I’m trying to give myself as little work as possible in the future, so all I have to do is proof read an article and hit publish.

Although I’ve never used SVN before I work on a Mac so I’ll give it a try with the new versions of the plugins.

I guess its back to the mem_moderation and mem_moderation_article help docs to try and make some sense of them. Unless someone might give me a little nudge in the right direction ;-)

Offline

#10 2010-03-25 12:06:20

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: Allow website users to create new articles

Also I need to assign the article to the correct section of the website (unless there’s a way to pass that data through the form too).

That’s possible— you can even have it in a hidden field using <txp:mem_form_hidden … or <txp:mem_form_secret …. That was one of my requirements too.

Although I’ve never used SVN before I work on a Mac so I’ll give it a try with the new versions of the plugins.

Depending on which version of Mac OS 10 you have, Subversion may not be installed already. You can find the Terminal in the Utilities folder under Applications. Type this in the Terminal to check if Subversion is installed:

svn --version

Unless someone might give me a little nudge in the right direction ;-)

I wasn’t ignoring your request for code samples, because I too find them very helpful. If I had used mem_moderation for my project, it would be easy to copy, paste, and sanitize a real-life working example. But since I settled on mem_simple_form, my memory of mem_moderation isn’t so sharp— it’s back to the help docs for me too!

Last edited by johnstephens (2010-03-25 12:07:02)

Offline

#11 2010-03-25 12:17:37

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: Allow website users to create new articles

If you only need to moderate submissions of colleagues, there’s another option available: You could give each user a Textpattern login with their Privileges set to “Freelancer”. Then they can author and edit their own content, but they cannot publish it or edit other submissions.

This method would depend on no plugins, and you could even create or modify a custom admin theme to give Textpattern a skin that goes with the rest of the site. If admin theming had been part of Textpattern’s core offerings when I originally struggled with this issue, I think I would have chosen this path instead.

Offline

#12 2010-03-25 12:41:25

Algaris
Member
From: England
Registered: 2006-01-27
Posts: 535

Re: Allow website users to create new articles

No worries I wasn’t getting at you ;-) Just a general if anyone knows how mem_moderation works plea.

I’ll have another think about the txp backend thing. The problem is the people I work with started complaining when I introduced Word templates for them to fill in and email to me as attachments, saying it was fiddly and time consuming. What most of them want to do is write an email, click send and forget about it. The thought of pointing them to the TXP backend and getting them to log in makes me shudder. The other problem is that potentially any one of the teachers (of which there’s a lot) could want to send me information. I guess I could setup one user account but most of them would forget the username and password.

The original idea I had was a very simple form with just the fields they need to fill in and a submit button.

Last edited by Algaris (2010-03-25 13:22:55)

Offline

Board footer

Powered by FluxBB