Support Forums

AddToAny modification

This is a discussion on AddToAny modification within the Templates, HTML, CSS, and Design Help forums, part of the General category; C68 version: v4.2.1 Developer, template Sigma Hello, I have added Addtoany social buttons to listingextras.tpl. The AddToAny code is Code: ...


Go Back   68 Classifieds Forums > General > Templates, HTML, CSS, and Design Help

Reply
 
Thread Tools Display Modes
Old 01-13-2011, 09:20 AM   #1
Customer
 
Join Date: Oct 2010
Posts: 53
Rep Power: 5
zooi is on a distinguished road
Post AddToAny modification

C68 version: v4.2.1 Developer, template Sigma


Hello,

I have added Addtoany social buttons to listingextras.tpl.

The AddToAny code is

Code:
<!-- AddToAny BEGIN -->
<div class="a2a_kit a2a_default_style">
<a class="a2a_dd" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.kidsspullen.nl&linkname=Marktplaats%20kidsspullen.nl">Deel deze advertentie | </a>
<a class="a2a_button_facebook"></a>
<a class="a2a_button_twitter"></a>
<a class="a2a_button_email"></a>
<a class="a2a_button_hyves"></a>
</div>{literal}
<script type="text/javascript">
var a2a_config = a2a_config || {};
a2a_config.linkname = 'Marktplaats Kidsspullen';
a2a_config.linkurl = "http://www.kidsspullen.nl";
a2a_config.onclick = 1;
a2a_config.locale = "nl";
</script>
<script type="text/javascript" src="http://static.addtoany.com/menu/page.js"></script>{/literal}
<!-- AddToAny END -->
This works. Only when you click on the Twitter button it will post in Twitter:

Marktplaats Kidsspullen Kidsspullen via @AddToAny

This is not so nice so I have tried to modify the code from AddToAny with:


a2a_config.linkname = 'Marktplaats Kidsspullen,{title}';
a2a_config.linkurl = "http://www.kidsspullen.nl{$smarty.server.REQUEST_URI}";

But no succes yet. It just output the added values {..} and if I put the values between {literal} {/literal} it also screw up the website?

My question is it possible to add the listing title and listing url to the AddToAny script?

Thank you for your reply
zooi is offline   Reply With Quote
Old 01-13-2011, 09:41 AM   #2
curmudgeon
 
Join Date: Mar 2006
Posts: 5,413
Rep Power: 138
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

anything between <script type="text/javascript"> </script> is going to be handled by the browser as javascript and javascript doesnt know or care about smarty so you cant just plop smarty vars into js.

I would try using the php vars instead, something like this....

a2a_config.linkname = "Marktplaats Kidsspullen,<?= $title ?>";
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline   Reply With Quote
Old 01-13-2011, 09:59 AM   #3
Staff
 
Join Date: Mar 2006
Posts: 587
Rep Power: 34
Blair will become famous soon enough
Default

Just FYI.......

We had a hosted customer using the 'AddToAny' feature and it slowed down his site A LOT!
The call to the external javascript file was causing the problem so you may want to make all necessary resources available from your own server.
__________________
Blair
68C Staff

68C Downloads | Report a Bug | Knowledge Base
If you have a current support subscription, you can Submit a Support Ticket
Blair is offline   Reply With Quote
Old 01-13-2011, 10:10 AM   #4
Customer
 
Join Date: Oct 2010
Posts: 53
Rep Power: 5
zooi is on a distinguished road
Default

Thank you Larry and Blair for your input and prompt reply.
zooi is offline   Reply With Quote
Old 01-13-2011, 10:39 AM   #5
Customer
 
Join Date: Oct 2010
Posts: 53
Rep Power: 5
zooi is on a distinguished road
Default

Larry,

With php it didn't work out...but below code worked perfect.

Code:
{literal}
<script type="text/javascript">
var a2a_config = a2a_config || {};
a2a_config.linkname = "Kidsspullen: {/literal}{$title}{literal}";
a2a_config.linkurl = "{/literal}http://www.kidsspullen.nl{$smarty.server.REQUEST_URI}{literal}";
a2a_config.onclick = 1;
a2a_config.locale = "nl";
</script>
<script type="text/javascript" src="http://static.addtoany.com/menu/page.js"></script>{/literal}
zooi is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
!!!! Share... addtoany link malware!!!!!!! musikal TemplateCodes 8 06-27-2010 08:49 PM
Fluid Advisory - AddtoAny Social Bookmark seymourjames TemplateCodes 0 07-18-2009 12:47 AM
SEO V4 Modification Markus Modules / Plugins / Modifications 2 10-07-2008 04:05 AM
Modification documentation Mike-N-Tosh Off Topic 4 01-18-2008 01:18 PM


All times are GMT -4. The time now is 07:44 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2011, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0