CMS Development

renanmiyata
Member

Is that possible to pass variables through HTML Partial Template ?

SOLVE

Hello,

 

Im creating some HTML templates and facing some similars structures but only the content (text) changes. So, to improve my creation speed and maintenance, i would like to know if i can create a variable before i include my template and use this variable that i created inside my partial template.

 

Exampel:

{% set variable_x = "some text" %}

{% include "partial directory" %}

then, inside the partial:

<p> {{ variable_x }} </p>
0 Upvotes
1 Accepted solution
Kevin-C
Solution
Recognized Expert | Partner
Recognized Expert | Partner

Is that possible to pass variables through HTML Partial Template ?

SOLVE

Hey @renanmiyata 

 

export_to_template_context might be what you're looking for!

Kevin Cornett - Sr. Solutions Architect @ BridgeRev

View solution in original post

0 Upvotes
1 Reply 1
Kevin-C
Solution
Recognized Expert | Partner
Recognized Expert | Partner

Is that possible to pass variables through HTML Partial Template ?

SOLVE

Hey @renanmiyata 

 

export_to_template_context might be what you're looking for!

Kevin Cornett - Sr. Solutions Architect @ BridgeRev
0 Upvotes