Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Predefined Posting Templates with markup (Thickbox? Stash?)

TomTesterTomTester New
edited October 2007 in Vanilla 1.0 Help
PROBLEM:
I have a forum where people post event listings.
I find no two people use the same format, reducing legibility, ease of use.
I often end up re-writing event posts to ensure consistency.
This problem pertains to both post TITLE and post CONTENT.

IDEA:
Provide people with a posting template, which, with the appropriate fields
filled out, will generate a marked up post in a standard format.

BENEFITS:
Consistent lay-out
Consistent content elements
Markup (invisible) would allow content re-use

EXAMPLE:
- START NEW DISCUSSION
-> SELECT DISCUSSION CATEGORY ("EVENT")
-> POPS UP THICKBOX WITH "EVEN POSTING TEMPLATE" FORM
TITLE : _________________________________ DATE : __/__/__ TIME : __:__ - __:__ VENUE : _________________________________ STREET: _________________________________ CITY: _________________________________ STATE: _________ ZIP: _________ COUNTRY: _________ HOST: _________________________________ TEXT: _________________________________ _________________________________ [SUBMIT] [CANCEL]

User fills out the 'event template' above like this:
TITLE : VANILLA OFF-LINE MEET DATE : 3/3/2007 TIME : 8:00 pm - 10:00 pm VENUE : BOEING BAR URL : http://www.boeingbar.com STREET : 232 THIRD AVE CITY : NEW YORK STATE : NY ZIP : 10016 COUNTRY : USA HOST : Tom Tester TEXT : Let's take it off-line & outside babies... Sure you can code, but can you drink?

IDEAL RESULT (a man can dream, not?)
This results in the generation/insertion of an hCalendar microformat
<div class="vevent"> <a class="url" href="http://www.boeingbar.com/"> <span class="summary">VANILLA OFF-LINE MEET</span> </a>: <abbr class="dtstart" title="2007-03-03T20:00:00-05:00">3 March 2007 from 8:00pm EST</abbr> until <abbr class="dtstart" title="2007-03-03T022:00:00-05:00">3 March 2007 from 10:00pm EST</abbr> at the <span class="location">BOEING BAR, 232 THIRD AVE, NEW YORK, NY</span> <div>Let's take it off-line & outside babies...<br>Sure you can code, but can you drink?</div> Hosted by <span class="uid">Tom Tester</span> </div>
Note: posting template-specific CSS takes care of formatting

WORKABLE RESULT (good enough for me)
<a class="url" href="http://www.boeingbar.com/"><b><font size="4" color="red">VANILLA OFF-LINE MEET</font></b></a> 3 March 2007 from <b>8:00pm EST</b> until 3 March 2007 from 10:00pm EST at the <b>BOEING BAR, 232 THIRD AVE, NEW YORK, NY 10016, USA</b> Let's take it off-line & outside babies... Sure you can code, but can you drink? Hosted by <i>Tom Tester</i>

FORUM POSTING RESULT
VANILLA OFF-LINE MEET
3 March 2007 from 8:00pm EST until 3 March 2007 from 10:00pm EST
at the BOEING BAR, 232 THIRD AVE, NEW YORK, NY 10016, USA
Let's take it off-line & outside babies...
Sure you can code, but can you drink?
Hosted by Tom Tester
Of course posting templates could be created for many other 'standard'
posts as well, e.g. item for sale, job posting, etc. etc.

Reactions? Ideas? Willing participants?
«1

Comments

  • Options
    It sounds like you want to take the GigsCalendar to the next step. I would think the best way would be to add a table to the db to keep track of the events.
  • Options
    TomTesterTomTester New
    edited March 2007
    Jim, don't focus on the event example.

    I meant it for ANYTHING that could benefit from a 'posting template' of sorts.

    For example... when posting job info, people need to provide the location,
    the title, the job description, requirements and contact info. I have many
    job postings where the location is not included, so people do not know to
    which geographic region it applies. Ditto with contact info for the poster.

    In those cases a posting template could make sure the poster remembers all
    the info that may be needed. It will be a 'flexible' database, initially used to
    COLLECT and PRESENT data in a consistent fashion.

    I merely use the forum post itself to store the (structured) data. Hence the
    forum post BECOMES the database, not unlike storing an XML record in a
    MEMO/TEXT field.
  • Options
    PS The idea was actually sparked by the JANINE plugin. I see a LOT of
    possibilities once 'discussion creation' based on a 'ping' is a reality.
  • Options
    Hmmm! A pop-up form triggered by one category defined by the forum admin.
  • Options
    Let me see if I get the whole idea... you are talking about creating a post from a predefined set of templates (microformats) which, when selected, popup in a Thickbox which disappears when and takes you to the newly created post when you hit the submit button?

    If so I love this idea :)

    Sounds like you need a dropdown menu with the available (microformat where possible) templates in which then opens the contents via AJAX in a Thickbox? Ignoring, for a moment, the submitting a new discussion part, the templates can be very simple PHP pages with a form in that spits out an HTMLised post. Ideally the dropdown menu would even be populated by reading the "templates" directory (when an admin hits a refresh button in the admin site).

    Mark's basically done something like this second part already on this forum with the Add-ons hasn't he?
  • Options
    Yes, or selectable by the user. Above scenario is my ideal situation/implementation,
    but K.I.S.S. works too, i.e. drop-down with some posting templates, a link, etc.
  • Options
    What about a tickbox directly beneath the "Start a new discussion"?

    Start a new discussion

    from a template

    ...and when you tick that box a dropdown appears beneath?

    Start a new discussion

    from a template
    Pick a template...Discussion Template 1Discussion Template 2Discussion Template 3

    And then when you pick one it fires up the Thickbox. You could even then decide you picked the wrong one, close the Thickbox and pick another. This would seriously rock - now we just need to find someone to code it :D
  • Options
    Mark's basically done something like this second part already on this forum with the Add-ons hasn't he?
    Didn't think of that, but yes, you're absolutely right.

    I listed all the bells and whistles above. Forget about the microformats, the CSS, etc. etc.
    We can start with the basics.

    The Posting Template Plugin (PTP):
    - PTP adds a templates drop-down above the comment form
    - each item in the PTP drop-down refers to a form URL (either hosted on the forum server or elsewhere, e.g. formspring.com)
    - once the users picks a template, PTP opens up a thickbox with said forum URL
    - the submit button (action) for the form is coded to send it to a 'form accept' function provided/facilitated by the PTP plugin
    - this function accepts the form contents, formats it, and inserts it into the comment field as HTML via nifty JavaScript/AJAX

    The security aspects can be handled by existing comment verification (e.g. SirNot's HTML cleaner add-on).
    It SOUNDS like a very basic mechanism. We can always add any XML/mF bells and whistles later.
  • Options
    I like the name "Discussion Templates" - does what is says on the tin ;)

    I'd love to take a look at this,but I don't have much time atm.
  • Options
    I'm not stuck on the name... DT, PTP, all good.
  • Options
    I'd find an extension like this *very* useful... Has anyone looked into it further?

    I can definitely help code this, but I see some serious problems that I'm not thinking my way around as of yet. The biggest problem I see is not putting the structured info into the post, but getting it out again for editing. Secondary, is that the info should be searchable though the standard Vanilla search. That, of course, rules out putting that data in a separate table, or at a minimum makes for a fun bit of hacking the search code to pull it back in.

    One proof of concept/starting point I'm looking at is the structured blogging plugin for Wordpress. That stores post information doubly in the body. 1) as xml data (microformat), and 2) the same data reformatted for proper display. Having the former embedded in the post gives an easy way to pull it back into the edit form, and the latter leaves the post data searchable.

    I'm going to mess around with the code this weekend/next week and see if the plugin can be ported over, or at least get a handle on how to make the idea go in Vanilla.

    Thoughts?
  • Options
    FCKeditor already comes with a template button.
    look up fcktemplates.html file. u can design ur templates in it.
    the user clicks on the template button, the user picks one template from the available one, and a dummy post is made in ur text area, which u can fill in
  • Options
    @Stash - regarding the checkbox and then the dropdown, i say ditch the checkbox. It's one extra click that isn't really needed. Instead, i would just put a line of text above it that says something like "or use a template if you wish" or something similar. anything that can be accomplished in less clicks is better, i say. having a checkbox to hide the field isn't a bad idea if there are tons of fields and that extra click is justified, i just think this is a small enough example that it isn't merited here.
  • Options
    I can't believe I didin't see this before--but this is very similar to the clipboard extension that existed for 0.9.3

    Basically, you saved a chunk of text in your "clipboard", and select the text block by name from a pulldown, which "pastes" it into the form.
  • Options
    right now I'm running PostEditor on my test system. It has snippets support. what u do is type "Event" and press tab, and it spits out a template and puts he cursor in the first Editable param in the template. U press tabs and move to one param to another untill ur done.
  • Options
    Gauzy, sure :) The first option in the dropdown can just be "Don't use a template" or something like that.

    Schiz, if you mean that you have a form that you fill in, I like this idea (although a dropdown makes more sense to me). If a template activates a form that then gets filled out (allowing data validation etc in future versions), surely, for editing purposes these fields can just be pulled back into the form? A bunch of DIVs with classes (Field1, 2, 3 etc) could be created from the form and then parsed back into a form for editing of the template no?
  • Options
    edited April 2007
    the forms in FCKeditor are live. they can do GET and POST, so u can submit them sure. Dunno if u can edit them back. are u interested in getting it done and have it working. or more interested if it has a pulldown menu or not.
  • Options
    TomTesterTomTester New
    edited April 2007
    @Schiz/Wall:
    What you mention is cool too, but a little TOO simple for my taste. I think the structure of a FORM
    is key here (no editing of field names etc.).

    @BShulz
    The biggest problem I see is not putting the structured info into the post, but getting it out again for editing.

    Though editing posts would be supremely useful, I could even live without that option... that said, simple
    structures can be parsed with with simple tools, e.g. see these articles:
    http://www.danwebb.net/2007/2/9/sumo-a-generic-microformats-parser-for-javascript
    http://www.kaply.com/weblog/2007/01/31/parsing-microformats/
    http://www.kaply.com/weblog/2007/04/18/microformat-objects-in-javascript/

    Building a form on the fly isn't that much more difficult either...

    Secondary, is that the info should be searchable though the standard Vanilla search. That, of course,
    rules out putting that data in a separate table, or at a minimum makes for a fun bit of hacking the search
    code to pull it back in.


    I'd prefer to avoid separate tables and anything complicated.. and keep 'structure' stored with the data.'
    One trick could be to define a CSS style that HIDES the FIELD NAMES from display, but would not be
    missed by the search engine (e.g. in my original example imagine

    <div class="vevent"> <a class="url" href="http://www.boeingbar.com/"> <span class="summary">VANILLA OFF-LINE MEET</span> </a>: <div class="invisible">START TIME: </div><abbr class="dtstart" title="2007-03-03T20:00:00-05:00">3 March 2007 from 8:00pm EST</abbr> until <div class="invisible">END TIME: </div><abbr class="dtstart" title="2007-03-03T022:00:00-05:00">3 March 2007 from 10:00pm EST</abbr> at the <div class="invisible">LOCATION: </div><span class="location">BOEING BAR, 232 THIRD AVE, NEW YORK, NY</span> <div>Let's take it off-line & outside babies...<br>Sure you can code, but can you drink?</div> Hosted by <div class="invisible">USER: </div><span class="uid">Tom Tester</span> </div>
    IMHO by abusing the 'unknown HTML tag' 'feature' (i.e. every tag not recognized by the browser will not
    be rendered) you can actually store structure inside a regular post (providing the HTML formatter leaves
    those tags in).
  • Options
    edited April 2007
    do u have a form html template that u want to use. post it here
  • Options
    @Schiz: Not sure I follow you. Do you mean the form template design itself, or the data for each post?
This discussion has been closed.