Note that there are some explanatory texts on larger screens.

plurals
  1. POMagento - check if cms page
    primarykey
    data
    text
    <p>i want to check via php if a page is a cms_page in Magento. I need diffrent breadcrumbs for cms pages, so im trying to this with a condition, but i have no idea how to or where to look at. Heres my breadcrumbs.phtml so far.</p> <pre><code>&lt;?php if(this is a cms page): ?&gt; &lt;p&gt;some content&lt;/p&gt; &lt;?php else: ?&gt; &lt;?php if($crumbs &amp;&amp; is_array($crumbs)): ?&gt; &lt;div class="breadcrumbs"&gt; &lt;ul&gt; &lt;?php $charsges = 0; ?&gt; &lt;?php foreach($crumbs as $_crumbName=&gt;$_crumbInfo): ?&gt; &lt;?php $charsges = strlen($_crumbInfo['label']) + $charsges; if($charsges &gt; 40){ $chars = 18; if(strlen($_crumbInfo['label']) &gt; $chars){ $_crumbInfo['label'] = substr($_crumbInfo['label'], 0, $chars); $_crumbInfo['label'] = $_crumbInfo['label'].'..'; } } ?&gt; &lt;li class="&lt;?php echo $_crumbName ?&gt;"&gt; &lt;?php if($_crumbInfo['link']): ?&gt; &lt;a href="&lt;?php echo $_crumbInfo['link'] ?&gt;" title="&lt;?php echo $this-&gt;htmlEscape($_crumbInfo['title']) ?&gt;"&gt;&lt;?php echo $this-&gt;htmlEscape($_crumbInfo['label']) ?&gt;&lt;/a&gt; &lt;?php elseif($_crumbInfo['last']): ?&gt; &lt;strong&gt;&lt;?php echo $this-&gt;htmlEscape($_crumbInfo['label']) ?&gt;&lt;/strong&gt; &lt;?php else: ?&gt; &lt;?php echo $this-&gt;htmlEscape($_crumbInfo['label']) ?&gt; &lt;?php endif; ?&gt; &lt;?php if(!$_crumbInfo['last']): ?&gt; &lt;span&gt;&amp;nbsp;&amp;gt;&amp;nbsp;&lt;/span&gt; &lt;?php endif; ?&gt; &lt;/li&gt; &lt;?php endforeach; ?&gt; &lt;/ul&gt; &lt;/div&gt; &lt;?php endif; ?&gt; </code></pre> <p>greets rito</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload