Several categories

Battin's Avatar


09 Apr, 2012 12:19 PM


I am working on a new site, and I need a functionality to index my work in more than one category. It would be useful to be able to create unlimited categories and select if they should be free text or maybe selectable from a list. Example: Project could be indexed under (Year, Type of Work, Client, Services provided, Free tags, etc.) Also it would be great to be able to output this information via a simple tag in the PHP code like projectID_cat_client so you can use it as classes on the HTML elements or display it in the text or header of the project.

Example: (top left side)

  1. 1 Posted by Battin on 09 Apr, 2012 12:23 PM

    Battin's Avatar

    Maybe a quick and dirty fix could be "double tags" taking advantage of the existing tagging system. A syntax could look like this:

    client:The Secretary, year:2011, type:Graphic Design

    Then some script to recognize the first part is a definition of the tag, and the second part is the data.

  2. 2 Posted by Battin on 09 Apr, 2012 12:24 PM

    Battin's Avatar

    The way this works in Drupal is very advanced, but also very dynamic and scaleable:

  3. 3 Posted by Battin on 09 Apr, 2012 03:34 PM

    Battin's Avatar

    Ok, i found a solution. Mikael, you are faster than me, the tags array is very useful for this!

    $tags= projectTagsArray(); $project_info= projectInfo(); ?>

    <span class="type"><?php echo $project_info['section']?></span>
    <span class="title"><?php echo projectTitle(); ?></span>
    <span class="client"><?php echo $tags[0];?></span>
    <span class="year"><?php echo projectDate( 'Y' ); ?></span>
    <span class="status"><?php echo $tags[1];?></span>

    I have two questions:

    How do i output "clean" tag names - not url-friendly values such as graphic-design or sound-of-copenhagen?

    How can i output the name of the section the element is in? I can find the ID of the section, but i have no idea how to fetch the name.

  4. Support Staff 4 Posted by Mikael on 23 Apr, 2012 08:29 AM

    Mikael's Avatar

    There is no tag to get the section name currently...

    You can use the following to make "clean" names of the tags, however it may not always work the way you want:

    <?php echo $clerk->complex_name("tag-name"); ?>

    Which would output "tag name". You could then use the PHP uppercase words function to make it output it as "Tag Name":

    <?php echo ucwords($clerk->complex_name("tag-name")); ?>
  5. 5 Posted by Battin on 23 Apr, 2012 08:36 AM

    Battin's Avatar

    Thanks, I will try it out!

  6. 6 Posted by Battin on 16 May, 2012 10:55 AM

    Battin's Avatar

    It is not showing special characters such as & or ÆØÅ, what to do?

  7. Support Staff 7 Posted by Mikael on 28 May, 2012 08:01 PM

    Mikael's Avatar

    The system is set up for UTF-8. Make sure your frontend/theme is UTF-8 enabled (usually done with the meta tag)

  8. Support Staff 8 Posted by Mikael on 28 May, 2012 08:02 PM

    Mikael's Avatar

    Oh you mean the simple/complex name functions?
    They strip those characters as they are not URL friendly, which is their primary use.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac