[Planning Phase] Post templates - Multiple textareas/textbox

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Anti-Spam Guide

[Planning Phase] Post templates - Multiple textareas/textbox

Postby waxxie » Fri Feb 24, 2012 5:26 pm

What is a "Post template"?
A post template removes the default textarea when creating a new topic and replaces it with a combination of textboxes and textareas as defined by the admin in the post template.

Aren't there existing mods for this?
There are mods that add content to the text area to guide a user on how to fill out the post text area but this mod is completely different in that it does not insert data into the post text area. It removes the existing forums textarea and replaces it with a combination of textboxes and textareas as defined by the admin in a specific post template.

What will this mod do?
This mod will allow an administrator to select a forum category to use a specific "Post template" for creating new topics. The templates are created by the administrator and assigned to forums or forum categories.

How does it work?
When creating a new topic, the user is presented with separate text areas and text boxes as defined in the post template. BBCode type codes are used as the names in the form and the variables define the maximum input allowed (maxsize) and type of form field (textarea, textbox). When the topic is submitted and saved, all the fields are saved into the single "post_text" data row. When the topic is viewed the data from the row is split into each part depending on the template used. The mechanism for this is explained in detail below...

Example Post templates

Article Post Template
Code: Select all
[ArticleIntro maxsize:80 field:textarea]{intro_text}[/ArticleIntro]
[ArticleBody maxsize:3500 field:textarea]{body_text}[/ArticleBody]


External News Post Template
Code: Select all
[NewsSummary maxsize:255 field:textarea]{summary_text}[/NewsSummary]
[SourceName maxsize:30 field:textbox]{source_name}[/SourceName]
[SourceLink maxsize:150 field:textbox]{source_url}[/SourceLink]


Book Review Template
Code: Select all
[BookTitle maxsize:50 field:textbox]{book_title}[/BookTitle]
[BookCover maxsize:255 field:textbox]{book_image}[/BookCover]
[BookAuthor maxsize:50 field:textbox]{book_author}[/BookAuthor]
[BookPublished maxsize:4 field:textbox]{book_published}[/BookPublished]
[BookAbout maxsize:255 field:textarea]{book_about}[/BookAbout]
[BookISBN maxsize:13 field:textbox]{book_isbn}[/BookISBN]
[BookWebsite maxsize:150 field:textbox]{book_url}[/BookWebsite]
[BookReview maxsize:500 field:textarea]{book_review}[/BookReview]
[BookRating maxsize:1 field:textbox]{book_rating}[/BookRating]


Example post field and view result process
Using the External news post template as an example:

  • In my News forum category, when a user goes to post a new topic they will see these fields instead of the default topic textarea box:

    Subject: [regular title phpbb topic subject textbox]
    News Summary
    [empty textarea here]
    Source Name [empty textbox here]
    Source Link [empty textbox here]
  • When they fill in the 3 fields it will look like this:

    Subject: Something Crazy!
    News Summary
    Something happened today, it was so incredible you really had to be there.
    Source Name CNN
    Source Link http://cnn.com/something_crazy/
  • When the data is saved to the database, all the fields are "merged" into the regular database posts "post_text" field. So if you look in the database using my example we would see this in the "post_text" row.

    [NewsSummary]Something happened today, it was so incredible you really had to be there[/NewsSummary]
    [SourceName]CNN[/SourceName]
    [SourceLink]http://cnn.com/something_crazy/[/SourceLink]
  • When a visitor goes to my News forum category they see a list of the items like regular forum but when they view a particular topic in this category they will see this:

    Subject: Something Crazy!
    News Summary:
    Something happened today, it was so incredible you really had to be there.
    Source Name: CNN
    Source Link: http://cnn.com/something_crazy/

I have to go eat lunch

Further improvements and ideas expanding on this are welcome. Please post them in this thread.
Last edited by bonelifer on Fri Feb 24, 2012 7:59 pm, edited 1 time in total.
Reason: Moved from [3.0.x] MOD Writers Discussion
User avatar
waxxie
Registered User
 
Posts: 119
Joined: Fri Oct 16, 2009 5:21 pm

Re: [Planning Phase] Post templates - Multiple textareas/tex

Postby master412160 » Sat Feb 25, 2012 10:01 am

This is a very interesting idea to make a modification for. :)

So this fields would appear below the subject input box right?
User avatar
master412160
Registered User
 
Posts: 273
Joined: Sat May 22, 2010 5:45 pm
Location: Belgium, Flanders
Name: Max Pen

Re: [Planning Phase] Post templates - Multiple textareas/tex

Postby The_White_Eagle » Sat Feb 25, 2012 10:33 am

nice thing

i'm following it
The_White_Eagle
Registered User
 
Posts: 37
Joined: Sat Dec 10, 2005 2:50 pm

Re: [Planning Phase] Post templates - Multiple textareas/tex

Postby Paul » Sat Feb 25, 2012 12:09 pm

Hello,

Please edit your topic title with a prefix as outlined in Modifications Development Forum Rules, section 3a. The prefix you are currently using is not allowed. If your modification is still in development, you can use the prefixes as outlined in section 3a. If your modification is stable, please submit your modification to the phpBB.com MODDB (the modifications release database), for validation pending release. For more information on the benefits of submitting your MOD to the MODDB, please see this topic.

Your cooperation is very much appreciated by the phpBB Modifications Team.

Thank you,
The phpBB Modifications Team
Knock knock
Race condition
Who's there?
User avatar
Paul
MOD Team Member
MOD Team Member
 
Posts: 17565
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier

Re: [Planning Phase] Post templates - Multiple textareas/tex

Postby waxxie » Thu Mar 01, 2012 1:17 am

Paul wrote:Please edit your topic title with a prefix as outlined in Modifications Development Forum Rules


Hi
I did not post this topic in the mods in development forum.
I posted it in mod developer discussion.
One of the other mods on this website moved my topic to this forum.

I posted it in the mod developer discussion because thats what this topic is.
It is just a discussion, there is no mod at the moment being developed.
This is planning phase.

If you wish, you can move it back to mod developer discussion or add a prefix.
User avatar
waxxie
Registered User
 
Posts: 119
Joined: Fri Oct 16, 2009 5:21 pm

Re: [Planning Phase] Post templates - Multiple textareas/tex

Postby Mess » Mon Mar 05, 2012 12:55 pm

Would love to see this. Definitely need something like this for several projects.
Image
User avatar
Mess
Registered User
 
Posts: 714
Joined: Wed Jul 01, 2009 6:37 am
Name: Kim

Re: [Planning Phase] Post templates - Multiple textareas/tex

Postby The_White_Eagle » Mon Mar 05, 2012 6:18 pm

me too

it is a nice thing to see included by default
The_White_Eagle
Registered User
 
Posts: 37
Joined: Sat Dec 10, 2005 2:50 pm


Return to [3.0.x] MODs in Development

Who is online

Users browsing this forum: kevinaf, temporalranger and 31 guests