Child pages
  • [template parser] Trigger Template Include
Skip to end of metadata
Go to start of metadata

Imported From: http://groups.google.com/group/in-portal-dev/browse_thread/thread/4b82ff5a87b387ad#

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

2 Comments

  1. 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.

    On Fri, Dec 7, 2012 at 4:06 PM, Phil <p...@wbtc.fr> wrote:
    >  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

  2. thanks for this fast reply, exactly what I needed. I'll use it.

    Envoy