Trigger Template Include

1 view
Skip to first unread message

Phil

unread,
Dec 7, 2012, 9:06:08 AM12/7/12
to in-por...@googlegroups.com
Hi guys,

in one of my templates, I include element from another template into main template.

How could I trigger these external elements, using "if" statement, to include them or not, depending on which template I call them from?

Thanks,
Phil

Alexander Obuhovich

unread,
Dec 7, 2012, 9:11:47 AM12/7/12
to Development In-Portal
It's possible to pass any extra parameters to <inp2:m_include .../> tag. In this particular example they can be used  to template to track origin of inclusion.

For example:

/path/to/main.tpl

bla-bla
<inp2:m_include template="elements/included" origin="path/to/main"/>



/path/to/elements/included.tpl

<inp2:m_DefaultParam origin=""/>

bla-bla

<inp2:m_if check="m_Param" name="origin" equals_to="path/to/main">
do some stuff
</inp2:m_if>


Notice m_DefaultParam tag, that sets default parameter value in case if it wasn't passed.

Phil

unread,
Dec 7, 2012, 9:26:06 AM12/7/12
to in-por...@googlegroups.com
thanks for this fast reply, exactly what I needed. I'll use it.


Envoyé avec Sparrow

Reply all
Reply to author
Forward
0 new messages