Before the end of 2017 the board will be down for a brief period of time for an upgrade.
Past experience says less than 30 minutes but I can't predict the future.
Also, there is a high probability that the forum will move to a different host, but that will not happen in 2017.
Thanks,
Doug

How to display contents field in video browse xsl template

Discuss the powerful Explorer Templates used in the CAT programs
pg111
Posts: 11
Joined: Sun Apr 03, 2016 8:09 am

How to display contents field in video browse xsl template

Postby pg111 » Sun Apr 03, 2016 8:41 am

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.
Cheers.

Patrick

User avatar
DougWilliams
Site Admin
Posts: 213
Joined: Thu May 22, 2014 11:36 am
Location: Wisconsin, USA
Contact:

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

Postby DougWilliams » Sun Apr 03, 2016 5:32 pm

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>
Record Collector
"You Mean I'm Supposed To Listen To 'Em?!?!?!?"

pg111
Posts: 11
Joined: Sun Apr 03, 2016 8:09 am

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

Postby pg111 » Sun Apr 03, 2016 8:13 pm

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.
Cheers.

Patrick

User avatar
Alex Ivanovich
Posts: 287
Joined: Mon Sep 07, 2015 2:24 pm
Location: Russian - Italia

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

Postby Alex Ivanovich » Tue Apr 05, 2016 11:31 am

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>   

pg111
Posts: 11
Joined: Sun Apr 03, 2016 8:09 am

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

Postby pg111 » Tue Apr 05, 2016 3:30 pm

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.
Cheers.

Patrick

User avatar
Alex Ivanovich
Posts: 287
Joined: Mon Sep 07, 2015 2:24 pm
Location: Russian - Italia

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

Postby Alex Ivanovich » Tue Apr 05, 2016 4:51 pm

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 :|
Attachments
SS Screen Capture #078.png
custom15
SS Screen Capture #078.png (201.58 KiB) Viewed 729 times

pg111
Posts: 11
Joined: Sun Apr 03, 2016 8:09 am

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

Postby pg111 » Tue Apr 05, 2016 5:43 pm

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.
Attachments
2016-04-05.png
2016-04-05.png (276.25 KiB) Viewed 727 times
Cheers.

Patrick

User avatar
Alex Ivanovich
Posts: 287
Joined: Mon Sep 07, 2015 2:24 pm
Location: Russian - Italia

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

Postby Alex Ivanovich » Tue Apr 05, 2016 8:07 pm

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>
Attachments
SS Screen Capture #079.png
SS Screen Capture #079.png (104.02 KiB) Viewed 713 times

pg111
Posts: 11
Joined: Sun Apr 03, 2016 8:09 am

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

Postby pg111 » Tue Apr 05, 2016 9:47 pm

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.
Cheers.

Patrick

User avatar
Alex Ivanovich
Posts: 287
Joined: Mon Sep 07, 2015 2:24 pm
Location: Russian - Italia

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

Postby Alex Ivanovich » Wed Apr 06, 2016 5:41 am

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>
Attachments
SS Screen Capture #080.png
example text and image
SS Screen Capture #080.png (3.72 KiB) Viewed 700 times
contents.gif
Contents example
contents.gif (258 Bytes) Viewed 702 times


Return to “Explorer Templates”

Who is online

Users browsing this forum: No registered users and 1 guest