Live template variable reference

Hello. Is it possible to reference a variable from one live template into another? The documentation says it should, but I tried and it didn't quite seem to work.

For instance:

template 1: $VAR1$
template 2: $VAR2$   ---> default value $VAR1$

and I always get an empty string when creating var2 as its default value.

Comment actions Permalink

Hi there,

And how template1 related to template2?

Please provide some simple example of those templates.

Comment actions Permalink

That might be my error to start with. How do I relate templatest with one another?


Comment actions Permalink

Nah .. forget it (my message that previously was here).

For some reason I have read "file template" instead of "live template".

AFAIK live template cannot reference another live template (template, not variable). If you have one template with some code and then another which includes the same code (but does more than that) .. then you just have to include the same code in both live templates.

But in any case: please describe what do you want to achieve.

Comment actions Permalink

I've been trying to find a way to do this too.

A specific use case is to provide a relative reference to the root of the project - so I have $PATH_TO_ROOT_FOLDER$ in several templates that specify css, images, JS etc e,g



These are in the same HTML file so a common path can be used, but they are included in several different live templates so the details need to be supplied in each.

Any suggestions welcome - including ways to achieve this without live templates. There must be a way surely.



Please sign in to leave a comment.