smarty variable modifiers

Do something cool with CMS? Show us ...
This board is for 'Answers', and the discussion of answers... Not for questions.
Post Reply
essexboyracer
Forum Members
Forum Members
Posts: 85
Joined: Wed Jun 20, 2007 5:40 pm

smarty variable modifiers

Post 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
Last edited by essexboyracer on Wed Jun 20, 2007 6:05 pm, edited 1 time in total.
User avatar
Gregor
Power Poster
Power Poster
Posts: 1874
Joined: Thu Mar 23, 2006 9:25 am
Location: The Netherlands

Re: smarty variable modifiers

Post 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
User avatar
mesaverde
Forum Members
Forum Members
Posts: 15
Joined: Sat Apr 07, 2007 3:20 pm
Location: Colorado, USA

Re: smarty variable modifiers

Post 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
essexboyracer
Forum Members
Forum Members
Posts: 85
Joined: Wed Jun 20, 2007 5:40 pm

Re: smarty variable modifiers

Post 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
Post Reply

Return to “Tips and Tricks”