First char of HTML isn't displayed, when "html:<some_html_here>" is passed instead of block name to any tag

1 view
Skip to first unread message

Alexander Obuhovich

unread,
Aug 17, 2011, 5:16:59 AM8/17/11
to In-Portal Bugs
In-Portal uses a block concept to out data from database on a page.
So you basically define a block of HTML somewhere and then pass that block name to a tag, that will use it like in example below:

<inp2:m_DefineElement name="sample_element">
<li><inp2:Field name="SomeField"/></li>
</inp2:m_DefineElement>

<ul>
<inp2:l_PrintList render_as="sample_element"/>
</ul>

This will output all links in a current category using a "sample_element" block. However, there are tags, that require multiple blocks to passed in, e.g. "footer_render_as", "header_render_as" and so on.

If block content is a plain short text without HTML, then can simply use this approach to pass it without creating a new block:

<inp2:l_PrintList render_as="sample_element" footer_render_as="html:it's a footer"/>

So you need to pass "html:any_text_here" instead of a block name. You can also pass "html:" (will result in empty string).


Problem is that first char of passed text will be stripped off.


Ready for testing.


--
Best Regards,

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

Phil -- wbtc.fr --

unread,
Aug 17, 2011, 10:14:27 AM8/17/11
to in-port...@googlegroups.com
I'm happy to learn this new trick :) could save time and lines of code.

2011/8/17 Alexander Obuhovich <aik....@gmail.com>

--
You received this message because you are subscribed to the Google Groups "In-Portal Bugs Team" group.
To post to this group, send email to in-port...@googlegroups.com.
To unsubscribe from this group, send email to in-portal-bug...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/in-portal-bugs?hl=en.

Alexander Obuhovich

unread,
Aug 17, 2011, 10:18:26 AM8/17/11
to in-port...@googlegroups.com
This trick was designed to pass empty content to a tag instead of creating empty DefineElement tag. It's used mostly in OnlineStore theme.

So instead of:

<inp2:m_DefineElemement name="empty_element"></inp2:m_DefineElement>
<inp2:l_PrintList render_as="empty_element"/>

shorter version was created:

<inp2:l_PrintList render_as="html:"/>

Phil -- wbtc.fr --

unread,
Aug 17, 2011, 12:46:18 PM8/17/11
to in-port...@googlegroups.com
cool to know about it 

2011/8/17 Alexander Obuhovich <aik....@gmail.com>
Reply all
Reply to author
Forward
0 new messages