Forums / Cotonti / Support / Replacing {PAGE_TEXT} with multiple extra fields.

What would be the consequenses of this? Should it never be done?

foxhound
#1 2013-12-01 17:56

I was talking to someone the other day and he suggested to use additional extra_fields to create a page text area.
By default we have this one big area of text where people write all the text they want to display on the page (wether using bbcode or html). So, instead of making one big area, what would happen if we use extra fields to create every specific part of a page with the specific text in it?

For example, site staff knows how to properly write pages, make additional subtitles on a page which contains specific info. However normal members do not know such a proper formatting and often submit a very messy page with wrong formatting. Sometimes they just do not know, they simply do not get it or they do not care at all.
So, to always preserve a page layout using extra fields which create the proper page layout for anyone who writes a new page could solve this.

However, I am not sure if we go this route what could happen and wether it might be bad for whatever reason.
Could it cause conflicts with the caching? What about SEO? Could it could issues with the database or with the load times of the website cause it is not optimised for such usage?

Just some questions I hope people can maybe answer cause I truly do not have any idea wether this might be a nice workaround or the worst idea ever presented.

Any thoughts on this?

<img src="http://www.armaholic.com/datas/thumbs/green-sea-battalion-uniforms-version-03-preview_4.jpg" alt="green-sea-battalion-uniforms-version-03-" />
Twiebie
#2 2013-12-01 18:50

That should be fine.

I don't know what sort of content is submitted by your members, but for example Markdown instead of HTML or BBCode can provide more consistency across the pages.

foxhound
#3 2013-12-01 19:09

Right now all our pages are created with bbcode. We provide people with templates so all they have to do is change/add the text. However, even for some that is to hard and they start changing the templates making them bugged (so bbcode does not work) or changing them to a layout we do not wish to use or deleting them all together, so a submitted page has no layout at all and we need to adjust the submission.

You have to excuse me but I think Markdown is the editor which is also used here on the Cotonti forums right?

<img src="http://www.armaholic.com/datas/thumbs/green-sea-battalion-uniforms-version-03-preview_4.jpg" alt="green-sea-battalion-uniforms-version-03-" />
Twiebie
#4 2013-12-01 19:29

The Cotonti website is currently using HTML, but there are plans to start using Markdown for things like documentation.

Here is more information on Markdown: http://daringfireball.net/projects/markdown/basics

Though, even with Markdown it won't fully solve the problem you experience with members submitting pages that are not in line with your guidelines.
In that case I think your own suggestion to use extra fields that members can fill out would be your best option.

foxhound
#5 2013-12-01 20:48

Thanks for that link and info. Its always good to get more up to date with available editors.

Just one more question if you do not mind, how could I make an editor available to extra fields? I can see for example bbcode works in an extra field text area but there is no text editor tool bar above it. Would it be possible to adjust those editors in such a way so they display above every extra text field I want it to have a text editor?
If I ask something simple, sorry but I never really spend much time on any editor till now so I hardly know how they work and get configured to work with Sienna.

<img src="http://www.armaholic.com/datas/thumbs/green-sea-battalion-uniforms-version-03-preview_4.jpg" alt="green-sea-battalion-uniforms-version-03-" />
Twiebie
#6 2013-12-01 22:36

Add class="editor" to the extrafield's base HTML.

<textarea class="editor" name="{$name}" rows="{$rows}" cols="{$cols}">{$value}</textarea>

 

foxhound
#7 2013-12-01 23:00

Excellent, works like a charm. Thank you very much!! :)

<img src="http://www.armaholic.com/datas/thumbs/green-sea-battalion-uniforms-version-03-preview_4.jpg" alt="green-sea-battalion-uniforms-version-03-" />
Twiebie
#8 2013-12-01 23:09

Awesome!