dongyi2993 2015-02-02 15:51
浏览 45
已采纳

extbase扩展 - 如何更新面包屑

I created an extension with extbase which displays different content dependning on the GET parameters. Is there a way to update the breadcrumbs to reflect this?

My breadcrumbs look like this in typoscript:

temp.breadcrumb = HMENU
temp.breadcrumb {
    special = rootline
    special.range = 0|-1
    1 = TMENU
        1 {
        noBlur = 1
        wrap = <ol class="breadcrumb hidden-xs">|</ol>
        NO {
            stdWrap.crop = 26 | ...
            wrapItemAndSub = <li>|</li>||<li>|</li>||<li class="last">|</li>
            ATagTitle.field = abstract // title // description
            ATagTitle.noTrimWrap = | zur Seite: |
        }
        CUR = 1
        CUR {
            stdWrap.crop = 26 | ...
            wrapItemAndSub = <li class="active">|</li>||<li class="active">|</li>||<li class="last active">|</li>
            doNotLinkIt = 1
        }
    }
}

page.10.variables {
  breadcrumb < temp.breadcrumb
}

and in my template I call them like this:

<f:format.raw>{breadcrumb}</f:format.raw>

So they work fine on normal pages, but not for my extension scripts.

  • 写回答

1条回答 默认 最新

  • dqayok7935 2015-02-03 13:58
    关注

    This is a breadcrumb navigation I did a while ago which incorporates news detail views, but you'll get an idea of how to incorporate your own tables. Please note that there is some additional markup, as it follows the Google Rich Snippet Microformat for breadcrumbs.

    lib.navi.breadcrumbs = COA
    lib.navi.breadcrumbs {
    stdWrap.wrap = <ul class="breadcrumb ">|</ul>
    
    10 = TEXT
    10 {
        value = Your Homepage
        typolink {
            parameter = 1
            ATagParams =  itemprop="url"
            ATagBeforeWrap=1
            wrap = <span itemprop="title">|</span>
        }
        wrap = <li itemscope itemtype="http://data-vocabulary.org/Breadcrumb">|<span class="divider">/</span></li>
    }
    20 = HMENU
    20 {
        special = rootline
        special.range = 1|-1
    
        1 = TMENU
        1 {
            noBlur = 1
    
            NO = 1
            NO {
                wrapItemAndSub = <li itemscope itemtype="http://data-vocabulary.org/Breadcrumb">|<span class="divider">/</span></li>
                ATagParams = itemprop="url"
                stdWrap.htmlSpecialChars = 1
                stdWrap.wrap = <span itemprop="title">|</span>
            }
    
            CUR <.NO
            CUR {
                wrapItemAndSub = <li class="active">|</li>
                doNotLinkIt = 1
                stdWrap.wrap >
            }
        }
    }
    
    # Add new if on single view
    40 = RECORDS
    40 {
        if.isTrue.data = GP:tx_news_pi1|news > 0
        dontCheckPid = 1
        tables = tx_news_domain_model_news
        source.data = GP:tx_news_pi1|news
        source.intval = 1
        conf.tx_news_domain_model_news = TEXT
        conf.tx_news_domain_model_news {
            field = title
            htmlSpecialChars = 1
        }
        wrap =  <li class="active">|</li>
    }
    }
    
    [globalVar = GP:tx_news_pi1|news > 0]
    lib.navi.breadcrumbs.20.1.CUR {
    wrapItemAndSub = <li itemscope itemtype="http://data-vocabulary.org/Breadcrumb">|<span class="divider">/</span></li>
        doNotLinkIt >
    }
    [global]
    

    It basically creates a menu and appends the news title at the end if a news uid is given (lib.navi.breadcrumbs.40).

    The condition condition afterwards changes the behaviour on the last 'real' page from HMENU to act as a normal breadcrumb link.

    You can then integrate the code in your FLUID template via:

    <f:cObject typoscriptObjectPath="lib.navi.breadcrumbs" />
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 远程桌面文档内容复制粘贴,格式会变化
  • ¥15 关于#java#的问题:找一份能快速看完mooc视频的代码
  • ¥15 这种微信登录授权 谁可以做啊
  • ¥15 请问我该如何添加自己的数据去运行蚁群算法代码
  • ¥20 用HslCommunication 连接欧姆龙 plc有时会连接失败。报异常为“未知错误”
  • ¥15 网络设备配置与管理这个该怎么弄
  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题