Exhibit - How to selectively supress display of content based on value?

25 views
Skip to first unread message

lbjvg

unread,
Nov 17, 2009, 8:55:47 PM11/17/09
to SIMILE Widgets
Hi - I have a database with a lot of default entries. When I display
a lens view, all of the default values clutter and obscure the
pertinent values.

<div ex:role="viewPanel" style="padding: 1em 0.5in;" id="view_panel">
<div ex:role="lens" style="display: none;" id="lens_view" align="left"
>
<div ex:if-exists=".facet1" class="facet1"><b>facet1: </b><span
ex:content=".facet1"></span></div>
...
<div ex:if-exists=".facet50" class="facet50"><b>facet50: </b><span
ex:content=".facet50"></span></div>


So, suppose that most of the items contain a large number of default
entries. I would like to suppress the display of the content if it
equals the default value. As if there were a statement of the form
ex:if-notEqual="default value" content=".facet1

Is there such a statement?

Thanks - Jim

David Huynh

unread,
Nov 19, 2009, 2:00:15 PM11/19/09
to simile-...@googlegroups.com
If the property is unique (each item has exactly one value of that
property), then you can try

<div ex:if="not(contains(.facet1, 'default value'))"> ... </div>

Otherwise, try

<div ex:if="exists(remove(.facet1, 'default value'))"> ... </div>

David

lbjvg

unread,
Nov 19, 2009, 6:44:41 PM11/19/09
to SIMILE Widgets
David - Both versions work. Thank you very much.

The only caveat is that the scope seems to be whatever immediatly
follows <div ex:if="not(contains(.facet1, 'default value'))"> So, I
had 2 things that followed: <b>facet50: </b> and <span
ex:content=".facet50"></span></div> ; and one would be suppressed but
not the other. So I wrapped both in a span and that solved it:
<div ex:if="not(contains(.facet1, 'default value'))"><span>
<b>facet50: </b><span ex:content=".facet50"></span></span></div>

Thanks for your help! - Jim

lbjvg

unread,
Nov 19, 2009, 7:48:53 PM11/19/09
to SIMILE Widgets
One other caveat: the line breaks disappear with the above code.
However, this slight modification of putting in a <br /> in the right
spot fixes that.
<div ex:if="not(contains(.facet1, 'default value'))"><span>
<b>facet50: </b><span ex:content=".facet50"></span><br /></span></
div>

Thanks - Jim

David Karger

unread,
Nov 19, 2009, 9:09:42 PM11/19/09
to simile-...@googlegroups.com
yes, the if selects the first thing that follows; if the if-test fails, the second things is selected.

lbjvg wrote:
--

You received this message because you are subscribed to the Google Groups "SIMILE Widgets" group.
To post to this group, send email to simile-...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/simile-widgets?hl=.


  
Reply all
Reply to author
Forward
0 new messages