drnl10253 2018-08-31 17:26
浏览 52

为什么自定义Breadcrumb链接所有进入索引页面,即使href字符串似乎正确?

I'm trying to generate custom Breadcrumbs in a SilverStripe app and I can't figure out why the links are not working. The HTML code in page source appears to be what I want and if I click on a link from the elements section of Safari's webpage inspector, I can land on the correct page. However, when I hover over the link or click on any of my Breadcrumb links in the browser page, I always see localhost and get directed to the homepage. Any ideas how to fix this?

Here's some relevant code

My template, Breadcrumbs.ss:

<% loop $MyBreadcrumbs %>
  <a href="$url" title="$name">/ $name </a>
<% end_loop %>

The code below is HTML copied from Page Source. The links from this section all go to the root page, “/“, instead of, for example, "/resources/links/"

<div id="Breadcrumbs" class="grid_9 alpha">
    <a href="/" title="Home">/ Home </a>
    <a href="/resources/links/" title="Links">/ Links </a>
</div>

The links below all work and are generated using the $Link SilverStripe common variable:

<div class="row">
    <aside class="col-3 col-md-3 d-none d-md-block d-print-none">
        <ul class="aside__nav">
            <li>
                <a href="/resources/links/" title="Links">Links</a>
            </li>
        </ul>
    </aside>
</div>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 对于相关问题的求解与代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
    • ¥15 保护模式-系统加载-段寄存器
    • ¥15 电脑桌面设定一个区域禁止鼠标操作
    • ¥15 求NPF226060磁芯的详细资料
    • ¥15 使用R语言marginaleffects包进行边际效应图绘制
    • ¥20 usb设备兼容性问题
    • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊
    • ¥15 安装svn网络有问题怎么办