How to properly add fields to short item view?

75 views
Skip to first unread message

Lolekbolek

unread,
Aug 12, 2020, 11:41:16 AM8/12/20
to DSpace Technical Support
Greetings,

I want to add a few fields to the short item view.  For this, I need to edit an item-view.xsl file for the Mirage theme on DSpace 4.  I read this message in an old thread:
that suggests adding blocks like this, taking care of incrementing the $clause parameter with each addition:

 <xsl:when test="$clause = 5 and (dim:field[@element='type' and not(@qualifier) and descendant::text()])">
                <div class="simple-item-view-type">
                   <span class="bold"><i18n:text>xmlui.dri2xhtml.METS-1.0.item-type</i18n:text>:</span>
                   <span>
                   <xsl:for-each select="dim:field[@element='type' and not(@qualifier)]">
                      <xsl:copy-of select="./node()"/>
                   </xsl:for-each>
                   </span>
               </div>
              <xsl:call-template name="itemSummaryView-DIM-fields">
                <xsl:with-param name="clause" select="($clause + 1)"/>
                <xsl:with-param name="phase" select="$otherPhase"/>
              </xsl:call-template>
          </xsl:when> 

Two questions I have:

1. Is there a document somewhere online that would list the names of various fields so I could copy/paste them into my item-view.xsl?
2. After adding fields in item-view.xsl, do I need to restart the server or are there other things required for the changes to start displaying?
 

Fitchett, Deborah

unread,
Aug 16, 2020, 6:09:25 PM8/16/20
to Lolekbolek, DSpace Technical Support

Kia ora,

 

1.       The fields depend on what fields you’re using in your DSpace. You can see the list by logging into the web interface as administrator, then in the menu look under Registries > Metadata.

2.       You don’t need to restart the server after any xsl changes – they take effect immediately.

 

Deborah

--
All messages to this mailing list should adhere to the DuraSpace Code of Conduct: https://duraspace.org/about/policies/code-of-conduct/
---
You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/28ed4562-4894-4063-a145-52962ba75d80n%40googlegroups.com.




"The contents of this e-mail (including any attachments) may be confidential and/or subject to copyright. Any unauthorised use, distribution, or copying of the contents is expressly prohibited. If you have received this e-mail in error, please advise the sender by return e-mail or telephone and then delete this e-mail together with all attachments from your system."

Lolekbolek

unread,
Aug 17, 2020, 3:07:46 PM8/17/20
to DSpace Technical Support
Kia ora back to you, Deborah!

Thank you for your reply.  I understand now that xsl changes will take effect immediately.  As to the fields, I have not properly formulate my question.  I see the fields in Registries > Metadata, but what I would love to find is a list of xsl blocks that I could copy/paste into item-view.xsl.  Right now it has 5 rows, each with a different number of lines:

          <!-- Author(s) row -->     (42 lines)
          <!-- identifier.uri row --> (22 lines)
          <!-- date.issued row -->  (17 lines)
          <!-- Abstract row -->        (30 lines)
          <!-- Description row -->   (23 lines)

If I want to add a Publisher row or a Rights row, is there a place where I could find corresponding blocks for inclusion in item-view.xsl, or should I come edit one of the abovementioned blocks by adding/removing lines?

Fitchett, Deborah

unread,
Aug 17, 2020, 6:13:16 PM8/17/20
to DSpace Technical Support

Kia ora,

 

Ah, got it! No, I don’t think there’s a list of blocks for copy/pasting, because the code depends on what you want to display and when you want to display it.

 

For example, the item type block you paste you first has the i18n label (in English, probably this will display “Type” in bold) then for each dc.type listed, it just prints that out. You can do something simple like this if you know that every item will have one and only one dc.type.  The authors row is more complex because there might be multiple authors so if there’s more than one you’ll want to put a comma or semi-colon in between them.

 

So you’d want to think about which existing block behaves the most like your new field – then copy that and tweak it to suit (including the clause number).

Reply all
Reply to author
Forward
0 new messages