Forums / Setup & design / Switch : Counting chars to execute code...

Switch : Counting chars to execute code...

Author Message

Jorge estévez

Monday 25 October 2004 4:55:43 am

I would like to execute a code if a string is bigger than 16 characters and another code if not, I tryed this code but with no results, can someone point out how to please...

{let littletext=array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16)}
	
{section show=$littletext|contains({$node.name|16}) }
{*short*}

do this if text is less than 16 chars...
{section-else}

{*bigtext*}
			
do this if text is bigger than 16 chars...


{/section}
			
			{/let}


Diseño Web Cuba
Web Design Cuba
www.elfosdesign.com

Jorge estévez

Tuesday 26 October 2004 8:52:37 pm

Please help me with this

Thanks

Diseño Web Cuba
Web Design Cuba
www.elfosdesign.com

Jorge estévez

Sunday 31 October 2004 3:59:02 am

Please help

Diseño Web Cuba
Web Design Cuba
www.elfosdesign.com

Marco Zinn

Sunday 31 October 2004 7:11:48 am

Hi,

if you are talking about a string and want to switch based on the number of characters, you should have a look at the count-function.

Pseudo-code

{section show=your_string_var$|count()|gt(16)}
more than 16 chars
{section-else}
not more than 16 chars
{/section}

Marco
http://www.hyperroad-design.com