Print Page | Close Window

OG:Image Property on Category Pages

Printed From: ProductCart E-Commerce Solutions
Category: ProductCart
Forum Name: Getting Started
Forum Description: Installing, activating, and getting started with ProductCart
URL: https://forum.productcart.com/forum_posts.asp?TID=5675
Printed Date: 28-April-2024 at 3:39am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: OG:Image Property on Category Pages
Posted By: asteriskmmt
Subject: OG:Image Property on Category Pages
Date Posted: 22-July-2013 at 7:20pm
I am using ProductCart v4.1bacm SP 1 and have just discovered a bug with the way that the include-metatags.php file creates the Open Graph meta tags.

It works just fine on product pages (BTO or otherwise), but it doesn't work on the homepage or category pages because it uses a reference of <%=ogImage%> which is only defined for Product page section of the include-metatags.php file, thus creating a reference to a broken image, so that when people go to share this content on Facebook, it shows up with a broken link (or none at all).

How do we define the following variable in such a way as to have it also see the small images for category pages, and then if no image, default to some image?
ogImage=rsTagObj("smallimageurl")
<meta property="og:image" content="http://www.bestfriendservices.com/store/pc/catalog/<%=ogImage%>"/>

This has become a prominent issue for me as I just implemented a new feature which uses these values to "recommend" other pages to the visitor, and half of my "recommendations" are to pages with a broken image. See http://www.bestfriendservices.com/ and then browse a few pages to see what I am talking about.








Replies:
Posted By: asteriskmmt
Date Posted: 22-July-2013 at 7:21pm
PS: I just inherited this site and am by no means a PC expert, please let me know if this was custom code added by a previous Dev or if this is the same code used on all PC sites.

Thanks in advance!


Posted By: Greg Dinger
Date Posted: 22-July-2013 at 7:39pm
That's not stock code.  If you look at line 324 of the file you reference you'll see this:  'nuc
Kevin did that for CJ years ago.
 
 


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

Certified ProductCart Developer

Web Design/Development/Hosting

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


Posted By: asteriskmmt
Date Posted: 22-July-2013 at 9:48pm
Thanks Greg!



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