Search code examples
phpexpressionengine

How to find all variables from expressionengine website?


I've never worked with expressionengine before but am working on a code base I didn't write and am finding some variables being injected into some of the templates using curly braces, e.g. {embed:page}

I want to explore these variables and ideally get the full list of the ones I can access.

Searching for embed= across the app returns no results relating to my example (although it does obtain some results), so it seems that some variables are being retrieved or defined in a different way.

Any idea how I can explore this via logging or other means?


Solution

  • In your example you'll have an overarching template (e.g. "template_group/template_a" including another template (e.g. "template_group/template_b") with the embed tag and passing through a parameter called page, so something like this in template_a:

    {embed="template_group/template_b" page="12345"}
    

    and within the template_b, you'll have access to 12345 using {embed:page} so if you're searching you'll probably have more joy searching for "page=" rather than "embed=" (although your "page=" will be within an "embed=" tag).