Форумы / Cotonti / Support / Parse html or bbcode in extra field for pages?

It seems you can only add plain text to extra fields

foxhound
#1 14.12.2011 09:26

I am trying to add an extra field to my pages which is a text area. In that text area I want to add links which will be clickable once viewed on the page.

I made an extra field in the page structure which I set to textarea with the following html code: [code]<textarea  type="text" class="editor" name="newpagetext" cols="90" rows="5" ></textarea>[/code]

Now, the problem is if you add multiple lines of text it will simply display all those lines of text without a break (or enter to go to the next line) and also it wont read bbcode it will display the plain text (and so the bbcode). So, I tried to write the text in html but that too does not work, it will again show plain text (and so the html code).

Anyone has any idea how I can make a text area actually work properly? Meaning, if I want text to be placed on the next line it actually does that instead of displaying all after eachoter without a break and also is there a way to make the text into clickable urls like you have in the normal text area?

 

ps, I tried to search but the search function here is pretty useless. it always comes up with 100 pages of results no matter if you specificy words or combinations.

So, I used google to search the site but that too did not give me any results.

<img src="http://www.armaholic.com/datas/thumbs/green-sea-battalion-uniforms-version-03-preview_4.jpg" alt="green-sea-battalion-uniforms-version-03-" />
Kingsley
#2 14.12.2011 11:45

I created an extrafield and hardcoded it so it will display as a link

with if/endif it will show or not when you fill in nothing..

foxhound
#3 14.12.2011 12:14

Yes, I know that and made it equal. But that only works if you have a field with one line of text.

I created a text area which may have 15 lines, each line should be a clickable url. I can of course create 15 extra fields and hardcode them being urls but thats not really "economic". I hoped somehow you can do stuff with a text area.

<img src="http://www.armaholic.com/datas/thumbs/green-sea-battalion-uniforms-version-03-preview_4.jpg" alt="green-sea-battalion-uniforms-version-03-" />
Trustmaster
#4 14.12.2011 13:52

Do you need those links for a specific page or for an arbitrary number of pages?

Sorry, but extrafields in Genoa don't support html/bbcode parsing. This feature was added in Siena where extrafields are reworked.

For now, Kingsley's solution might be the best for you, despite the 15 extra fields. It is not economic, but in practice it is possible to have up to 100 extra fields.

May the Source be with you!
foxhound
#5 14.12.2011 16:29

Thanks Trustmaster for confirming that.

Yes, it will have to work on any page, not just one otherwise I could have made a specific page for it ;)

I hope to move my site to Sienna next year, there is a lot of things in it I like but first I am going to build my own new skin from scratch (already in progress) and prepare it for Sienna. Makes no sense for me atm to move knowing my plans.

 

So, 15 or something extrafields it is than I guess.

Just one question, a while ago you or another dev said those blocks ( <!-- IF {xxxxxxxxxx} --> <!-- ENDIF -->) when used a lot could slowdown pageloading. Would that be the case here as well when I add lets say 15 extra field to every page which will only show if content has been added in the field?

For now the website I am making it for is small and doesn't have many pages, but in case I want to use something equal on my site (around 12k+ pages) it would be nice to know if thats indeed the case or I can use it without noticable slower loading times.

<img src="http://www.armaholic.com/datas/thumbs/green-sea-battalion-uniforms-version-03-preview_4.jpg" alt="green-sea-battalion-uniforms-version-03-" />
Trustmaster
#6 14.12.2011 17:48

I usually recommend to avoid overusing logical blocks if they are not really necessary. But the impact is not so noticable, especially if your config $cfg['xtpl_cache'] = true. So they are not likely to do any harm on your site.

May the Source be with you!
foxhound
#7 14.12.2011 22:12

Thank you for the additional information, it should be no issue than cool

<img src="http://www.armaholic.com/datas/thumbs/green-sea-battalion-uniforms-version-03-preview_4.jpg" alt="green-sea-battalion-uniforms-version-03-" />
staleo
#8 28.10.2013 12:09
#32062 Trustmaster:

Sorry, but extrafields in Genoa don't support html/bbcode parsing. This feature was added in Siena where extrafields are reworked.

Sorry for rising such an ancient topic on top, but: how? How do I turn the HTML parsing on in the Extrafields? Can't see a proper option on the admin/extrafields?n=cot_pages page. :(

(Siena 0.9.14, btw.)

Trustmaster
#9 28.10.2013 15:42

Extrafields use default system-wide parser specified in Admin / Configuration / Main settings.

May the Source be with you!