Child pages
  • Add "block_no_data" parameter for m_IfDataExists tag
Skip to end of metadata
Go to start of metadata

Imported From:

I propose to add "block_no_data" parameter for m_IfDataExists tag. Will work the same as for m_RenderElement, so this two will work the same, but less code will be required:


<inp2:m_DefineElement name="sample_element"> 
    <inp2:Field name="Name"/> 

<inp2:m_DefineElement name="no_data"> 
    no data 


<inp2:m_RenderElement name="sample_content" data_exists="1" block_no_data="no_data"/> 


<inp2:m_IfDataExists block_no_data="no_data"> 
    <inp2:Field name="Name"/> 

At the end we have no need to create temporary block to use for data presence check.

Related Tasks

INP-531 - Getting issue details... STATUS


  1. the difference is about block renderig syntax if I've got your idea?

    2010/3/29 Alexander Obuhovich <>

  2. Now you can (actually since 5.0.0 release) use <inp2:m_IfDataExists> block
    tag to check if something was selected from database inside it. Before this
    tag only way to do that was to:

       - move part of template to new template and include it using
       data_exists="1" parameter
       - move part of template to new block and render it using data_exists="1"

    Both options included option usage of "block_no_data" parameter to specify
    block to show, when no database data was selected on previous step.

    Then m_IfDataExists was invented, that simplified no_data detection code in
    template syntax, but it wasn't able to show no_data block, when there were
    no data from db selected inside it. Now it can or after this patch will be
    applied it can do that.

    On Mon, Mar 29, 2010 at 4:53 PM, Phil ..:: ::.. <

  3. well, avoiding the use of element rendering could simplify many things
    sometimes :)

    2010/3/29 Alexander Obuhovich <>

  4. Sure, I see why not, but to be honest I totally forgot about this
    "IfDataExists" tag, but it seems to me quite useful.

    We don't have it in "advanced" them at all I believe, do we?


    On Mon, Mar 29, 2010 at 9:29 AM, Phil ..:: ::.. <

  5. no, we don't,  neither in default one.

    2010/3/29 Dmitry Andrejev <>

  6. Here is the task:

    INP-531 - Getting issue details... STATUS

    and patch.