Pinterest在描述中详细描述了url的多个参数

时间:2012-09-19 09:25:26

标签: pinterest

我正在将Pin it功能集成到我的网站中,但我无法在url或description中传递多个参数。我尝试过以下代码

    $detail_wow_pin = $baseurl.'/wow/Wowitems/wowdetail?
obj_id='.$obj_id.'&obj_type='.$obj_type;

        <a href="http://pinterest.com/pin/create/button/?
url=http://softprodigy.in/thinkbright/wow/Wowitems&media=<?=$wowimg?>
&description=<?='http://'.$_SERVER['SERVER_NAME'].''.$detail_wow_pin?>" 
count-layout="none">
    <img src="<?php echo IMG_WOWS; ?>/img/pinterest.png" alt="">
    </a>

由于

2 个答案:

答案 0 :(得分:6)

我找到正确的url编码整个href,确认&符号(&amp;)编码为&amp;在href属性中。此外,&amp;在url参数中编码为%26并将url参数移动到href属性中的最后一个位置将正确创建链接,返回到包含该图像的页面时,从其引脚板上单击。

示例:

<a href="//pinterest.com/pin/create/button/?media=http%3a%2f%2example.com%2fImages%2fimage.jpg&amp;description=Example+description.&amp;url=http%3A%2F%2Fexample.com%2FExample%2FExample.php%3Fparam1%3Dvalue1%26param2%3Dvalue2%26param3%3Dvalue3"><img src="//assets.pinterest.com/images/pidgets/pin_it_button.png"></a>

答案 1 :(得分:0)

Pinterest的动态链接

  

下面的代码将为不同的页面生成动态pinterest按钮。

<a href="http://pinterest.com/pin/create/button/?url=http://www.example.com/page-one&amp;media=http://www.example.com/image/cache/data/image.jpg&amp;description=description will come here" class="pin-it-button" count-layout="none">
 <img src="http://assets.pinterest.com/images/PinExt.png" data-cfsrc="//assets.pinterest.com/images/PinExt.png" title="Pin It" border="0">
</a>