相关疑难解决方法(0)

Magento - 检查cms页面

我想通过php查看页面是否是Magento中的cms_page.我需要针对cms页面的不同面包屑,所以我试着用条件,但我不知道如何或在哪里看.到目前为止,我的breadcrumbs.phtml.

<?php if(this is a cms page): ?>

<p>some content</p>
<?php else: ?>
<?php if($crumbs && is_array($crumbs)): ?>
<div class="breadcrumbs">
    <ul>
    <?php $charsges = 0; ?>
    <?php foreach($crumbs as $_crumbName=>$_crumbInfo): ?>
        <?php
        $charsges = strlen($_crumbInfo['label']) + $charsges;
        if($charsges > 40){
            $chars = 18;
            if(strlen($_crumbInfo['label']) > $chars){
                $_crumbInfo['label'] = substr($_crumbInfo['label'], 0, $chars);
                $_crumbInfo['label'] = $_crumbInfo['label'].'..';
            }
        }
        ?>
        <li class="<?php echo $_crumbName ?>">
        <?php if($_crumbInfo['link']): ?>

        <a href="<?php echo $_crumbInfo['link'] ?>" title="<?php echo $this->htmlEscape($_crumbInfo['title']) ?>"><?php echo $this->htmlEscape($_crumbInfo['label']) ?></a>
        <?php elseif($_crumbInfo['last']): ?> …
Run Code Online (Sandbox Code Playgroud)

php zend-framework magento conditional-statements

9
推荐指数
1
解决办法
2万
查看次数