Categories plugin enhancements

Discussion corner for Developers of Serendipity.
Post Reply
akremedy
Regular
Posts: 56
Joined: Sat Jul 26, 2008 9:06 am
Location: Bay Area, U.S.A.
Contact:

Categories plugin enhancements

Post by akremedy »

Hope this is the right place for this post...

I'd like to propose the following two changes in plugin_categories.tpl to better support theming, and to give visual impact to the categories entries (by way of the category icons).

Item 1: simply give the submit button an ID so that it can be referenced in CSS as "#serendipity_category_form #submit { <css here> }".

Code: Select all

<div class="category_submit"><input id="submit" type="submit" name="serendipity[isMultiCat]" value="{$CONST.GO}" /></div>
Item 2: in the same file, in the category link, print the category_icon if it exists - as in:

Code: Select all

<a href="{$plugin_category.categoryURL}" title="{$plugin_category.category_description|escape}" style="padding-left: {$plugin_category.paddingPx}px">{if !empty($plugin_category.category_icon)}<img src="{$plugin_category.category_icon}" />{/if} {$plugin_category.category_name|escape}</a>
Logically, there should probably be an option to enable/disable the icon in the Categories plugin admin.

These two items are illustrated at http://www.pigslipstick.com.

Thanks,
Adam
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Categories plugin enhancements

Post by garvinhicking »

Hi!

About 1:

You can already access the submit via

Code: Select all

.category_submit input
because this is the only input field in that div.

Printing the category icon by default there is a problematic idea. Many people use large category icons (like 200x200px) which do not fit into the sidebar, so the category icons usually only make sense in blog entry contexts, not the small sidebars...so I believe for those people that have small images, they can put it in the template file? I've actually never seen anyone use small category icons that would fit into the sidebar in any blog that makes use of category icons yet, yours is the first.

But maybe if you could provide a patch for this file and the neccessary option requirements in the include/plugin_internal.inc.php file (based on the current SVN trunk) I could add this to the current s9y?

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/
akremedy
Regular
Posts: 56
Joined: Sat Jul 26, 2008 9:06 am
Location: Bay Area, U.S.A.
Contact:

Post by akremedy »

Thanks Garvin, that all makes sense :-)

The icons-in-categories enhancement makes enough sense to me that I might just queue it up and see what I can come up with. As you point out, there are lots of considerations as to how it could be made to work for most of the people, most of the time without breaking the way most people want to use category icons most of the time.

I'll have to look around at other peoples Serendipity installs to see what folks are doing, then decide if it's practical or not...no sense spending time on an enhancement that nobody has any great need for.

Adam
Post Reply