Page 1 of 1

How to display contents field in video browse xsl template

Posted: Sun Apr 03, 2016 8:41 am
by pg111
Hi everybody,

Hopefully there will be some helpful and knowledgeable soul to help me with the flwg issue!

I'm trying to further customize my VideoBrowse.xsl.

For the selected video tile, it displays 3 columns in the bottom detailed part of Video View: one for Video info, one for Contents info, and one for Cover info.

In the first column which is dedicated to Video info I would like to include info from a Contents field, Custom15 in Contents table.

I wrote the flwg xsl code:

Code: Select all

<xsl:if test="/data/record/contentsdata/custom15 = 'Oui'">
          <TR CLASS="fieldrowprevpane"> 
            <TD CLASS="fieldnameprevpane" NOWRAP=""> 
              <xsl:text>Vidéo à générer</xsl:text>: 
            </TD> 
            <TD CLASS="fieldvalueprevpane"> 
	<A HREF="ContentsList.xsl?Custom15=True@xmltitle=Vidéos à générer" TARGET="_BLANK" style="font-weight:bold; background-color: maroon; color: yellow">Oui</A>
            </TD> 
          </TR>
         </xsl:if>
Note: "Oui" means "Yes" in French.

Running the template produces nothing. No info is displayed while the selected video title has Custom15 enabled (set to Yes).

However when I remove the if test condition the

Code: Select all

<A HREF="ContentsList.xsl?Custom15=True@xmltitle=Vidéos à générer" TARGET="_BLANK" style="font-weight:bold; background-color: maroon; color: yellow">Oui</A>
part
works just fine except it works for any selected title regardless its Contents/Custom15 is set to Yes or No!

So the problem seems to be with my if test condition.

What's wrong with my syntax?

Thanks a lot in advance for any helpful clue and/or hint.

Re: How to display contents field in video browse xsl template

Posted: Sun Apr 03, 2016 5:32 pm
by DougWilliams
Instead of using 'Oui' have you tried using 'Yes'?

Code: Select all

<xsl:if test="/data/record/contentsdata/custom15 = 'Yes'">
          <TR CLASS="fieldrowprevpane"> 
            <TD CLASS="fieldnameprevpane" NOWRAP=""> 
              <xsl:text>Vidéo à générer</xsl:text>: 
            </TD> 
            <TD CLASS="fieldvalueprevpane"> 
   <A HREF="ContentsList.xsl?Custom15=True@xmltitle=Vidéos à générer" TARGET="_BLANK" style="font-weight:bold; background-color: maroon; color: yellow">Oui</A>
            </TD> 
          </TR>
         </xsl:if>

Re: How to display contents field in video browse xsl template

Posted: Sun Apr 03, 2016 8:13 pm
by pg111
Hi Doug,

Thanks for the suggestion. Yes I tried to use 'Yes' instead of 'Oui'. Same result. Nothing is displayed.

By the way I should have specified that contents/custom15 is a checkbox field.

I suspect the culprit is in the path to the field in the if test instruction but I cannot see how.

Re: How to display contents field in video browse xsl template

Posted: Tue Apr 05, 2016 11:31 am
by Alex Ivanovich
Try this :roll:

Code: Select all

<xsl:if test="custom15/@bool='True'">
          <tr>
            <td class="record_table_fieldname" nowrap=""><xsl:value-of select="/data/fld/contents/custom15/@name"/></td>
            <td class="record_table_fieldvalue">
              <a href="ContentsList.xsl?Custom15={custom15}@xslparam:doctitle={/data/fld/contents/custom15/@name}">
                <xsl:value-of select="custom15"/>
              </a>
            </td>           
          </tr>
          </xsl:if>   

Re: How to display contents field in video browse xsl template

Posted: Tue Apr 05, 2016 3:30 pm
by pg111
Thanks Alex but unfortunately to no avail.

I should maybe have more clearly outlined this call to contents/custom15 field is in a part of the VideoBrowse.xsl Explorer template which is dedicated to the Video info of the selected titile.

But I do not know how to refer to a Contents field from a section where <xsl:template match="videodata">
is applied.

Any clue?

Many thanks in advance.

Re: How to display contents field in video browse xsl template

Posted: Tue Apr 05, 2016 4:51 pm
by Alex Ivanovich
Hi pg111

but you want to display the "Custom 15" field as in the screenshot? :roll:
or you make a screenshot of where you want to be displayed
sorry, but I do not speak English well :|

Re: How to display contents field in video browse xsl template

Posted: Tue Apr 05, 2016 5:43 pm
by pg111
Hi Alex,

Thanks a lot for your nice help.

Plse have a look at the attached screenshot. I hope it will make clearer what I want to achieve.

As you can see there are 3 columns in my xsl template: For each selected record in Video View, the utmost left one is for Video data, the middle one is for Contents data, and the utmost right one is for Cover.

My customized xsl template is able to display the requested info about Contents/Custom15 field in the Contents column (middle column). However I would like to move this info so it be shown in the Video column (the first one starting from left).

I cannot understand why the field is not shown there while it is in the middle column.

Hope that helps.

Re: How to display contents field in video browse xsl template

Posted: Tue Apr 05, 2016 8:07 pm
by Alex Ivanovich
OK, :)

Code: Select all

<xsl:if test="custom15/@bool!='True'">
          <tr> 
            <td class="record_table_fieldname" nowrap=""> <xsl:text>Vidéo à générer</xsl:text>: </td>
            <td class="record_table_fieldvalue">
              <a href="ContentsList.xsl?Custom15=True@xslparam:Vidéos à générer" target="_blank" 
             style="font-weight:bold; background-color: maroon; color: yellow">Oui</a>
            </td>            
          </tr>
          </xsl:if>

Re: How to display contents field in video browse xsl template

Posted: Tue Apr 05, 2016 9:47 pm
by pg111
Hi Alex,

Thanks again for your help.

However I'm afraid I still have a couple of questions.

First is the flwg:

How can you be sure that custom15 field is custom15 field from the Contents table?

Actually a custom15 field also exists in the Video table. And here at this place in the xsl file applied data template is "videodata".

I'll ask my second question when we have solved this one.

Many thanks in advance.

Re: How to display contents field in video browse xsl template

Posted: Wed Apr 06, 2016 5:41 am
by Alex Ivanovich
you can choose whether to display text or an image
to identify the field


example Text

Code: Select all

<xsl:if test="custom15/@bool!='True'">
          <tr> 
            <td class="record_table_fieldname" nowrap=""> <xsl:text>Vidéo à générer</xsl:text>: </td>
            <td class="record_table_fieldvalue">
              <a href="ContentsList.xsl?Custom15=True@xslparam:Vidéos à générer" target="_blank" 
             style="font-weight:bold; background-color: maroon; color: yellow">Oui</a>
			 
			<xsl:text>  </xsl:text> <strong>(Contents)</strong>
			 
            </td>            
          </tr>
          </xsl:if>
example image
note: insert image in the "Explorer Templates"

Code: Select all

<xsl:if test="custom15/@bool!='True'">
          <tr> 
            <td class="record_table_fieldname" nowrap=""> <xsl:text>Vidéo à générer</xsl:text>: </td>
            <td class="record_table_fieldvalue">
              <a href="ContentsList.xsl?Custom15=True@xslparam:Vidéos à générer" target="_blank" 
             style="font-weight:bold; background-color: maroon; color: yellow">Oui</a>
			
			 <xsl:text>  </xsl:text> <img class="index_image" src="contents.gif"/>
            </td>            
          </tr>
          </xsl:if>