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

Double stories Inducks code

Discuss using and your tips/tricks for BookCAT
User avatar
Alex Ivanovich
Posts: 287
Joined: Mon Sep 07, 2015 2:24 pm
Location: Russian - Italia

Double stories Inducks code

Postby Alex Ivanovich » Tue Jun 14, 2016 9:00 am

Hello everyone, little help (2 questions)

I have this code (below) and I would like to see the icon and the link only when the stories have the same code (custom01)
the code works, but when a story does not have the same code appears the count

and also can view the card, "author" double stories by code (custom01)

thank you

Code to be changed

Code: Select all

<xsl:choose>
             <xsl:when test="custom01!=''">
              <xsl:text> Storie Uguali </xsl:text>(<strong><span style="color:red;">##CMD:COUNT:contents,custom01=<xsl:value-of select="custom01"/>##</span></strong>)
               <xsl:text> </xsl:text><IMG SRC="blink_green_dot.gif"/>
            </xsl:when>
               </xsl:choose>


Code Complete

Code: Select all

 <xsl:if test="custom01!=''">
          <tr>
            <td class="record_table_fieldname" nowrap=""><xsl:value-of select="/data/fld/contents/custom01/@name"/></td>
            <td class="record_table_fieldvalue">
         <a href="ContentsList.xsl?Custom01={custom01}@orderby=series,releaseno@xslparam:doctitle={/data/fld/contents/custom01/@name}: {custom01}">
         <strong><span style="color:red;"><xsl:value-of select="custom01"/></span></strong>
         </a>
         <a href="http://coa.inducks.org/story.php?c={custom01}"><xsl:text>  </xsl:text>Cerca questa storia su Inducks.org
         </a>
         <xsl:choose>
             <xsl:when test="custom01!=''">
              <xsl:text> Storie Uguali </xsl:text>(<strong><span style="color:red;">##CMD:COUNT:contents,custom01=<xsl:value-of select="custom01"/>##</span></strong>)
               <xsl:text> </xsl:text><IMG SRC="blink_green_dot.gif"/>
            </xsl:when>
               </xsl:choose>
         </td>
          </tr>
          </xsl:if>
Attachments
Cattura.PNG
Code Story
Cattura.PNG (2.98 KiB) Viewed 414 times

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

Re: Double stories Inducks code

Postby Alex Ivanovich » Mon Jun 27, 2016 3:33 pm

I think that mistake and in this code :|

Code: Select all

<xsl:when test="custom01!=''">


I rephrase the question, maybe I explained evil :?

if the "INDUCKS" code has duplicates, then it is carried out the count of those duplicates
and the icon is displayed

If there are no duplicates, the icon disappears

Thanks for your help

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

Re: Double stories Inducks code

Postby Alex Ivanovich » Sun Oct 02, 2016 12:48 pm

it is possible to display an icon if the count is greater than 1? :|

Code: Select all

<td>
   <xsl:if test="custom01!=''">
   <a href="ContentsList.xsl?Custom01={custom01}@orderby=series,releaseno@xslparam:doctitle={/data/fld/contents/custom01/@name}: {custom01}" target="_blank">
      ##CMD:COUNT:contents,custom01=<xsl:value-of select="custom01"/>##
      <img class="index_image" src="ICON.png"/>
      </a>
    </xsl:if>
    </td>

User avatar
LotsOCds
Posts: 169
Joined: Thu Aug 20, 2015 4:23 am
Location: California, USA

Re: Double stories Inducks code

Postby LotsOCds » Sun Oct 02, 2016 2:09 pm

As we discussed by email, it is not possible to perform any operation with the result of ##CMD:COUNT## because the count is calculated after the XSL template processing is complete.

However, since this is inside a link, maybe you can use the validate function. The 'yes,2' means there must be at least 2 results returned by the link to validate it. If the link is not validated the text and icon will still be displayed but will not be active as a link. Change the last digit from '0' to '2' and the text and icon will be hidden when the link is not validated.

Code: Select all

<td>
   <xsl:if test="custom01!=''">
   <a href="ContentsList.xsl?Custom01={custom01}@validate=yes,2,0@orderby=series,releaseno@xslparam:doctitle={/data/fld/contents/custom01/@name}: {custom01}" target="_blank">
      ##CMD:COUNT:contents,custom01=<xsl:value-of select="custom01"/>##
      <img class="index_image" src="ICON.png"/>
      </a>
    </xsl:if>
  </td>
Cheers,
Dave

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

Re: Double stories Inducks code

Postby Alex Ivanovich » Mon Oct 03, 2016 8:52 am

Thanks Dave,
and an alternative solution, use this :roll:

if you can find a different, let me know :|


Return to “Using BookCAT”

Who is online

Users browsing this forum: No registered users and 1 guest