簡體   English   中英

在tt_news中鏈接圖像

[英]link an image in tt_news

我正在使用TYPO3 4.2.8和tt_news 2.5.2。 我嘗試了以下代碼段

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
        }
        }
    }
}

然后,我在新聞中添加了圖片,並在鏈接字段(在標簽關系中)添加了一個鏈接。

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

但是,如果我看新聞,圖片上沒有鏈接。 我必須更改什么才能使其與舊版本的tt_news一起使用?

編輯:

現在,我嘗試使用gernericmarkers( 該主題的思想)。 我的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

標記正在工作,但新聞中沒有顯示任何內容。 我的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###-->將您喜歡的任何內容鏈接到詳細信息頁面。

您的第一個代碼段有效,但是您必須將沒有標簽的鏈接插入鏈接字段。 例如

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