ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Create a category sentence.

January 25, 2009 7:03pm

Subscribe [2]
  • #1 / Jan 25, 2009 7:03pm

    EvanSnyder

    9 posts

    I’ve been looking around for awhile to see if anyone else has either accomplished this, or if it is mentioned in the documentation and I haven’t found anything that quite answers my question.

    I would like to intelligently display the categories related to an entry in a regular sentence. For example, and entry is associated with three categories: Red, Blue and Green. So I would want ti displayed as:

    “Entry posted on January 1, 2009 in Red, Blue and Green.”

    And if there was an entry with say, only two associated categories: Red and Green. So it would be displayed as:

    “Entry posted on January 1, 2009 in Red and Blue.”

    So essentially, I would need ExpressionEngine to add the appropriate commas, period and the word “and” in the correct places depending on how many categories are associated with a given entry.

    Is this possible?

  • #2 / Jan 26, 2009 6:09am

    Ingmar

    29245 posts

    See this entry in the wiki.

  • #3 / Jan 26, 2009 12:49pm

    EvanSnyder

    9 posts

    Done, since the mentioned ‘plug-in’ seems to not be supported anymore; I went straight for the entering of PHP into my template as says the ‘old solution.’ Worked like a charm, thanks Ingmar!

    See it working: http://invertedsquare.com

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases