Forum OpenACS Development: Re: Categories with extra attributes

Collapse
Posted by Dave Bauer on
This depends on exactly what you want to do.

If you embed HTML in the category title, and you display it with ;noqute it generally would work, but that introduces a security problem if untrusted users can set the category title.

It seems like that best technique would be to assign a CSS class derived from the category name or path.

If you are talking about displaying the category in your own code templates, you would then write a Tcl procedure that generates the css class name based on the category and use that in the templates. This way you aren't adding any complex structure or code needed to maintain the icons.

If you need to store the icon data in the database from an administrative user interface, then you could create a mapping table to store the svg data with a foreign key to the category id.

If categories are objects you could also use acs-object-management or you own custom code to extend the category object with custom attributes.

Collapse
Posted by Iuri Sampaio on
Thanks Dave!

"If you need to store the icon data in the database from an administrative user interface, then you could create a mapping table to store the svg data with a foreign key to the category id."

This option will be the one.