1 of 2
1
Randomize tag cloud
Posted: 27 February 2008 07:10 PM   [ Ignore ]
Newbie
Rank
Total Posts:  10
Joined  2008-02-24

Is there a way to randomize the tags generated by the tag cloud?  If not I’d’ like to make a feature request.

Profile
 
 
Posted: 28 February 2008 06:02 AM   [ Ignore ]   [ # 1 ]
Member
Avatar
RankRankRank
Total Posts:  71
Joined  2006-05-10

I would definitely like to second this request. At the moment I have around 300 tags in my system which is just about the limit as to what I would like to have on a page. I would prefer to show less and either randomise them or possibly have some AJAXy kind of pagination going on, that would be great.

Also would it be possible to somehow add something in so that the tags in the cloud could also get different colours and / or shades to show their difference too?

Best wishes,

Mark

Profile
 
 
Posted: 28 February 2008 06:54 AM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  10
Joined  2008-02-24

Also would it be possible to somehow add something in so that the tags in the cloud could also get different colours and / or shades to show their difference too?

I’m working on this in another thread http://www.solspace.com/forums/viewthread/667/ If instead of changing the font size inline and changed the class of the anchor tag instead you could use a stylesheet to change the attributes for each of your groups.  That way you could change the font size, font weight, color, text decoration, etc…

Profile
 
 
Posted: 28 February 2008 07:20 AM   [ Ignore ]   [ # 3 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3343
Joined  2006-10-18
Mark Bowen - 28 February 2008 06:02 AM

I would definitely like to second this request. At the moment I have around 300 tags in my system which is just about the limit as to what I would like to have on a page. I would prefer to show less and either randomise them or possibly have some AJAXy kind of pagination going on, that would be great.

Sounds like some good ideas smile I’ll take note of them.

Mark Bowen - 28 February 2008 06:02 AM

Also would it be possible to somehow add something in so that the tags in the cloud could also get different colours and / or shades to show their difference too?

I’m told the best it’s gonna get is manipulating the {step} variable LOL

 Signature 
Profile
 
 
Posted: 28 February 2008 05:11 PM   [ Ignore ]   [ # 4 ]
Member
Avatar
RankRankRank
Total Posts:  71
Joined  2006-05-10

Hiya,

Could you possibly expand a bit more on manipulation of the {step} variable as I can’t think of a way of using it that would allow for what I need as the number will just be one number where to create color you would need at least 3 values. Any ideas on this would be greatly appreciated.

Best wishes,

Mark

Profile
 
 
Posted: 28 February 2008 05:18 PM   [ Ignore ]   [ # 5 ]
Newbie
Rank
Total Posts:  10
Joined  2008-02-24

<a href="#" class="tag-{step}>Tag</a>

/* Your Stylesheet */

 .tag-(step)1 {
  color
:#000000;
}

 
.tag-(step)2 {
  color
:#ff0000;
}

 
.tag-(step)3 {
  color
:#ff00ff;
}

You could also put those styles at the top of your page if you do not want to use a stylesheet with the style tags.

Profile
 
 
Posted: 28 February 2008 07:57 PM   [ Ignore ]   [ # 6 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3343
Joined  2006-10-18
Mark Bowen - 28 February 2008 05:11 PM

Hiya,

Could you possibly expand a bit more on manipulation of the {step} variable as I can’t think of a way of using it that would allow for what I need as the number will just be one number where to create color you would need at least 3 values. Any ideas on this would be greatly appreciated.

Best wishes,

Mark

You can do exacty what nek4life suggested, but if you’re referring to only have 1 step, I’m assuming you want all your Tags the same size in the cloud?
If so, you can still use nek4life’s example… set the Step to 3 or whatever, but just don’t apply it to the font size smile

 Signature 
Profile
 
 
Posted: 29 February 2008 06:18 AM   [ Ignore ]   [ # 7 ]
Member
Avatar
RankRankRank
Total Posts:  71
Joined  2006-05-10

Hi there,

Thanks for the replies guys. Hmm I guess that code will work with no problems but I was really looking for a way for the {step} variable to somehow create the color for me not me having to create loads and loads of css styles.

Never mind though, will give it a go and see what I get.

Thanks again.

Best wishes,

Mark

Profile
 
 
Posted: 09 March 2008 12:26 PM   [ Ignore ]   [ # 8 ]
Newbie
Rank
Total Posts:  3
Joined  2008-03-09

I would just like to add a discovery or two, as bought the tag module today via EE site this afternoon, and have it working on my test site with tag sizes and colors now.

- I couldn’t get the .tag-(step)1 etc. form working, and I am not sure why it would work, unless there is something hidden in CSS or EE handling of it.  Instead, the form for each CSS file enter had to specify the font size as it would be returned according to start and steps in the tag:entries EE entry.  Thus valid CSS looks like:

.tag-18 {  color:#ff0000;  }

etc., one of a color you like for each possible font size. 

However, this is not enough yet, if you have already over-ridden the defaults for <a> tags in your CSS, which is often the case, and is so in some of the templates from EE.  If you have, and not just over-ridden a simply itself, it probably would look something like this:

a:link { background-colortransparenttext-decorationnonecolor#663300; }
a:hover { background-color#663300; text-decoration: none; color: #fff; }
a:visited { background-colortransparenttext-decorationnonecolor#663300; }

The solution is to add the <a> tag in your CSS, which turns out to be very easy - only slightly different from above:

a.tag-18 {  color:#ff0000; }

Now your over-rides will work still, just be over-ridden for font color once again for the Tag entries.  This works well.

You could put the font sizes in the tags, but it’s probably better to let the Tag module compute them, which means leaving them as the examples back in the Solspace doc.

I put in a pair of non-breaking spaces after each tag to make it possible to read multi-word ones.  Thus the total layout in the page template becomes:

<h2 class="sidetitle">Tags</h2>

{exp:tag:cloud weblog="construct" orderby="tag_name" sort="asc" groups="5" start="10" step="2" limit="40"
<class="tag-{step}" style="font-size:{step}px;" href="{path='construct/tags/tag'}{websafe_tag}" title="{tag_name}" {tag}&nbsp;&nbsp;</a
{/exp:tag:cloud}

Ok, that is it, I think.  I would have to say that the documentation is among the more confusing seen.  I think that may be because of coder habits, but it could certainly be improved just by have some basic examples on a page themselves.  This is how you do it, simply and with a few more involved ways, etc..

With that basis, then customers will be able to use the detailed doc to modify and proceed.  It seems sensible, don’t you think?  And this will avoid getting twisted up in the wires of presentation tags, funny business with urls, etc., when the fundamental knowledge that seems not mentioned anywhere is that Tag will put a new tab in your Entry/Editor, so you can set the tags you want.  Maybe it’s in there somewhere...but over here, only good sense and ‘how it ought to work’ uncovered this.  You see the need for an up-front framework to be given, don’t you?

Thanks to each of you who posted something here; helped when in a great hurry here, definitely.

Kind regards,
Narration
yes, the same on EE site

nek4life - 28 February 2008 05:18 PM

<a href="#" class="tag-{step}>Tag</a>


/* Your Stylesheet */

 .tag-(step)1 {
  color
:#000000;
}

 
.tag-(step)2 {
  color
:#ff0000;
}

 
.tag-(step)3 {
  color
:#ff00ff;
}


You could also put those styles at the top of your page if you do not want to use a stylesheet with the style tags.

Profile
 
 
Posted: 21 April 2008 07:48 AM   [ Ignore ]   [ # 9 ]
Newbie
Rank
Total Posts:  2
Joined  2008-04-21

I’ve just bought a tag module license and would like to second the tag cloud randomisation request.  Thanks!

Profile
 
 
Posted: 21 April 2008 09:08 AM   [ Ignore ]   [ # 10 ]
Newbie
Rank
Total Posts:  2
Joined  2008-04-21

Is it ok to post code modifications?  Let me know if not! 

With that out of the way, if you want to do this manually change line 2259 of mod.tag.php to this:

foreach ( array( 'count' => 'count''total_entries' => 't.total_entries''weblog_entries' => 't.weblog_entries''gallery_entries' => 't.gallery_entries''tag_name' => 't.tag_name''random' => 'RAND()' ) as $key => $val )

this will allow you to use

orderby="random"

to get the results sorted randomly.  Please note that this is completely untested - use at your own risk!

Profile
 
 
Posted: 21 April 2008 09:19 AM   [ Ignore ]   [ # 11 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3343
Joined  2006-10-18
Tonictwo - 21 April 2008 09:08 AM

Is it ok to post code modifications?  Let me know if not! 

Definitely! Thank you for the contribution! smile

 Signature 
Profile
 
 
Posted: 21 April 2008 01:13 PM   [ Ignore ]   [ # 12 ]
Member
Avatar
RankRankRank
Total Posts:  71
Joined  2006-05-10

Hi Pie Man,

I was just wondering if the Tag Cloud randomisation was going to get added at any point? Also the orderby="random” code shown above, if this is safe to do so then perhaps it could be added to the Tag Module and released as an update and added feature?

Best wishes,

Mark

Profile
 
 
Posted: 21 April 2008 01:19 PM   [ Ignore ]   [ # 13 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3343
Joined  2006-10-18
Mark Bowen - 21 April 2008 01:13 PM

Hi Pie Man,

I was just wondering if the Tag Cloud randomisation was going to get added at any point? Also the orderby="random” code shown above, if this is safe to do so then perhaps it could be added to the Tag Module and released as an update and added feature?

Best wishes,

Mark

Mark,

It’s definately on the list to get done LOL

 Signature 
Profile
 
 
Posted: 21 April 2008 01:57 PM   [ Ignore ]   [ # 14 ]
Member
Avatar
RankRankRank
Total Posts:  71
Joined  2006-05-10

I’ll bet the lists are getting longer and longer all the while what with all us pesky users asking for all these new features wink

Thanks for putting it on the list as this is something that I would really really love for the site I am designing. All is working on the site and it isn’t going live for a few months but would love to have this feature on site as it would really really make it stand out from the rest.

Thanks again.

Best wishes,

Mark

Profile
 
 
Posted: 21 April 2008 03:43 PM   [ Ignore ]   [ # 15 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3343
Joined  2006-10-18

Yeah,

We’ve just had a pile of website projects in the past while (and still do)… so things are falling being a bit, and lists are growing long rasberry

But we’ve add Brent Wilson to our team, and he’s already motoring along on fixes/new features… not particularly for Tag yet though, but I suspect we should be catching up soon smile

Then we can focus on creating more software cheese

 Signature 
Profile
 
 
   
1 of 2
1