today Imperial cms tutorial network The method of displaying different content when the shared judgment field value is empty is applicable to content pages and list pages. You can take one example and use it flexibly! The empire is very powerful, only unexpected, nothing can not be done.
Imperial CMS judges that the field value is empty and displays different contents
For the content page, use the variable $navinfor [field]:
$bqr is used when it is a smart tag
$navinfor is used when it is a content template
The codes are as follows:
<? if($bqr[titlepic]=="") { echo ''; } else{ echo '<a href='.$ bqsr[titleurl].'>< img src='.$ bqr[titlepic].'></ a>'; } ?>
In the list page, you can use program code in list.var. Relevant labels are as follows:
if(empty($r[titlepic])) { $r[titlepic]='/images/img.gif'; }
be careful:
All PHP code must be used in the list page. Otherwise, an error will be reported? Add PHP code directly without adding program start and end tags. The field value array variable is $r, and the corresponding field variable is $r [field name]. For example, the header field variable is $r [title]. In addition, the numbered variable is $no, and the final template content is assigned to the $listtemp variable:
<? php if($navinfor[cnurl]) { ?> Echo 'Displayed content'; <? } else { ?> echo ''; <? } ?>