[Solved] custom01 and publisher

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

[Solved] custom01 and publisher

Post by Alex Ivanovich » Sun Oct 16, 2016 6:50 am

I would like to see the field "custom 01" (Contents.xls) in BookBrowse, only if the field "publisher" is present
"Arnoldo Mondadori Editore" or "Walt Disney Company Italy"

thank you ;)

I tried this code but it does not work :roll:

Code: Select all

<td>
	<table width="100%"  border="1" cellpadding="2" cellspacing="0" bordercolor="#FF0000">
	<xsl:choose>
<xsl:when test="publisher/lookupdata/publisher='Arnoldo Mondadori Editore' or publisher/lookupdata/publisher='Walt Disney Company Italia' ">
<tr>
         <th>
		  <FONT COLOR="WHITE" SIZE="1">
            <a href="http://coa.inducks.org/story.php?c={custom01}"><xsl:value-of select="custom01"/></a>
          </FONT>
		  </th>
</tr>
      </xsl:when>
      </xsl:choose>
      </table>
</td>	
Last edited by Alex Ivanovich on Sun Oct 23, 2016 8:18 pm, edited 2 times in total.

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

Re: custom01 and publisher

Post by Alex Ivanovich » Thu Oct 20, 2016 10:10 pm

not working :|

Code: Select all

<td>
	<xsl:if test="custom01!=''">
      <table width="100%"  border="1" cellpadding="2" cellspacing="0" bordercolor="#FF0000">
        <tr>
          <th>
		  <FONT COLOR="WHITE" SIZE="1">
            
			<xsl:choose>
			<xsl:when test="publisher/lookupdata/publisher='Charlton Comics'">
          <a href="http://www.comicbookdb.com/search.php?form_search={title}&form_searchtype=FullSite"><xsl:value-of select="custom01"/><xsl:text> Comic Book DB </xsl:text></a>
           </xsl:when>
		   
		   <xsl:when test="publisher/lookupdata/publisher='Arnoldo Mondadori Editore' or publisher/lookupdata/publisher='Walt Disney Company Italia' ">
         <a href="http://coa.inducks.org/story.php?c={custom01}"><xsl:value-of select="custom01"/></a>
           </xsl:when>
		  </xsl:choose>
		   
		    </FONT>
		  </th>
        </tr>
      </table>
	  </xsl:if>
    </td> 

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

Re: custom01 and publisher

Post by LotsOCds » Fri Oct 21, 2016 2:38 pm

not working
Please be more specific. What is not working? What is it doing that is not correct?

The code looks okay. It depends upon the exact result you want.
Cheers,
Dave

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

Re: custom01 and publisher

Post by Alex Ivanovich » Fri Oct 21, 2016 3:40 pm

I would like to see the field, "Custom01"(present in the template Contents.xsl) in BookBrowse
with these conditions

1) if the "publisher" field contains "Arnoldo Mondadori Editore" display the field
"Custom01" and the link
<a href="http://coa.inducks.org/story.php?c={custom01}">

2) if the "publisher" field contains "Charlton Comics" show the field
"Custom01" and the link
<a href="http://www.comicbookdb.com/search.php?f ... e=FullSite">

with this code and see the field "custom01 ' see foto First code 1
and the link
<a href="http://coa.inducks.org/story.php?c={custom01}">

Code: Select all

<td>
	<xsl:if test="custom01!=''">
      <table width="100%"  border="1" cellpadding="2" cellspacing="0" bordercolor="#FF0000">
        <tr>
          <th>
		  <FONT COLOR="WHITE" SIZE="1">
            <a href="http://coa.inducks.org/story.php?c={custom01}"><xsl:value-of select="custom01"/></a>
          </FONT>
		  </th>
        </tr>
      </table>
	  </xsl:if>
    </td> 

with this code not visible field "custom01 ' see foto Second code 2

Code: Select all

  <td>
   <xsl:if test="custom01!=''">
      <table width="100%"  border="1" cellpadding="2" cellspacing="0" bordercolor="#FF0000">
        <tr>
          <th>
        <FONT COLOR="WHITE" SIZE="1">
           
         <xsl:choose>
         <xsl:when test="publisher/lookupdata/publisher='Charlton Comics'">
          <a href="http://www.comicbookdb.com/search.php?form_search={title}&form_searchtype=FullSite"><xsl:value-of select="custom01"/><xsl:text> Comic Book DB </xsl:text></a>
           </xsl:when>
         
         <xsl:when test="publisher/lookupdata/publisher='Arnoldo Mondadori Editore' or publisher/lookupdata/publisher='Walt Disney Company Italia' ">
         <a href="http://coa.inducks.org/story.php?c={custom01}"><xsl:value-of select="custom01"/></a>
           </xsl:when>
        </xsl:choose>
         
          </FONT>
        </th>
        </tr>
      </table>
     </xsl:if>
    </td> 
Attachments
First code 1.png
First code 1
First code 1.png (190.99 KiB) Viewed 826 times
Second code 2.png
Second code 2
Second code 2.png (144.26 KiB) Viewed 826 times

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

Re: custom01 and publisher

Post by LotsOCds » Sun Oct 23, 2016 3:27 pm

Inspecting the code I see nothing wrong. Please look at the XML file to see that the publisher is exactly "Arnoldo Mondadori Editore". Look for extra spaces between the words or other non-printable characters. Extra spaces do not show in the Explorer display, you must look in the XML to be sure. If you see no differences try changing the publisher to "Charlton Comics". Does that work properly?
Cheers,
Dave

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

Re: custom01 and publisher

Post by Alex Ivanovich » Sun Oct 23, 2016 4:13 pm

Solved ;)

Thanks Dave ;)

Post Reply