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?

4
  • 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. Jan 10, 2018 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... Jan 11, 2018 at 8:16
  • what is your EE version? Jan 11, 2018 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? Jan 11, 2018 at 10:21

1 Answer 1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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