Forums / Setup & design / has_content is_valid is_set

has_content is_valid is_set

Author Message

Heiner Wurbs

Tuesday 08 November 2005 4:53:26 am

Hi ,
can someone explain the differences of this template operators?

has_content is used in the embed/image.tpl but seems not to work and is not documentated:

{section show=$object.data_map.caption.has_content}

is_valid is also not documentated but worked in earlier versions than 3.6.1

is_set is well documentated, but did not work.

My aim is to test, if the attribute image of a class is filled or not.

Thanks for your help
Heiner

Gurudutt Verma

Wednesday 09 November 2005 12:33:37 am

Hi!

I have tested has_content in the said template works fine here.

Where did you find is_set or is_valid is not working ?

Heiner Wurbs

Thursday 24 November 2005 9:54:45 am

Hi,
I have some problems concerning the new documentation, the deprecated template functions like section and the not documentated functions like has_content and the not working is_set and is_null :(

Here is the sample, the well known breadcrump in new template style, ok, the foreach loops works, but not the is_set and is_null:

first with is_set

{foreach $module_result.path as $index => $object}
	{if gt($index,1) }
		{if is_set( $object.url )}
			{$object.text|wash}  / 
		{else}
			<a href={$object.url|ezurl}>{$object.text|wash}</a> /
		{/if}
	{/if}
{/foreach}

and with is_null

{foreach $module_result.path as $index => $object}
	{if gt($index,1) }
		{if is_null( $object.url )}
			{$object.text|wash}  / 
		{else}
			<a href={$object.url|ezurl}>{$object.text|wash}</a> /
		{/if}
	{/if}
{/foreach}

The old template style was something like

{section name=Path loop=$module_result.path}
    {section show=$Path:item.url}
        {section show=is_set($Path:item.url_alias)}
            <a href={$Path:item.url_alias|ezurl}>{$Path:item.text|wash}</a> /
        {section-else}
            <a href={$Path:item.url|ezurl}>{$Path:item.text|wash}</a> /
        {/section}
    {section-else}
        {$Path:item.text|wash}
    {/section}
{section-else}
{/section}

Anybody knows?
Heiner

Gurudutt Verma

Friday 25 November 2005 1:00:29 am

Hi!

It seems it is not working here as well.

Could you report this as bug. so it could be tested there.

Please provide this link over there as well.

Thanks for digging code :-)