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.

4 comments

Hi there,

And how template1 related to template2?

Please provide some simple example of those templates.

0

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

M.

0

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.

0

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

$PATH_TO_ROOT_FOLDER$/bootstrap.....

$PATH_TO_ROOT_FOLDER$/images....

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.

 

0

Please sign in to leave a comment.