![]() |
Meta Tags Help |
Post Reply ![]() |
Author | |
rotokirby ![]() Senior Member ![]() ![]() Joined: 22-April-2007 Location: United States Status: Offline Points: 0 |
![]() ![]() ![]() ![]() ![]() Posted: 09-March-2011 at 8:02pm |
I'm working on making it a little easier for us to cross post links to our newest products on Facebook.
One of the Facebook features for posting is the "Link" button. When you click it, it pulls the title, description and image from the linked page for the post. But without the correct meta-tag to tell Facebook which image to use, it can't find the correct product image for the link, but rather tries to pull random images from our navigation. A little searching has led me to believe we need the following in the head of each page.... < link rel="image_src" href="http://www.example.com/" /> What I'd like is code to generate that meta-tag, linking it to the general image for the product page, or if the link is to a search result or category page... the thumbnail image for the first item returned by the search adn/or in the category. I suppose we would need a fall back in case the linked page is something other than a product page, search result or category page. Anyone done anything like that? |
|
![]() |
|
Greg Dinger ![]() Certified ProductCart Developers ![]() ![]() Joined: 23-September-2006 Location: United States Status: Offline Points: 238 |
![]() ![]() ![]() ![]() ![]() |
By the time header.asp gets invoked by viewPrd.asp, we know what product id we are working with, and have already grabbed the database fields. These statements define the variables that contains the image names.
pimageUrl=rs("imageUrl") pLgimageURL=rs("largeImageURL") You should be able to simply add some code that writes your meta tag into the header.asp file.
<% if pcStrPageName = "viewPrd.asp" then %>
<link rel="image_src" href="http://www.example.com/store/pc/catalog/<%=pimageUrl%>" /> <% end if %> Note that I have not tested this. Edited by Greg Dinger - 09-March-2011 at 10:45pm |
|
![]() |
|
rotokirby ![]() Senior Member ![]() ![]() Joined: 22-April-2007 Location: United States Status: Offline Points: 0 |
![]() ![]() ![]() ![]() ![]() |
Greg...you rule.
That works perfectly for individual product pages. Now...any ideas on how to build that same link for a search result, using the image of the first result? When we add a bunch of products at once I like to point customers to just the group (such as all in stock products for a certain keyword) I want them to see using a search result link. I tried to use pcShowProductsH.asp to make a link for each image on the page, but I think Facebook needs it to be in the head of the document. |
|
![]() |
|
Greg Dinger ![]() Certified ProductCart Developers ![]() ![]() Joined: 23-September-2006 Location: United States Status: Offline Points: 238 |
![]() ![]() ![]() ![]() ![]() |
Might want to look at the code and see if there is similar logic that grabs the database. If that doesn't work out, maybe have us do this for you as we wrap up that upgrade project?
|
|
![]() |
|
rotokirby ![]() Senior Member ![]() ![]() Joined: 22-April-2007 Location: United States Status: Offline Points: 0 |
![]() ![]() ![]() ![]() ![]() |
Thanks Greg....I couldn't figure out an easy way to do it on the search results page since they database calls all actually take place in ShowProductsH.asp instead of searchresults.asp.
Regardless...yeah, we'll look into it further when we're ready to wrap up the transition you're already helping us with. Thanks! |
|
![]() |
|
ProductCart ![]() Admin Group ![]() ProductCart Team Joined: 01-October-2003 Status: Offline Points: 135 |
![]() ![]() ![]() ![]() ![]() |
We will add rel="image_src" to ProductCart in the next version, at least to category and product pages.
|
|
![]() |
|
rotokirby ![]() Senior Member ![]() ![]() Joined: 22-April-2007 Location: United States Status: Offline Points: 0 |
![]() ![]() ![]() ![]() ![]() |
Thanks EI team. Top notch as always!
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |