Add "block_no_data" parameter for m_IfDataExists tag

3 views
Skip to first unread message

Alexander Obuhovich

unread,
Mar 29, 2010, 9:01:31 AM3/29/10
to In-Portal Development
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:

COMMON PART:

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

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

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

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

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

--
Best Regards,

http://www.in-portal.com
http://www.alex-time.com

Phil ..:: domicilis.biz ::..

unread,
Mar 29, 2010, 9:53:53 AM3/29/10
to in-por...@googlegroups.com
the difference is about block renderig syntax if I've got your idea?

2010/3/29 Alexander Obuhovich <aik....@gmail.com>
To unsubscribe from this group, send email to in-portal-dev+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.

Alexander Obuhovich

unread,
Mar 29, 2010, 10:07:40 AM3/29/10
to in-por...@googlegroups.com
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" parameter
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.

Phil ..:: domicilis.biz ::..

unread,
Mar 29, 2010, 10:29:54 AM3/29/10
to in-por...@googlegroups.com
well, avoiding the use of element rendering could simplify many things sometimes :)


2010/3/29 Alexander Obuhovich <aik....@gmail.com>

Dmitry Andrejev

unread,
Mar 29, 2010, 3:57:52 PM3/29/10
to in-por...@googlegroups.com
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?


DA.

Phil -- wbtc.fr --

unread,
Mar 29, 2010, 4:21:20 PM3/29/10
to in-por...@googlegroups.com
no, we don't,  neither in default one.

2010/3/29 Dmitry Andrejev <dand...@gmail.com>
IfDataExists

Alexander Obuhovich

unread,
Mar 30, 2010, 5:55:34 AM3/30/10
to in-por...@googlegroups.com
Here is the task: http://tracker.in-portal.org/view.php?id=674 and patch.

To unsubscribe from this group, send email to in-portal-dev+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
block_no_data_for_mIfDataExists_tag.patch
Reply all
Reply to author
Forward
0 new messages