freetag, tag_weight_xxx

Creating and modifying plugins.
Post Reply
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

freetag, tag_weight_xxx

Post by carl_galloway »

The freetag plugin includes some classes ie tag_weight_100, tag_weight_200, tag_weight_300 etc.

However, the relative size can be adjusted within the plugin config screen which means if styles are applied to the default as above, then when users change the max % say 400% as the maximum instead of 300%, then the class names change as well, specifically tag_weight_220 becomes tag_weight_280.

Does anyone have a complete list of all the possible classes that could be emitted?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: freetag, tag_weight_xxx

Post by garvinhicking »

Hi!

The number is calculated dynamically, so you have virtually endless class combinations, dependin on the user input.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway »

Oh, kinda no point in even having it then.

I guess I'm going to have to see if I can get the CSS wildcard selector to work except I'm not sure if it can be used the way I want it.

Any chance we can update the plugin so these classes aren't random, like maybe give us, 100, 150, 200, 250, 300, 350, 400 etc?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!
carl_galloway wrote:Oh, kinda no point in even having it then.
of course, because you need it to customize your tag weights depending on your input. :)
Any chance we can update the plugin so these classes aren't random, like maybe give us, 100, 150, 200, 250, 300, 350, 400 etc?
That would mean fixing the relativ tag weight, which would kinda defeat the reasoning of RELATIVE tag weights... :-)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway »

Just tried to get the wildcard selector to work on child elements but it doesn't work, I think I'm barking up the wrong tree with this one, the plugin obviously needs to be changed.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!
the plugin obviously needs to be changed.
I fullheartedly disagree. :-)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway »

hmmm, disagree all you like :lol:

But I'm trying to add color styling to tags in a template so that the different font-weights have a unique color (or color family) and I have no idea what range of classes I need to support. It seems pointless having these spans available if we can't use them and they simply bloat the source HTML with extra tags. If I could provide additional styling then I'd be happy to keep them.

In addition, each span also has a style="font-size: x%" so the class tag_weight_xxx must be there for a reason, and the only reason I can think of is to provide users with a way of styling the tags. I want my new template to look good, and I want to use different colors for the tags, so how do I do this if I don't know what classes I have to support?

EDIT: By playing around with the plugin it seems that the xxx in tag_weight_xxx is always identical to the font %, so it actually makes no difference if the tag_weight_xxx is there or not. So, can we round the xxx value to the nearest 10 or 20? At least doing this I could create 30-40 classes in the stylesheet and apply color ranges to them? And it would mean I wouldn't have to worry about xx1, xx5 etc.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi Carl!

The spans are calculated using a formular that takes your plugoin configuration into consideration, and simply usese those classnames with the tag weight you used. If you want to color weights differently, you'll just need to have a look at which classes are currently used in your source code and define those spans. Depending on the weight you later use for your classes, you will need to add CSS rules.

The weight changes depending on the usage of your tags, so its impossible to give you a full list of clases you need. Well, you could be sure if you declare weight_1 through to weight_400 with 1 point increments. That will be all CSS classes used. :-D

This is actually the most flexible solution, IMHO. Adding fixed spans takes away flexilibity, no?

I currently don't have the time to look into the formula the output. It might be that it uses 10 increments instead of 1 increments, or even 20 increments...
EDIT: By playing around with the plugin it seems that the xxx in tag_weight_xxx is always identical to the font %, so it actually makes no difference if the tag_weight_xxx is there or not. So, can we round the xxx value to the nearest 10 or 20? At least doing this I could create 30-40 classes in the stylesheet and apply color ranges to them? And it would mean I wouldn't have to worry about xx1, xx5 etc.
It does makes sense, because people might want to do other things to the scaling to "undo" the 200% rescaling to 150% maybe, or whatever else. It's there so that templaters can overrite the inline style.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway »

OK, that's just too much work for a template that I make available for people to download, and I have better things to worry about than creating a few hundred classes. I guess if other users want to change the color or styling of their tags they'll just have to do it themselves.
Post Reply