We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1932
    • 137 Posts
    I was playing with some ideas for making tag clouds more usable and came up with an interesting way to "filter" out tags based on popularity. Take a look at the example cloud.

    Basically it makes use of the snippet’s ability to assign link classes based on tag popularity (how many links reference a particular tag). Using mootools, I can select each element by its class and toggle its visibility/display. This could also be used to toggle a link’s color etc.

    Example code:
    <script type="text/javascript">
    	function filterTags(elem, checkbox)
    	{
    		$$(elem).forEach(function(link){
    			if (checkbox.checked)
    				link.style.display = 'inline';
    			else
    				link.style.display = 'none';
    		});
    	}
    </script>
    
    <form>
    <p><input type="checkbox" name="s1" value="1" onclick="filterTags('.favlinks_s1', this)" checked="checked" /> <input type="checkbox" name="s2" value="1" onclick="filterTags('.favlinks_s2', this)" checked="checked" /> <input type="checkbox" name="s3" value="1" onclick="filterTags('.favlinks_s3', this)" checked="checked" /> <input type="checkbox" name="s4" value="1" onclick="filterTags('.favlinks_s4', this)" checked="checked" /> <input type="checkbox" name="s5" value="1" onclick="filterTags('.favlinks_s5', this)" checked="checked" /></p>
    </form>
    
    <div class="links_cloud">
    	[!FavoriteLinks? &dispType=`tags` &showLinks=`0` &landing=`2` &tplOuter=`@CODE:` &tplTag=`@FILE:tpl/tagcloud.tpl` &sortTags=`tag ASC`!]
    </div>
    
      • 14050
      • 788 Posts
      Wow....that is just awesome :-D
        Jesse R.
        Consider trying something new and extraordinary.
        Illinois Wine

        Have you considered donating to MODx lately?
        Donate now. Every contribution helps.
        • 867
        • 241 Posts
        grin I can use my chunk now (and thanks for the explanation)

        Now i try to use the bookmarklet (i uploaded the directory and + created FavoriteLinksFormsnippet)
        then on a page :
        [[FavoriteLinksForm? &bookmarkletPh=`bookmarkleet` &successPage=`referrer` ]]
        [+bookmarkleet+]

        the fav link appear (and on an another page i set up the fav link form)
        but in both case the data are not send to the sgbd but i don’t have any error message.

        Did i forget to set up something ? huh
        (could it be related to PHx ?)

        Thanks again
          • 1932
          • 137 Posts
          @alchime:

          Interesting, did you first install the module? It should be run initially in order to create the database table for storing the links.

          Check the form action, is it submitting to the correct page (the one with the FavoriteLinksForm snippet call)?

          Also, the default posting permissions require you to be logged in as a manager in order to post links. This can be overridden by using the &webAccess or &ipAccess configuration parameters. For testing, I recommend &anonAccess=`1`.

          In most cases, you probably don’t want to use &successPage=`referer` for the standard form; when used with the bookmarklet, it will add the link then redirect back to the site where you originally came from.

          The FavoriteLinksForm doesn’t use Phx, so that shouldn’t be an issue. I really haven’t tried this snippet it many situations, if it’s still not working it might help to have access to he online installation.
            • 867
            • 241 Posts
            hi,

            Check the form action, is it submitting to the correct page (the one with the FavoriteLinksForm snippet call)?
            >> embarrassed I’have no idea where to check or were to set up the submitting page. huh I look in the snippet ..and the calls..
            All i know is that after i post the form it came to the same page with a new form

            Also, the default posting permissions require you to be logged in as a manager in order to post links. This can be overridden by using the &webAccess or &ipAccess configuration parameters. For testing, I recommend &anonAccess=`1`.
            >> grin the bookmarlet works when i’m log in. I could have kill for a feature like that 8 years ago when i use to manage
            a big directory! ;-)

            I would’nt mind to give you access if needed.
            +
              • 1932
              • 137 Posts
              @alchime:
              Look at the html source on the form posting page and tell me what it’s has for <form action="...
              Are you able to post/manage links from the manager module?
              If you would like to PM me details to your installation I would be glad to assist.



              I’ve been forcing myself to learn mootools (I’m still a total newb) and came up with a slider control for the cloud. Compared to the checkbox code above, It’s a bit more complicated to implement and probably a bit less functional but I believe it’s generally more intuitive. I also added a javascript tag search/locater which falls back to an accessible non-javascript landing page.

              Take a look: http://brianstanback.com/links-cloud.html
                • 867
                • 241 Posts
                html source.. rolleyes
                The form is send to the same page (where is the call for the form).
                <form action="index.php?id=3" method="post">

                and yes it works from the manager.


                I’m sending you a PM to give you acess.

                (just an idea) For the tag cloud : It’s visually impressive but I wonder if it’s actually useful but it let me think that
                a similar way to exclude a (some) specific tag from the cloud could be an nice feature. How to permit this from
                the viewer, i don’t really know, (I mean Checkbox or something else)
                  • 1932
                  • 137 Posts
                  Quote from: alchime at Apr 15, 2007, 05:17 AM

                  html source.. rolleyes
                  The form is send to the same page (where is the call for the form).
                  <form action="index.php?id=3" method="post">

                  and yes it works from the manager.


                  I’m sending you a PM to give you acess.

                  Thanks, I’ll take a look.


                  (just an idea) For the tag cloud : It’s visually impressive but I wonder if it’s actually useful but it let me think that
                  a similar way to exclude a (some) specific tag from the cloud could be an nice feature. How to permit this from
                  the viewer, i don’t really know, (I mean Checkbox or something else)

                  Good idea, I’m not sure how useful that would be as a client side Javascript; perhaps you can elaborate. It is currently a configuration parameter for the snippet itself: &excludeTags=`tag1, tag2, etc`

                  In the future I would like to add a search form, I also need to add a quick check to prevent posting of duplicate URLs.
                    • 1932
                    • 137 Posts
                    @alchime:

                    I believe your issue with posting stemmed from having caching enabled on the modx document. I have also made a modification to the FavoriteLinksForm which checks for the existence of a URL in the database upon posting.
                      • 17622
                      • 39 Posts
                      Hi,

                      I’m a little huh confused. I’m implementing a personal site and need tagging, I’ve got TvTagCloud working (to a point) and then SirLancelot pointed me to this snippet/module (mainly for the links). Are the tags supposed to be associated with links? I really want to be tagging content and I’d prefer it to be based in the DB rather than in code.

                      Is it possible to tag content with this? Or am I thinking about it wrong?

                      Thanks,
                      Luke.