Pinterest multiple parameters for detail url in description - pinterest

I am integrating the Pin it functionality in my website, but I am unable to pass multiple parameters in url or description . I have tried with the following code
$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>
Thanks

I find properly url encoding the entire href, confirming the ampersand (&) encodes as & inside the href attribute. Furthermore, & encodes as %26 inside the url parameter and moving the url parameter to the last place in the href attribute will properly create the link back to the page containing the image when clicked on from your pin it board.
Example:
<img src="//assets.pinterest.com/images/pidgets/pin_it_button.png">

Dynamic Link for Pinterest
Below code will generate dynamic pinterest button for different pages.
<a href="http://pinterest.com/pin/create/button/?url=http://www.example.com/page-one&media=http://www.example.com/image/cache/data/image.jpg&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>

Related

Xpath - Exclude elements within TD

I'm trying to use Chrome's scraper extension using XPath. I've been able to scrape everything I need from a table, but I'm stuck in one spot. Here's the source
<td>
<p class="pClass">
<a href="theurl" target="_blank">
<i class="iClass">someText</i>
Anchor text
</a>
</p>
</td>
I'm trying to grab just the URL, but when using my Xpath code as td[9]/p/a it grabs the icon part that says "someText". Is there a way to just grab the URL?
In order to extract url just add #href to your xpath expression, this should work: //td[9]/p/a/#href.
For stripping white space you can use xpath function normalize-space().

How to use Twitter Bootstrap Collapse to show some portion of the text and then the rest

I have text that I am displaying from a database. I would like to have a portion of the text displayed on page load (up to a certain character number), and then display the rest of the text using the "collapse" function from Twitter Bootstrap. I am unsure of how to do this. This is what I have so far:
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne">See More...</a>
<div id="collapseOne" class="accordion-body collapse"><span class="description_text">{{$artist->description}}</span></div>
This will display the entire text contained in the "description" field on the click of the "see more" link. What I would like to have is a portion of the text showing on page load, and then the rest displayed (and toggled) on the click of the see more button. It would also be nice to have the "see more" button change to "see less" when the full text is displayed.
You can run PHP inside the blade tags, so;
<a class="accordion-toggle" data-toggle="collapse"
data-parent="#accordion2" href="#collapseOne">
{{ substr($artist->description,0,30).'...' }}
</a>
The final substr parameter being the number of characters to include
To change the link text, you will need to write some jquery to catch the show.bs.collapse callback and replace the innerhtml of the link.
This Twitter bootstrap 3.0 icon change on collapse is similar but is changing an icon.

Blogger: Custom Social Share Links With Page URL

I'm working on a Blogger template with custom social sharing buttons. The problem I'm having is adding the Current Blog URL to the link.
Here is my code:
<li class="googleplus"><span>Google+</span></li>
If I leave it like that, then when I click to share the webpage, it actually shows data:blog.url, instead of the actual webpage URL.
I tried using:
<li class="googleplus"><a expr:href="https://plus.google.com/share?url=data:blog.url"><span>Google+</span></a></li>
However, that just makes the whole menu not appear at all(even omitted from source).
Is there a solution for this, or am I gonna have to use jQuery to grab the URL and insert it into the link?
This is what i use and it works perfectly
expr:share_url='data:post.url'
OR
<li class='google'>
<a expr:href='"https://plus.google.com/share?url=" + data:post.url' onclick='javascript:window.open(this.href, "", "menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600");return false;' rel='nofollow' title='Share this on Google+'>
<strong>
Google+
</strong>
</a>
</li>
use this code :
<a expr:href='"https://plus.google.com/share?url=" + data:post.url.canonical' expr:onclick='"window.open(this.href, \"_blank\", \"height=430,width=640\"); return false;"' target='_blank'><span>Google+</span></a>

anchor opening element on separate page not working?

I am trying to get my anchors of thumbnails to open to a different page but at the specific element. I don't think it is working as there is a jquery plugin on the page that the elements exist on and I can't find a way to target them. When you click on a image it opens on the first in the sequence but not on the image requested. How can this be solved?
Please see my page here http://i-n-t-e-l-l-i-g-e-n-t-s-i-a.com/melissafranklin.com/index.html
The href attribute of the <a> tag should match the src attribute of the <img> tag
Use this:
<a href="images/paintings/7copy.jpg">
<img src="images/paintings/7copy.jpg" alt="">
</a>
Instead of this:
<a href="paintings.html">
<img src="images/paintings/7copy.jpg" alt="">
</a>

place span tag between anchor tag using Action Link Helper

I got website templates and using it for my website. I am new to asp.net mvc 3 and razor. It is very difficult to modify html tag using html helper. How can I place the span tag between anchor tag using ActionLink Helper. I have used razor and html helper for producing link.
I want to produce following tags:
<li><span class="glyph logout"></span> Logout</li>
I have try this
<li>#Html.ActionLink("<span class='glyph logout'></span> Log out", "LogOff", "Account") </li>
I am confuse how to do that. It is not the correct way that produces span tag as string. How can I produce correct tags.
What you want to use is #Url.Action to create the URL while having your custom HTML.
<li>
<a href="#Url.Action("LogOff","Account")" title="Logout">
<span class="glyph logout"></span> Logout
</a>
</li>
This way you have control over the URL and be able to add your own custom HTML. #Html.ActionLink doesn't allow you to add custom HTML inside the tags natively.
If you need to customize, what's inside your anchor tag, you should use the Html.Action method instead of the Html.ActionLink
<li>
<a href="#Html.Action("LogOff", "Account")" title="Logout">
<span class="glyph logout"></span> Log
</a>
</li>

Resources