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.

Want to use varible {category_name} in my template

June 08, 2012 5:16am

Subscribe [2]
  • #1 / Jun 08, 2012 5:16am

    anks

    2 posts

    Hi.
        I want to use variable {category_name} which will give the name of forum category name.
        which is in index.php in theme. now i want to use in template
    when i use channel like this
    {exp:channel:categories}
      {category_name}
    {/exp:channel:categories}

    it give error.

    let me know solution.

  • #2 / Jun 08, 2012 6:57am

    Boyink!

    5011 posts

    The exp:channel:category tag pair is for returning categories associated with channels - but you mention the forum.  Are you working with the forum module?

  • #3 / Jun 08, 2012 7:01am

    anks

    2 posts

    Hi.
    yes, i am working on forum module. i don’t mind if i can retrieve {category_name} of discussion forum with any alternative.

  • #4 / Jun 08, 2012 7:09am

    Boyink!

    5011 posts

    There is this:
    http://ellislab.com/expressionengine/user-guide/modules/forum/recent_forum_topics.html

    Otherwise if you are trying to pull forum content to standard templates (outside the forum templates) I think you’ll need a custom query.

  • #5 / Jun 08, 2012 7:13am

    anks

    2 posts

    Hi.
      {category_name} is not there. i need to retrieve {category_name} . and in other template. if i have to write custom query then how to right. give me some guidance.

  • #6 / Jun 08, 2012 7:20am

    Boyink!

    5011 posts

    Use this setting to get EE to display queries as you navigate the site - you can then grab SQL statements that it generates as starting points:
    Display SQL Queries
    http://ellislab.com/expressionengine/user-guide/cp/admin/output_and_debugging_preferences.html#display-output-profiler

    Then use the Query Module to put SQL in your templates:
    Query Module:
    http://ellislab.com/expressionengine/user-guide/modules/query/index.html

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

ExpressionEngine News!

#eecms, #events, #releases