Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nesting Generico Templates #34

Open
a-kempka opened this issue Nov 28, 2022 · 4 comments
Open

Nesting Generico Templates #34

a-kempka opened this issue Nov 28, 2022 · 4 comments

Comments

@a-kempka
Copy link

Is there a possibility to nest/reference a Generico template inside another Generico template?
The goal is to reduce reduntant text by grouping text blocks (that are templates) into one template that unites the text.

One could have a main template e.g. a table. The cells of the table would be populated with text from other templates.
Alternatively: could templates themselves be passed as a variable to a Generico template?

@justinhunt
Copy link
Owner

You should be able to nest Generico templates now on the page.
But putting Generico tags in the a Generico template itself probably wont work.
And I think it would be very difficult. We do plan to redo Generico to use Mustache templates (when?) and at that time we might be able to nest tags elegantly

@a-kempka
Copy link
Author

Thank you for your quick reply.
Using Mustache in the future would be nice as it would give template designers more control over the content while using a standardized/familiar syntax.

@a-kempka
Copy link
Author

Is there any documentation on how to nest/reference one template in another? So far having an outer template with a call to an inner template results in just showing the inner template's name:

outer_template:
Here's an example {GENERICO:type="inner_template"}

inner_template:
Example 1

Calling {GENERICO:type="outer_template"} Results in Generico printing: {GENERICO:type="inner_template"} not in printing Example 1

@justinhunt
Copy link
Owner

justinhunt commented Nov 29, 2022

you can not nest a template in another templates definition. Because that text is not filtered. It just shows it as is.
You would have to nest on the page that will be saved and shown to the user. eg

{GENERICO:type=tabs}
{GENERICO:type=tabitem}blah blah blah {GENERICO:type=tabitem_end}
{GENERICO:type=tabs_end}

I know thats not really what you had in mind though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants