so one thing to point out right away.  you claim your first example uses
exhibit 2, but it's actually using exhibit 2 *syntax* in (an early
release of) exhibit 3: note your script link is

<script
src="http://api.simile-widgets.org/exhibit/3.1.0rc3/exhibit-api.js";></script>
it would be helpful to know if you continue to have the same experience
using the latest (HEAD) exhibit with the exhibit 2 syntax, or whether it
is a problem that goes away in HEAD---that could help us track down the
inconsistency.

Note there is some mystery about what the *right* behavior is for image:
"".  This is an example of a "falsy" value in programming.  Some
programming languages like to treat the empty string as null/false,
while others recognize that the empty string that just happens to be
empty but should not be treated as null/false.  In your case you want to
treat "" as null, but there may be other cases where it's important to
know that the string exists and is empty.  We'll need to think about
this (at the same time as we're tracking down the inconsistent handling
of exhibit 2 syntax).

On 12/3/2015 5:13 AM, Jay Gray wrote:
>
> Here's an update David.
>
> =========
> Exhibit 2
> =========
>
> Exhibit 2 catalog
> <http://ontomatica.com/public_new/project/test/Exhibit_implementations/Exhibit_images_seeds/_index_1_exhibit_2_.html>
>
> Here is the Exhibit code:
>
>     <td style="position: relative"><div
> class="itemThumbnail-blocker"></div>
>         <div ex:if-exists=".image">
>             <img ex:src-content=".image" />
>         </div>
>         <div ex:display-style-subcontent="{{ if(not(exists(.image)),
> 'block', 'none') }}">
>             <img src="NoImageAvailable.png" />
>         </div>
>     </td>
>
> Comment: Works as expected.
>
> ===================
> Exhibit 3 version 1
> ===================
>
> Exhibit 3 Catalog - version 1
> <http://ontomatica.com/public_new/project/test/Exhibit_implementations/Exhibit_images_seeds/_index_4_.html>
>
> Here is the Exhibit code:
>
>     <td style="position: relative">
>         <div class="itemThumbnail-blocker"></div>
>         <div data-ex-if-exists=".image">
>             <img data-ex-src-content=".image" />
>         </div>
>         <div data-ex-display-style-subcontent="{{
> if(not(exists(.image)), 'block', 'none') }}">
>             <img src="NoImageAvailable.png" />
>         </div>
>     </td>
>
> Comment:
>     In the JSON file when the key:value pair is -
>         "image":"",
>     Exhibit does not display NoImageAvailable.png.
>     If the key:value pair is absent (null), NoImageAvailable.png is
> displayed as expected.
>
> ===================
> Exhibit 3 version 2
> ===================
>
> Exhibit 3 catalog - version 2
> <http://ontomatica.com/public_new/project/test/Exhibit_implementations/Exhibit_images_seeds/_index_5_.html>
>
> Here is the Exhibit code (per my interpretation of your advice):
>
>     <td style="position: relative">
>         <div class="itemThumbnail-blocker"></div>
>         <div data-ex-if-exists=".image">
>             <img data-ex-src-content=".image" />
>         </div>
>         <div
> data-ex-style-subcontent="display:{{'if(not(exists(.image)), 'block',
> 'none')'}}">
>             <img src="NoImageAvailable.png" />
>         </div>
>     </td>
>
> Comment:
>     Applying the proposed changes to Exhibit 3-version 2, the "No
> Image Available" image is in every Lens.
>
> Motivation:
> I have a version that works correctly if the "image":"" field is
> absent for an item. But I would like to keep that field in the items
> file to be able to easily add an image.png when I find one.
>
> /jay
>
>
>
> On Tuesday, December 1, 2015 at 11:42:27 PM UTC-6, David Karger wrote:
>
>     I don't know what 'key image - value null' means.  But if you want
>     to set the display attribute based on your if test, I think what
>     you want is
>       data-ex-style-subcontent = "display: {{'if(...your stuff...)'}}"
>
>     On 11/24/2015 3:37 AM, Jay Gray wrote:
>>
>>     Roger that David.
>>
>>     Here is a working Exhibit:
>>        
>>     
>> http://ontomatica.com/public_new/project/test/Exhibit_implementations/Exhibit_images_seeds/index_exhibit_4_.html
>>     
>> <http://ontomatica.com/public_new/project/test/Exhibit_implementations/Exhibit_images_seeds/index_exhibit_4_.html>
>>
>>     Am using this expression:
>>
>>         <div data-ex-display-style-subcontent="{{
>>     if(not(exists(.image)), 'block', 'none') }}">
>>             <img src="NoImageAvailable.png" />
>>         </div>
>>
>>     In original JSON, a null URL was set as follows:
>>         "image": "",
>>
>>     Let's call this 'key image - value null'
>>
>>     For 'key image - value null' the above expression doesn't work.
>>     Example is "Pepper, Early Jalepeno".
>>
>>     However, if I delete 'key image - value null' from the items
>>     file, the expression does work. Examples are "Pepper, Anaheim"
>>     and "Pepper, Cal Wonder".
>>
>>     Would like to keep the 'key image - value null' fields in the
>>     JSON items file to simplify addition of new images in the future.
>>     Is there a way to re-write the expression to handle the 'key
>>     image value null' condition?
>>
>>     Also have a second issue in the same Exhibit.
>>
>>     For Zones, the expression is set as:
>>
>>         data-ex-show-missing="false"
>>
>>     However, the number of keys with missing values does appear in
>>     the facet list.
>>
>>     What am I doing wrong here?
>>
>>     ----
>>
>>     On Monday, November 23, 2015 at 2:43:23 PM UTC-6, Jay Gray wrote:
>>
>>         I have a structure below that worked for Exhibit 2.
>>              If an image is not available, the image
>>         'NoImageAvailable.png' is used in its place.
>>
>>         <td valign="bottom" class="itemThumbnail-thumbnailContainer">
>>             <div style="position: relative">
>>                 <div class="itemThumbnail-blocker"></div>
>>                 <div ex:if-exists=".image">
>>                     <img ex:src-content=".image" />
>>                 </div>
>>                 <div ex:display-style-subcontent="{{
>>         if(not(exists(.image)), 'block', 'none') }}">
>>                     <img src="NoImageAvailable.png" />
>>                 </div>
>>             </div>
>>         </td>
>>
>>         However, its equivalent for Exhibit 3 does not work:
>>
>>         <td valign="bottom" class="itemThumbnail-thumbnailContainer">
>>             <div style="position: relative">
>>                 <div class="itemThumbnail-blocker"></div>
>>                 <div data-ex-if-exists=".image">
>>                     <img data-ex-src-content=".image" />
>>                 </div>
>>                 <div data-ex-display-style-subcontent="{{
>>         if(not(exists(.image)), 'block', 'none') }}">
>>                     <img src="NoImageAvailable.png" />
>>                 </div>
>>             </div>
>>         </td>
>>
>>         meaning that NoImageAvailable.png is not displayed when a
>>         planned image is not available.
>>
>>         What am I doing wrong?
>>
>>         /jg
>>
>>     -- 
>>     You received this message because you are subscribed to the
>>     Google Groups "SIMILE Widgets" group.
>>     To unsubscribe from this group and stop receiving emails from it,
>>     send an email to [email protected] <javascript:>.
>>     To post to this group, send email to [email protected]
>>     <javascript:>.
>>     Visit this group at http://groups.google.com/group/simile-widgets
>>     <http://groups.google.com/group/simile-widgets>.
>>     For more options, visit https://groups.google.com/d/optout
>>     <https://groups.google.com/d/optout>.
>
> -- 
> You received this message because you are subscribed to the Google
> Groups "SIMILE Widgets" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to [email protected]
> <mailto:[email protected]>.
> To post to this group, send email to [email protected]
> <mailto:[email protected]>.
> Visit this group at http://groups.google.com/group/simile-widgets.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"SIMILE Widgets" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/simile-widgets.
For more options, visit https://groups.google.com/d/optout.

Reply via email to