About tags: Font sizes and Feeds?

Discuss PivotX 2.0.x here. Non-PivotX related discussions go in The Drain.

About tags: Font sizes and Feeds?

Postby janozaurus » Sun Feb 07, 2010 2:46 pm

Hi everyone,
I just looked at the implementation of tags in PivotX SVN 2404 and two things puzzled me.

Font Sizes:

In the admin interface of PivotX you can specify font sizes for Tags in 'px'. (I think this is bad idea because the only place where font sizes should be set is the template CSS, but that's not my point.). Those font sizes are never used. modules_tags.php: printTagCosmos() uses only the ratio of min and max font sizes (in 'px' but irrelevant) and outputs font sizes in units of 'em' where the smallest font size is set to '1em'. (That means the hight of the smallest tag link is set to the width of the character 'm' in the normal font size.)

Can someone explain the rational of this behaviour?

Alternative proposal: CSS can make use of relative font-sizes specified as a percentage of the normal (parent element) font size. Why not use values between '$min %' and '$max %' where $min/$max are set in the admin interface or (better) template?

I could write a simple patch (basically substituting 'em' with '%'.) Does anyone else think this would be a good idea?

Feeds: PivotX could (unlike the old Pivot) create feeds for tag pages (and categories and so on)? However I still miss this feature in the current version? Did I overlook something? Are there any major issues preventing this?

BTW: PivotX is looking very impressive. Thank you
janozaurus
 
Posts: 38
Joined: Mon Nov 26, 2007 9:03 am

Re: About tags: Font sizes and Feeds?

Postby hansfn » Sun Feb 07, 2010 5:47 pm

Regarding feeds - see this forum post. (I notice that I still haven't added this to our docs (at book.pivotx.net - embarrassing.)

The rest I'll leave to Bob to answer.
hansfn
Developer
 
Posts: 3282
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: About tags: Font sizes and Feeds?

Postby janozaurus » Sun Feb 07, 2010 10:05 pm

hansfn wrote:Regarding feeds - see this forum post.


This post doesn't mention feeds for tags yet. And ?feed=atom&t=pivot does not work (displays all entries).

Tag Cloud Font Sizes:
I have hacked together a quick patch which allows using any unit supported by CSS for font sizes in a tag cloud. I have modified function smarty_tagcloud() and others.

The most obvious change is a new configuration variable 'tag_font_unit'. You can set this via Configuration/Tags/Font Size Units. 'tag_min_font' and 'tag_max_font' have changed their meaning. 'tag_min_font'/'tag_max_font' are now the numerical values of the smallest/largest font used. Output looks like this:
Code: Select all
<div class='tagcloud'>
<a style="font-size:100.00%" href="/jk/pXsvn/i.php/t/gr%C3%B6%C3%9Fer" rel="tag" title="Tag: größer, 2 Entries">größer</a>,
<a style="font-size:150.00%" href="/jk/pXsvn/i.php/t/pivot" rel="tag" title="Tag: pivot, 4 Entries">pivot</a>,
<a style="font-size:100.00%" href="/jk/pXsvn/i.php/t/pivotx" rel="tag" title="Tag: pivotx, 2 Entries">pivotx</a>,
<a style="font-size:75.00%" href="/jk/pXsvn/i.php/t/test" rel="tag" title="Tag: test, 1 Entries">test</a></div>
</div>

(In this example unit='%', min=75, max=150)

The patch against SVN rev 2405 is here: http://www.spacezone.de/download/pivot/tagUnits_vsSVN2405.diff

The code is not very tidy. However, I hope it serves as an example how the tagcloud code can be improved. It's not well tested. And, it's not backwards compatible to the old behaviour. Use at your own risk.
janozaurus
 
Posts: 38
Joined: Mon Nov 26, 2007 9:03 am

Re: About tags: Font sizes and Feeds?

Postby hansfn » Mon Feb 08, 2010 9:37 am

This post doesn't mention feeds for tags yet.


So what do you think that means ;-) Feel free to submit a patch if you need a tag based feed.

Thx for the tag cloud patch. I'll leave this one for Bob.
hansfn
Developer
 
Posts: 3282
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: About tags: Font sizes and Feeds?

Postby janozaurus » Fri Mar 26, 2010 11:08 pm

hansfn wrote:Thx for the tag cloud patch. I'll leave this one for Bob.


Bob? Any comments?
janozaurus
 
Posts: 38
Joined: Mon Nov 26, 2007 9:03 am


Return to 2.x Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron