简体   繁体   English

在tt_news中链接图像

[英]link an image in tt_news

I'm using TYPO3 4.2.8 and tt_news 2.5.2. 我正在使用TYPO3 4.2.8和tt_news 2.5.2。 I tried the following snippet : 我尝试了以下代码段

plugin.tt_news.displaySingle {
    image {
        # turn off default popup anchor
        imageLinkWrap = 0
        # add our link to the first URL in links field
        stdWrap.typolink {
            parameter = {current:1}
            parameter {
            setCurrent.field = links
            setCurrent.listNum = 0
                insertData = 1
        }
        }
    }
}

Then I added an image to my news and also put a link into the link field (in the tab relations). 然后,我在新闻中添加了图片,并在链接字段(在标签关系中)添加了一个链接。

<LINK http://www.yourwesite.com/fileadmin/user_upload/downloads/broschure.pdf _blank>Download brochure</LINK>

But if I look at the news I don't have a link on the image. 但是,如果我看新闻,图片上没有链接。 What do I have to change to get it work with my old version of tt_news? 我必须更改什么才能使其与旧版本的tt_news一起使用?

Edit: 编辑:

Now I tried it with gernericmarkers (idea from this topic ). 现在,我尝试使用gernericmarkers( 该主题的思想)。 My TS looks like the following: 我的TS如下所示:

temp.img = COA
temp.img.5 = IMAGE
temp.img.5 < plugin.tt_news.displaySingle.image
temp.img.5 {
    required = 1
    wrap = |
    file {
        import = uploads/pics/
        import.field = image
        import.listNum = 0
    }
    titleText.field = title
    altText.field = title
    if.isTrue.field = links
    imageLinkWrap.typolink.parameter.data = field:links
}

plugin.tt_news.genericmarkers.imagewithlink < temp.img

The marker is working but there is no content displayed in the news. 标记正在工作,但新闻中没有显示任何内容。 What is wrong with my TS? 我的TS有什么问题?

我不知道这是否适用于您的旧tt_news版本,但至少从3.0+版本起,您可以<!--###LINK_ITEM###--> around your image <!--###LINK_ITEM###-->使用标记<!--###LINK_ITEM###--> around your image <!--###LINK_ITEM###-->模板内的<!--###LINK_ITEM###--> around your image <!--###LINK_ITEM###-->将您喜欢的任何内容链接到详细信息页面。

Your first snippet works, but you have to insert the link without the tags into the link field. 您的第一个代码段有效,但是您必须将没有标签的链接插入链接字段。 eg 例如

http://www.yourwesite.com/fileadmin/user_upload/downloads/broschure.pdf _blank

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM