Page 1 of 1

smarty variable modifiers

Posted: Wed Jun 20, 2007 5:59 pm
by essexboyracer
Hi All, I wanted to share this with you all, I'm not sure if someone has already posted this but i will continue...

Whilst trying to style the output from the news module, I was struggleing to get the short story to sit nicely between the title and more link. Turns out the FCKEditor (or whatever it is called!) places tags around the short story. Im not a CSS guru by any stretch of the imagination.

I tried to do some php code in the news template but didnt work. I was able to remove these tags by utilising a smarty variable modifier, specifically the strip_tags, used as follows;

Code: Select all

	<div class="NewsSummarySummary">
		{eval var=$entry->summary|strip_tags}  {$entry->morelink}
	</div><br>
Voila! no html tags in there. There are others available, check the smarty docs for info:
http://smarty.php.net/manual/en/language.modifiers.php

EBR

another thread on the same topic and in fact there are others
http://forum.cmsmadesimple.org/index.ph ... 478.0.html

Re: smarty variable modifiers

Posted: Thu Jun 21, 2007 5:54 am
by Gregor
EBR,

I'm not sure if I once crossed the same problem. Please have a look at post:
http://forum.cmsmadesimple.org/index.php/topic,10651.msg53375.html#msg53375

Gregor

Re: smarty variable modifiers

Posted: Sat Jun 23, 2007 2:07 pm
by mesaverde
You can change fckeditor's default behavior when hitting the enter key to not insert the p tag. Find the file fckconfig.js in the \modules\FCKeditorX\FCKeditor directory and change these lines:

Code: Select all

FCKConfig.EnterMode = 'br' ;			// p | div | br
FCKConfig.ShiftEnterMode = 'p' ;	// p | div | br
You should be able to use the editor in WYSIWYG mode without those pesky p tags in the wrong places.

You can get the full story here:


http://forum.cmsmadesimple.org/index.php/topic,11847.0.html

Re: smarty variable modifiers

Posted: Fri Jun 29, 2007 4:30 pm
by essexboyracer
Handy to know mesaverde. Thanks for the tip.

I just want to add that I think that CMSMS is a great tool. the company I work for have laid it our across all of their sites. It's fast and easy to use, not only for an end user but for admin like myself.

I have tried a few CMS over the years, most feel bloated and too heavyweight. CMSMS hits the right spot with a good balance in terms of features.

I am thinking of using CMSMS core as a basis for a legal case management system, if anyone has any thoughts on this?

EBR