Page 1 of 1
Tags: How can switch off display of related tags?
Posted: Tue Dec 27, 2005 9:48 pm
by Josh
The display "Tags related to tag xyz" might be useful for many, but I don't like it.
Besides, the display often does not look good, for example here:
http://atlanticreview.org/plugin/freetag/oil
The two lines of tags are hard to read and look a bit chaotic or even messy in my humble opinon. Those readers who are not familiar with this concept, will think that something is not working right.
Therefore I do not want to have the display of related tags. Is it save to modify the plugin without doing harm? What would be the new code for the plugin?
I really like everything else this great plugin is doing. I am impressed that Technorati picks up the tags.
Posted: Wed Dec 28, 2005 3:41 pm
by judebert
I'm not familiar with the tagging concept myself, and it does look a little jumbled. I'm still trying to catch up with all this blogging stuff. (I just wanted easy dynamic news updates, and look where it's gotten me!

)
You can modify the plugin without doing harm. In fact, if you mess it up, you can always just re-install it. (SPARTACUS is awesome.) However, if you're not a programmer, you may have some trouble figuring out what you want.
I just installed the freetag plugin on my own site to check this out. Looks like it installed a sidebar plugin at the same time. I tagged one of my entries, but I don't get that neat display you get at the top of the page.
With a little more detail, perhaps I could help more.
Posted: Wed Dec 28, 2005 5:34 pm
by Josh
judebert wrote:I tagged one of my entries, but I don't get that neat display you get at the top of the page.
Well, if you only tag a single entry, then there won't be any related tags...
To get related tags you have to tag several entries and you have to use more than one tag for a couple of those entries.
Yep, S9Y is awesome.
I am not a programmer.
judebert wrote:With a little more detail, perhaps I could help more.
Thank you.
At tags pages like here
http://atlanticreview.org/plugin/freetag/oil you see
at the top "Tags related to tag oil." I do not want this display.
I guess, I have to change the following code in the serendipity_event.php file, but I don't know how. Or can I just delete this section of code? That sounds too simple...
Code: Select all
function getRelatedTags($tag) {
global $serendipity;
$q = "SELECT sub.tag AS tag, count(sub.tag) AS total
FROM {$serendipity['dbPrefix']}entrytags AS main
LEFT JOIN {$serendipity['dbPrefix']}entrytags AS sub
ON main.entryid = sub.entryid
WHERE main.tag = '$tag'
AND sub.tag != '$tag'
GROUP BY sub.tag
ORDER BY sub.tag";
$rows = serendipity_db_query($q);
if (!is_array($rows)) {
if ($rows !== true && $rows !== 1 && $rows !== 'true') {
echo $rows;
}
return array();
}
foreach($rows as $r) {
$tags[$r['tag']] = $r['total'];
}
return $tags;
}
I don't want to do any harm to the tags. They are great. Well, perhaps some could program them in such a way that each tag starts with a capital letter. I always start the name of tag with a capital letter, but often the first letter is changed into a small letter. But this is a minor thing. I am more concerned about the display of "related tags" that I would like to switch of.
I appreciate your help.
freetag plugin font sizes
Posted: Wed Dec 28, 2005 8:51 pm
by carl_galloway
The freetag plugin caused me some issues as well, it requires its own styles (included in the latest version of my carl blue and green themes), but my biggest gripe with it, and with many plugins is that the authors hard code styles into their plugins making it impossible to override their default settings.
For example the freetag plugin hard codes the font size, at 300%, 200% etc. and the more entries you have the larger the font size. If you look at my
site you'll see the font-size is set at 1500%, and I can't do anything about it in my stylesheet because its hard coded! If it didn't help my traffic so much I'd get rid of it, and if I knew php I'd remove those styles completely.
Ah well, that's my gripe for the day.
Carl[/url]
Re: freetag plugin font sizes
Posted: Wed Dec 28, 2005 9:33 pm
by garvinhicking
Carl: I've just committed the new version 2.32 of the plugin, where you can configure whether to display the tag cloud or not.
Actually you would've crippled the plugin by changing the function you pointed out. There's a better place for not showing that option, actually.
About the weighting problems: This is a problem we haven't got a real good hold of. The reason why it uses 300% and so on is to display the different weight of the tag. That's not so easy to do with CSS because you can't add multiplicating factors.
In the recent version I now also emit a class="tag_weight_XXX" so that you could use this CSS:
Code: Select all
.tag_weight_1500 {
font-size: 800% !important;
}
To override the 800% font size of the span for weighted tags at 1500. How does that sound?
HTH,
Garvin
Posted: Wed Dec 28, 2005 10:34 pm
by judebert
I thought IE ignored the !important modifier. Perhaps it would also be a good idea to scan the CSS for "tag_weight_" and not output our custom CSS if it occurs?
Posted: Wed Dec 28, 2005 11:22 pm
by garvinhicking
Judebert: Sadly this cannot be done, because the "css" event does not "live" in the same page request than the display of the freetag. So you would need to make an additional call to the 'css' hook (and discard output), which would be pretty costy.
And if IE ignores !important, that would be a huge loss. You sure about that? It would make IE even more sucky.
Regards,
Garvin
Posted: Thu Dec 29, 2005 12:29 am
by judebert
I went and did some more research. IE does not support !important in CSS style sheets: the last value of any property is the one it will use, even if an earlier property was marked !important.
However, IE does override inline styles if the style sheet specifies an !important property.
This article is where I found it, down in the comments. Perhaps
this is a more authoritative source; see number 4.