Typo3:添加锚点,但不知道为什么 [英] Typo3: adds anchor but don't know why

查看:83
本文介绍了Typo3:添加锚点,但不知道为什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在页面上有一个页面内容元素.它具有ID 3,并且具有翻译.可以使用以下Typoscript读取该元素

I have a page content element on a page. This has the ID 3 and it has a translation. This element is read out with the following Typoscript

lib.marker = RECORDS
lib.marker {
  tables=tt_content
    source= 3
    dontCheckPid = 1
  languageField = sys_language_uid
    select.languageField = sys_language_uid
}

对于默认语言,一切正常.但是对于我的其他语言,我得到了

For the default language everything is OK. But for my additional language I get

<a id="c605"></a>

在显示我最初想要的div之前.我查看了页面内容的HTML,并发现了应有的一切.有什么想法吗?

before the div I originally wanted is displayed. I looked in the HTML of the page content and there is everything like it should be. Any ideas?

此处是通过TS对象浏览器收集的内容:

Here the content gathered through the TS Object Browser:

[tt_content] = CASE
    [key]
    [stdWrap]
        [innerWrap]
        [innerWrap2] = | <p class="csc-linkToTop"><a href="#">{LLL...
        [prepend] = TEXT
            [dataWrap] = <a id="c{field:_LOCALIZED_UID}"></a>
            [if]
                [isTrue]
                    [field] = _LOCALIZED_UID

推荐答案

默认行为应该是即使使用默认语言也添加了锚.但是,我刚刚检查并意识到TYPO3中可能存在一个错误,因此我实际上使用了不同的设置.

The default behaviour should be that the anchor is added even in the default language. However, I've just checked and realized that there might be a bug in TYPO3 for which reason I'm actually using different setup.

我认为您有2个选择.

a):完全取消锚定:

tt_content.stdWrap.prepend >

b)这样修改锚点:

tt_content.stdWrap.prepend {
  if >
  dataWrap = <a id="c{field:_LOCALIZED_UID//field:uid}" class="anchor"></a>
}

这应该为您提供默认版本和本地版本的一致锚.然后,您应该为a.anchor设置CSS,以免影响布局.我不知道它会带来什么样的布局问题,所以我目前无法为您提供更多建议.

This should give you an anchor consistently in both default and localized version. Then you should set CSS for a.anchor so that it doesn't screw your layout. I don't know what kind of layout problems it gives so I currently cannot give you more advice on that.

注意::该解决方案在TYPO3 4.5中有效,在以后的版本中可能有效,但报告无效 >在9.xx及更高版本中.

NOTE: The solution works in TYPO3 4.5, might work in later versions but is reported not to work in version 9.x.x and later.

这篇关于Typo3:添加锚点,但不知道为什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆