【问题标题】:TYPO3 / TypoScript : how do I get an image url from page? pinterestTYPO3 / TypoScript :如何从页面获取图像 url?兴趣
【发布时间】:2014-02-27 11:30:21
【问题描述】:

如何从我的 TYPO3 页面获取图片 URL 以在 pinterest 上分享?

我尝试通过 pinterest 分享图片。我可以通过 twitter 和 facebook 分享我的个人页面,但在 pinterest,我需要一个图片网址。如何从页面 XY 获取我的图像?带有文本和图像的普通内容页面......我要分享的图片来自扩展。

<img src="typo3temp/GB/Donna_Lanea8d0434f4.jpg" width="398" height="398" border="0" alt="" title="" style="opacity: 1;">

我不想使用社交书签插件!

这是我的社交链接,它适用于 facebook 和 google+、twitter、..

...
lib.social = COA
lib.social {


15 = TEXT
15 {
    wrap = <li class="social_two">|</li>
    value = Pinterest
    typolink.title = Pin it on Pinterest
    typolink.ATagParams = class="social pt"  target="_blank"
    typolink.parameter.cObject = COA
    typolink.parameter.cObject {
        10 = TEXT
        10.dataWrap = http://www.pinterest.com/pin/create/button/?url=|
        10.data = getIndpEnv:TYPO3_REQUEST_URL
   }
}

感谢您的帮助

【问题讨论】:

  • 我希望您知道,如果您在没有 htmlspecialchars 的情况下使用 getIndpEnv:TYPO3_REQUEST_URL,则会在您的网站上创建一个 XSS 安全漏洞。此外,如果您没有要解释的数据,则不应使用 dataWrap。我建议改用typolinktypo3.org/documentation/snippets/sd/131(只需从参数中删除,98)。

标签: typo3 typoscript pinterest


【解决方案1】:

我使用以下代码段,它可以工作。没有排版。

<a class="social pt" href="javascript:void((function()%7Bvar%20e=document.createElement('script');e.setAttribute('type','text/javascript');e.setAttribute('charset','UTF-8');e.setAttribute('src','http://assets.pinterest.com/js/pinmarklet.js?r='+Math.random()*99999999);document.body.appendChild(e)%7D)());">
            Pin it on Pinterest or your image
        </a>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-06-17
    • 2018-01-15
    • 2020-01-10
    • 1970-01-01
    • 1970-01-01
    • 2016-01-17
    • 2021-10-11
    • 1970-01-01
    相关资源
    最近更新 更多