Facebook & Twitter Friendly XC 4.5.5
Just wanted to share with everyone the custom code we used on our XC 4.5.5 site to integrate Facebook Open Graph and Twitter Cards for mostly every page.
Let us know if you have questions or suggestions! 9-10-2014: Added fix for categories, php pages, static pages, and manufacturer pages. Also cleaned up coding. 10-27-2014: Added compatibility for special offers module pages Code:
<meta property="fb:admins" content="1099545101" /> Note that for Code:
<meta property="og:title" content="{$meta_title}" /> AFTER around line 115: Code:
if (is_string($title)) { AND AFTER around line 150: Code:
if (empty($title_items)) INPUT: Code:
$smarty->assign('meta_title', $title); Be sure to add twitter bot to your robots.txt file: Code:
User-agent: Twitterbot ALSO: This code becomes a little bit tricky if using CDSEO Pro, as the meta title,descriptions,keywords are all from CDSEO and will have to be assigned to a variable in php. If you'd like to see this work (we have ours working) PM me. |
Re: Facebook & Twitter Friendly XC 4.5.5
Very nice of you to share this. Its a hole in my knowledge, I appreciate it.
|
Re: Facebook & Twitter Friendly XC 4.5.5
Quote:
Will it work on 4.6.1 Platinum? |
Re: Facebook & Twitter Friendly XC 4.5.5
Quote:
I have not tested it, but I don't see there being any major issues using this on 4.6.1 since it is all meta tags. The only problem you may have is finding the code in /include/templater/plugins/func.get_title.php. |
Re: Facebook & Twitter Friendly XC 4.5.5
Edited first post. func.get_title.php needs the smarty variable assigned in two sections (was not passing title variable to smarty with static pages, now works)
|
Re: Facebook & Twitter Friendly XC 4.5.5
Edited first post again. The only change here is the coding in smarty tpl.
9-10-2014: Category, php, static, and manufacturer pages now work as they should, and the code has been cleaned up 10-15-2014: Manufacturer page images now work correctly |
Re: Facebook & Twitter Friendly XC 4.5.5
Added Special Offers compatibility
(i.e. if posting a link like: www.example.com/offers.php?mode=offer&offerid=31) |
Re: Facebook & Twitter Friendly XC 4.5.5
Any update on this for 4.7.x branch? With and without CDSEO Pro?
Figured I'd ask before I play with it, as it might save some time. :) |
All times are GMT -8. The time now is 05:05 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.