On a single entry page, I want to display a list of categories an entry is assigned to, and these categories should link back to their respective pages. Now those categories are attached to different templates so I need to display the template name dynamically for each category (finance, corporate, real-estate, etc.)
I created this query:
{exp:query sql="SELECT template_name FROM exp_templates WHERE template_id = ‘{template_group}’”}{template_name}{/exp:query}
but unfortunately it still doesn’t display my template name.
To give you an idea, if I use this query:
{exp:query sql="SELECT group_name FROM exp_category_groups WHERE group_id = '{category_group}’”}{group_name}{/exp:query}
Then the group name shows correctly (Finance, Corporate, Real Estate, etc.), but I don’t need the group name, I need the template name!
Any suggestions to point to the right direction?
Thanks in advance!