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-color: transparent; text-decoration: none; color: #663300; }
a:hover { background-color: #663300; text-decoration: none; color: #fff; }
a:visited { background-color: transparent; text-decoration: none; color: #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"}
<a class="tag-{step}" style="font-size:{step}px;" href="{path='construct/tags/tag'}{websafe_tag}" title="{tag_name}" > {tag} </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.