We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24074
    • 81 Posts
    I have a blog playground made in Revo and i created share buttons TV which consists of twitter and facebook links which will appear on homepage where all blogposts are showed and on each blogpost page. Now, to be able to work, i figured i needed to make 2 TV's:

    Homepage buttons:
    <section class="sharing">
    <a href="https://twitter.com/share?original_referer=[[++site_url]][[~[[+id]]]]&text=[[+pagetitle]]+|+&url=[[++site_url]][[~[[+id]]]]&via=pentag0&counturl=[[++site_url]][[~[[+id]]]]"><img src="assets/images/sharing/twitter.png" alt="Share to Twitter" title="Share to Twitter" /></a>
    
    <a href="https://www.facebook.com/sharer.php?u=[[++site_url]][[~[[+id]]]]&t=[[+pagetitle]]&src=sp"><img src="assets/images/sharing/facebook.png" alt="Share to Facebook" title="Share to Facebook" /></a>
    </section>


    Blogpost buttons:
    <section class="sharing">
    <a href="https://twitter.com/share?original_referer=[[++site_url]][[~[[*id]]]]&text=[[*pagetitle]]+|+&url=[[++site_url]][[~[[*id]]]]&via=pentag0&counturl=[[++site_url]][[~[[*id]]]]"><img src="assets/images/sharing/twitter.png" alt="Share to Twitter" title="Share to Twitter" /></a>
    
    <a href="https://www.facebook.com/sharer.php?u=[[++site_url]][[~[[*id]]]]&t=[[*pagetitle]]&src=sp"><img src="assets/images/sharing/facebook.png" alt="Share to Facebook" title="Share to Facebook" /></a>
    </section>


    My question is can it be solved with only one of these or 2 separate TV's need to be created like i already did. This is purely best practice question.

    Thanks
      Radio sucks!
      • 3109 ☆ A M B ☆
      • 894 Posts
      I don't quite understand what you want to do, what 2 TVs are you talking about?

      Also why do you have a href within another a href as the link?

      If you want to hide or display these buttons based on your TV you can use output modifiers for that something like:

      
      [[*myTv:!empty=`<a href="http://www.google.com" target="_blank">Link</a>`]]
      
      


      But I'm not sure if that is exactly what you want to do.
        Benjamin Marte
        Interactive Media Developer
        Follow Me on Twitter | Visit my site | Learn MODX
        • 24074
        • 81 Posts
        ah sorry, disregard that second href, its a typo.

        Simply put, im putting share buttons in blog post template and homepage posts chunk which is pulled in with getResources.
        Do i need to create 2 separate TV's or chunks with links in them or i need to create just one?

        i reckon TV's, when pulled in with getResources need to be prefixed with +, otherwise, natively, with * ?
        if so, i need 2 separate TV's or chunks to be placed each in blog homepage posts template and post page template.

        Also, i was talking about Homepage buttons TV and Blogpost buttons TV pasted above.

        Does this has any sense? smiley


        Alternatively, if this is too confusing, how would you include share buttons in each, blog post template and homepage posts which are pulled in by getResources?
          Radio sucks!
          • 31442
          • 10 Posts
          Hi purpler, I'm not sure why you need any TVs. From the looks of it, I would either write one or two little snippets. If you use one, you could specify which service to create he share button for (like
          [[share? &service='twitter']]
          ) or if you make separate snippets, each can be really simple (like
          [[tweetme]]
          ).

          (Edited: Sorry, wrote the original on my phone and had no idea it didn't show the snippet suggestions.) [ed. note: version2beta last edited this post 15 years, 1 month ago.]
            • 3109 ☆ A M B ☆
            • 894 Posts
            @purpler can you post the html you want to display based on the TV values?
              Benjamin Marte
              Interactive Media Developer
              Follow Me on Twitter | Visit my site | Learn MODX
              • 24074
              • 81 Posts
              This is the wanted output:
              https://twitter.com/share?original_referer=http://pentago.dyndns.org/nopper&text=Nopper+|+&url=http://pentago.dyndns.org/nopper&via=pentag0&counturl=http://pentago.dyndns.org/nopper
              


              ..of a TV:
              <a href="https://twitter.com/share?original_referer=[[++site_url]][[~[[+id]]]]&text=[[+pagetitle]]+|+&url=[[++site_url]][[~[[+id]]]]&via=pentag0&counturl=[[++site_url]][[~[[+id]]]]"><img src="assets/images/sharing/twitter.png" alt="Share to Twitter" title="Share to Twitter" /></a>
              
              [ed. note: splittingred last edited this post 15 years, 1 month ago.]
                Radio sucks!
                • 24074
                • 81 Posts
                That would be best if i knew how to write such snippet smiley
                  Radio sucks!