CMS Development

renanmiyata
メンバー

Is that possible to pass variables through HTML Partial Template ?

解決

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 いいね!
1件の承認済みベストアンサー
Kevin-C
解決策
名誉エキスパート | Solutions Partner
名誉エキスパート | Solutions Partner

Is that possible to pass variables through HTML Partial Template ?

解決
0 いいね!
1件の返信
Kevin-C
解決策
名誉エキスパート | Solutions Partner
名誉エキスパート | Solutions Partner

Is that possible to pass variables through HTML Partial Template ?

解決

Hey @renanmiyata 

 

export_to_template_context might be what you're looking for!

Kevin Cornett - Sr. Solutions Architect @ BridgeRev
0 いいね!