Home >CMS Tutorial >DEDECMS >How does dedecms determine that the secondary column is empty and not displayed?

How does dedecms determine that the secondary column is empty and not displayed?

藏色散人
藏色散人Original
2019-12-14 09:54:452479browse

How does dedecms determine that the secondary column is empty and not displayed?

dedecmsHow to determine whether the secondary column is empty and not displayed?

When developing a website with dedecms, if you need to call a secondary column, just use the channelartlist tag. However, if there is no secondary column under this column, an empty DIV will be generated. I tried running PHP to judge the default label, but it was not concise enough. The following is the simplest implementation method.

Recommended study: 梦Weavercms

The latest version of DedeCMS prohibits the running of template PHP. Backend → System → Basic System Parameters → Other Options → The default template engine is disabled Tag, just remove php.

{dede:channelartlist typeid='top'}
<li><a href="{dede:field name=&#39;typeurl&#39;/}">{dede:field name=&#39;typename&#39;/}</a>
{dede:php}
$id = $refObj->Fields[&#39;id&#39;];
$sql = ("SELECT * FROM dede_arctype where reid =&#39;$id&#39;");
$db->SetQuery($sql);
$db->Execute();
if($db->GetTotalRow()){
echo &#39;<ul>&#39;;
while($row = $db->GetArray()){
$url = str_replace(&#39;{cmspath}&#39;,&#39;&#39;,($row[typedir]));
echo "<li><a href=".$url.">".($row[typename])."</a></li>";
};
echo &#39;</ul>&#39;;
};
{/dede:php}
</li>
{/dede:channelartlist}

The above is the detailed content of How does dedecms determine that the secondary column is empty and not displayed?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn