Гость
04 Май 2013 12:06

yes...

I know this can be easily done by customizing the category index template, which I will do for sure,

but I think it would be nice to have the possibility to enable/disable social sharing buttons for the default templates

(category index as well as record full view)

Последние изменения: 29 Янв 2015


Гость
04 Май 2013 12:17

if you decide to do it, I also suggest that you insert responsive social sharing buttons.

I did it manually by adding mediaqueries in my site template to display/hide the divs depending on the browser window size....

here is a brief tutorial in case someone need to do this manually

here is how I did it

first of all I have created mediaqueries code in my site template custom css file

@media only screen and (min-width: 950px) and (max-width: 2000px){

    .addthis_iphone{

        display:none;

    } 

    .addthis_ipad{

        display:none;

    }

    }

@media only screen and (min-width: 480px) and (max-width: 950px) {

    .addthis_normal{

        display:none;

    } 

    .addthis_iphone{

        display:none;

    }

    }



    @media only screen and (max-width: 480px) {

    .addthis_normal{

        display:none;

    } 

    .addthis_ipad{

        display:none;

    }

    }

then I inserted the following code in my record full view template

<div class="addthis_normal"><div class="addthis_toolbox addthis_default_style ">

<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>

<a class="addthis_button_tweet"></a>

<a class="addthis_button_google_plusone" g:plusone:size="medium"></a> 

<a class="addthis_button_linkedin_counter"></a> 

<a class="addthis_button_pinterest_pinit"></a>

<a class="addthis_counter addthis_pill_style"></a>

</div></div>

<div class="addthis_ipad"><div class="addthis_toolbox addthis_default_style ">

<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>

<a class="addthis_button_tweet"></a>

<a class="addthis_button_google_plusone" g:plusone:size="medium"></a> 

<a class="addthis_counter addthis_pill_style"></a>

</div></div>

<div class="addthis_iphone"><div class="addthis_toolbox addthis_default_style ">

<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>

<a class="addthis_counter addthis_pill_style"></a>

</div></div>

and at last I inserted the addthis javascript code at the bottom of my site template index.php file

(you may want to insert the javascript code direclty in the record template if you want ,just were you insert the code above, I inserted it in the site template index.php file because I need it almost everywhere in the site)

<script type="text/javascript" src="/ http://s7.addthis.com/js/250/addthis_widget.js "></script>

for now it seems to work as I need, it basically display a different addthis code depending on the browser window size, for smaller screens I deleted some addthis buttons, for mobile screens I just left facebook like and addthis share button

(you can test it here http://174.132.147.254/ ~sarteano/dormo/item/5-albergo/1-ai-lecci-in-centro by resizing the browser window)


clowride VIP
Total posts: 1,022
04 Май 2013 13:46

WOW best tutorial thank you very much


Гость
05 Май 2013 02:09

Thanks... I am not really a css expert, but qhen I find a solution that works why dont' share it? :)


cherosoullis VIP
Total posts: 165
29 Янв 2015 01:40

Can this be implemented as a field?

This will help users a lot.

On field that will allow users to share the article-entry and keep records for likes and votes.


Sergey
Total posts: 13,748
29 Янв 2015 08:55

This is really a template feature. But there is also a field with something like this

http://www.mintjoomla.com/community/depot/item/27-fields/4238-addthis-pro-1-0-stable.html

Работает на Cobalt