Repeated MARC field in Staff normal view
In the staff client normal view of a record, if you have a repeated MARC field then you'd get the all of the repeated entries in the same line separated by a coma. So for a example for a repeated 701 field you'd get something like this: 701_tag:701_value,701_value_of_repeated What I'd like to do is have each repeated field to be displayed in its own line 701_tag:701_value 701_tag:701_value_of_repeated If you see my previous post <http://koha.1045719.n5.nabble.com/Staff-Client-Normal-View-details-td5872284.html> you'll see why I want to do that. What I've tried is this: <xsl:call-template name="tag_7xx"> <xsl:for-each select="marc:datafield[@tag=701]"> <xsl:with-param name="label" select="marc:subfield[@code='4']" /> </xsl:for-each> </xsl:call-template> I've tried a few variations of this as well, but always with no success. Instead it removes the entire normal view from the staff client. Any help is greatly appreciated -- View this message in context: http://koha.1045719.n5.nabble.com/Repeated-MARC-field-in-Staff-normal-view-t... Sent from the Koha-devel mailing list archive at Nabble.com.
<xsl:call-template name="tag_7xx"> <xsl:for-each select="marc:datafield[@tag=701]"> <xsl:with-param name="label" select="marc:subfield[@code='4']" /> </xsl:for-each> </xsl:call-template>
I've tried a few variations of this as well, but always with no success. Instead it removes the entire normal view from the staff client.
If so, it means that your XSL is malformed. Check you logs. The "tag_7xx" template is not designed to be used like you do. Take a look at UNIMARCslimUtils.xsl. The template already loops on the 7xx field. And when calling it, you have to provide the "tag" parameter. For me, the standard pro interface XSL could be improved the way you're indicating. Kind regards,
Thank you very much for your suggestion about UNIMARCslimUtils, Frédéric. Taking a look at that file helped me very much and it actually helped me to almost solve my problem completely. This is what I have now, which gives me the formatting that I want: <xsl:if test="marc:datafield[@tag=701]"> <xsl:for-each select="marc:datafield[@tag=701]"> <li> <xsl:if test="marc:subfield[@code='4']"> <strong><xsl:value-of select="marc:subfield[@code='4']"/>: </strong> <xsl:value-of select="marc:subfield[@code='a']"/> <xsl:text>, </xsl:text> <xsl:value-of select="marc:subfield[@code='b']"/> </xsl:if> </li> </xsl:for-each> </xsl:if> The only thing that I'm missing now is how to make the results displayed there clickable. Check the image bellow. <http://koha.1045719.n5.nabble.com/file/n5874784/caption.png> You can see that the "Author" has a clickable "Spielberg, Steven" option. If you click that you get all the books from that Author. This part is using the default "tag_7xx" template. For the "Producer" and "Artist" I use the above code. How can I incorporate the searching function in the above code? P.S. Don't mind the data you see, it a testing record -- View this message in context: http://koha.1045719.n5.nabble.com/Repeated-MARC-field-in-Staff-normal-view-t... Sent from the Koha-devel mailing list archive at Nabble.com.
This is what I finally got to make it work: <xsl:if test="marc:datafield[@tag=700 or @tag=701 or @tag=702 or @tag=703 or @tag=710 or @tag=711 or @tag=712]"> <xsl:for-each select="marc:datafield[@tag=700 or @tag=701 or @tag=702 or @tag=703 or @tag=710 or @tag=711 or @tag=712]"> <li> <xsl:if test="marc:subfield[@code='4']"> <strong><xsl:value-of select="marc:subfield[@code='4']"/>: </strong> 'a' tag here isn't showing <xsl:attribute name="href"> <xsl:text>/cgi-bin/koha/catalogue/search.pl?q=</xsl:text> <xsl:value-of select="marc:subfield[@code='a']"/> <xsl:text> </xsl:text> <xsl:value-of select="marc:subfield[@code='b']"/> </xsl:attribute> <xsl:value-of select="marc:subfield[@code='a']"/> <xsl:text>, </xsl:text> <xsl:value-of select="marc:subfield[@code='b']"/> 'a' closing tag here isn't showing </xsl:if> </li> </xsl:for-each> </xsl:if> I tried to create a template but I wan't able to make it work -- View this message in context: http://koha.1045719.n5.nabble.com/Repeated-MARC-field-in-Staff-normal-view-t... Sent from the Koha-devel mailing list archive at Nabble.com.
participants (2)
-
akafortes -
Frédéric Demians