Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Templates and categories question

Quote Reply
Templates and categories question
I am editing category.html template. Assuming my category structure is Cyberlaw/intellectual property/copyright then using <%category_name%> in the template will result in the category copyright as Cyberlaw/intellectual_property/copyright.
Using <%category_clean%> will result in Cyberlaw: intellectual property: copyright

I want to simply use "copyright" without the categories higher in the hierarchy. How do I do that?

------------------
~~~~~~~~~~~~~~~~~~~~~~~~
Subscribe to the Cyberlaw Informer and get the latest online law news mishpat.net/cyberlaw

Quote Reply
Re: Templates and categories question In reply to
I thought this was built in, but try adding:

($OUT{category_short}) = $OUT{category_name} =~ m,/?([^/]+)$,;

right after:

# Clean up the name.

in nph-build.cgi. Then you can use <%category_short%> just to get the last section.

Cheers,

Alex