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 :-)

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 16:19:57
Script start
Timing: Jan 18 2025 16:19:57
Module start 'layout'
Timing: Jan 18 2025 16:19:57
Module start 'content'
Timing: Jan 18 2025 16:19:58
Module end 'content'
Timing: Jan 18 2025 16:19:58
Script end

Main resources:

Total runtime0.7149 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0044 589.0313152.6250
Module start 'layout' 0.00440.0021 741.656339.4453
Module start 'content' 0.00650.7074 781.1016523.7109
Module end 'content' 0.71390.0010 1,304.812512.1641
Script end 0.7149  1,316.9766 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.4761160.0002
Check MTime0.00150.2042160.0001
Mysql Total
Database connection0.00050.064910.0005
Mysqli_queries0.662292.6296600.0110
Looping result0.00050.0714580.0000
Template Total0.688896.320.3444
Template load0.00220.313220.0011
Template processing0.686596.029920.3433
Template load and register function0.00020.033410.0002
states
state_id_array0.00080.115010.0008
state_identifier_array0.00120.165420.0006
Override
Cache load0.00200.2757360.0001
Sytem overhead
Fetch class attribute can translate value0.00090.122220.0004
Fetch class attribute name0.00100.141450.0002
XML
Image XML parsing0.00060.087120.0003
class_abstraction
Instantiating content class attribute0.00000.001860.0000
General
dbfile0.00070.0913160.0000
String conversion0.00000.001040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 25
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs