Print Page | Close Window

Meta Tags Help

Printed From: ProductCart E-Commerce Solutions
Category: ProductCart
Forum Name: Customizing ProductCart
Forum Description: Exchange messages with other users that are customizing ProductCart.
URL: https://forum.productcart.com/forum_posts.asp?TID=4355
Printed Date: 14-July-2025 at 5:42pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Meta Tags Help
Posted By: rotokirby
Subject: Meta Tags Help
Date 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?

-------------
Rotofugi Designer Toy Store & Gallery
Chicago > IL > US
http://rotofugi.com - http://rotofugi.com



Replies:
Posted By: Greg Dinger
Date Posted: 09-March-2011 at 10:44pm

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/%3c%=pimageUrl% - http://www.example.com/store/pc/catalog/<%=pimageUrl% >" />
<% end if %>
 
Note that I have not tested this. 


-------------
GreyBeard Design Group

Certified ProductCart Developer

Web Design/Development/Hosting

http://tinyurl.com/5c8t4t" rel="nofollow - Add-Ons & Custom Code |


Posted By: rotokirby
Date Posted: 10-March-2011 at 12:45am
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.




-------------
Rotofugi Designer Toy Store & Gallery
Chicago > IL > US
http://rotofugi.com - http://rotofugi.com


Posted By: Greg Dinger
Date Posted: 10-March-2011 at 10:03am
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?


-------------
GreyBeard Design Group

Certified ProductCart Developer

Web Design/Development/Hosting

http://tinyurl.com/5c8t4t" rel="nofollow - Add-Ons & Custom Code |


Posted By: rotokirby
Date Posted: 10-March-2011 at 2:34pm
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!

-------------
Rotofugi Designer Toy Store & Gallery
Chicago > IL > US
http://rotofugi.com - http://rotofugi.com


Posted By: ProductCart
Date Posted: 11-March-2011 at 3:24am
We will add rel="image_src" to ProductCart in the next version, at least to category and product pages.

-------------
The ProductCart Team

Home of ProductCart http://www.productcart.com" rel="nofollow - shopping cart software


Posted By: rotokirby
Date Posted: 11-March-2011 at 2:19pm
Thanks EI team. Top notch as always!

-------------
Rotofugi Designer Toy Store & Gallery
Chicago > IL > US
http://rotofugi.com - http://rotofugi.com



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net