We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 49667
    • 59 Posts
    I want to implement on my MODx EVO site following social buttons with counter.

    http://medialoot.com/blog/create-your-own-custom-social-share-count-buttons/

    It seems pretty straightforward but I am having problems organising my files so that it all works. This is what I tried last...

    1. create social buttons - HTML - in chunk (OK)
    2. style social buttons - CSS - in style.css file under mytemplate js folder (style.css ofcourse referenced in my template HTML) (OK)
    3. PHP file that stores some functions to grab social counts from the different social media APIs - in ... assets/snippets/custom/myfile.php (NOT SURE)
    4. Javascript function to call the social buttons (it calls the above PHP file via the ajax function) - in myfile.js under mytemplate js folder (myfile.js ofcourse referenced in my template HTML) (NOT SURE)
    5. URL in javascript function being... url: '/assets/snippets/custom/myfile.php?thisurl='+thisUrl, (NOT SURE)
    6. Call the above javascript function in your $(document).ready function - should I put this in my header of my HTML template or in a separate js file in mytemplate folder??? (NOT SURE)

    Any guidance is much appreciated. Thank you!