1

I am confused about the usage of the mentioned variable. It should be plain and simple... but for some reason, I can't get it to work.

Documentation link for EE3: https://docs.expressionengine.com/v3/templates/globals/single_variables.html#template-group

I want to use the template group name in my templates, is there any way to make this possible in EE2?

  • It actually is very simple. Suppose you have a template group named about.group and in your index file of that group, if you place {template_group} variable, It will give you result "about". Its working for me. – Mufi - Amici Infotech Jan 10 '18 at 15:32
  • I tried the same several times on several templates with no luck. The thing is, that the other global variables are working fine... – aleksandar perc Jan 11 '18 at 8:16
  • what is your EE version? – Mufi - Amici Infotech Jan 11 '18 at 10:09
  • Ufff.... it is 2.10.3 We have several sites, I must have confused with the ones on version 3. So, I guess there is no easy way of getting the group name on this version.. right? – aleksandar perc Jan 11 '18 at 10:21
1

I think you are mixing up versions of EE.

{template_group} is not a standard global variable in EE2, so not a surprise that it doesn't work.

For a full list of Global Variables that work in EE2 see here: https://docs.expressionengine.com/v2/templates/globals/single_variables.html

HT

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.