DS7.x: Item page customization and custom themes

241 views
Skip to first unread message

darryl....@usask.ca

unread,
May 3, 2022, 4:02:24 PM5/3/22
to DSpace Technical Support

How are people theming DSpace 7.x? Is it better to create a new theme from a copy of "custom" (and deal with integrating any future changes made to "custom" manually), or just create a local branch of the dspace-angular repo and modify the "custom" theme directly (and then pull in changes to "custom" via a merge request from the main branch)?

Also, can anyone point me in the right direction to make changes to the simple item view? It seems the default for items in DSpace is "untyped item" (I haven't enabled any of the entity stuff).  I've modified src/app/item-page/simple/item-types/untyped-item/untyped-item.component.html to get the results I want, but it seems like a bad idea to modify the global code rather than something in my theme.

The "custom" theme contains simple page templates for Publication items, -- src/themes/limestone/app/item-page/simple/item-types/publication -- but not untyped items.  Simply copying the "untyped-item" folder from the global code into that "item-types" folder didn't seem to work.  I assume there some additional changes required in a .ts file somewhere I also need to update, but I'm, not quite sure which ones.  Or do I need to copy the entire src/app/item-page directory tree into my theme?

Unless there's some other (easier) way to add additional metadata fields to the simple display that I've not discovered??

Thanks,

- Darryl



----------
Darryl Friesen, BSc
Programmer/Analyst
University of Saskatchewan
ICT / University Library


Agustina Martinez

unread,
May 4, 2022, 8:12:03 AM5/4/22
to DSpace Technical Support
Hi Darryl,

We are currently at the same stage as you are regarding custom theming. I have opted for now to take a copy of the custom theme and use it as the basis for our institutional theme (to make updates a bit easier going forward I've removed all of those customisations from the custom theme that we do not use for now). But like you, do not know whether this is the best approach. I found the documentation pages really good: https://wiki.lyrasis.org/display/DSDOC7x/User+Interface+Customization and in particular the comments at the end answer your question about customising components such as the "untyped item". I have successfully done that in our test instance and happy to share with you if you don't get it working based on the info in the docs pages.

It would be great if someone could comment on best ways forward for customising in ways that make future upgrades simpler. I am really knew to angular so just slowly finding our ways!

Agustina

darryl....@usask.ca

unread,
May 4, 2022, 12:48:29 PM5/4/22
to DSpace Technical Support
Thanks Agustina.  I read those comments, and that was where I was headed next, but I thought I'd double check with folks here before I got started.  Partly because of this statement "This part of the  code might be refactored in a subsequent release, so this is kind of a temporary solution.".  But it's reassuring to know others are using the same strategy.

I mean..... if you had some code or tips to share, I wouldn't turn that down.  :)   I've done a bit of work with Vue but, like you, Angular is new to me.  I welcome any help I can get.

As for workflow, we started with a Git clone, then created a local branch from the 7.2 release, to keep our customizations separate.  My plan is to then merge the 7.3 release into my branch to keep it up to date.  By starting with a copy of the custom theme though, I'll need to manually move any 7.3 changes to "custom" into my theme, so I'm wondering if that that copy was a good decision, and whether I should have just made changes directly to "custom".  I too welcome any suggestions on the best way to manage things going forward.

Thanks again Agustina!

- Darryl

darryl....@usask.ca

unread,
May 5, 2022, 2:00:14 PM5/5/22
to DSpace Technical Support
Just an update on this.  As per Agustina's suggestion above, this was relatively straightforward. I following Paulo Graça's comment on the https://wiki.lyrasis.org/display/DSDOC7x/User+Interface+Customization page and defined this an entry component.  The untyped-item component is a little different than the publication component, but what I have seems to work.

Thanks  Agustina (and Paulo, and Art Lowel)!

- Darryl

Karol

unread,
Nov 22, 2022, 7:39:59 AM11/22/22
to DSpace Technical Support
Hi,

Have you been able to customize the item display page? I am trying to edit the file: untyped-item.component.html but without effect. I would like to add the display of Creative Commons license and social media plugin "add to any" as in my current DSpace 6.3 based repository: https://repozytorium.amu.edu.pl/handle/10593/24306 . Can you please give me some hints if this can be done at all by editing the untyped-item.component.html file?  Below is a screen shot of the current repository:
Screenshot from 2022-11-22 13-28-52.png
Add to Any code looks like:
<div class="a2a_kit a2a_kit_size_32 a2a_default_style">
<a class="a2a_button_facebook"></a>
<a class="a2a_button_twitter"></a>
<a class="a2a_button_google_plus"></a>
<a class="a2a_button_email"></a>
<a class="a2a_button_mendeley"></a>
<a class="a2a_dd" href="http://www.addtoany.com/share_save"></a>
</div>
<script type="text/javascript" src="https://static.addtoany.com/menu/page.js"></script>
<script type='text/javascript' src='https://d1bxh8uas1mnw7.cloudfront.net/assets/embed.js'></script>

Thanks,

Karol

Michael Plate

unread,
Nov 22, 2022, 11:14:28 AM11/22/22
to dspac...@googlegroups.com
Hi Karol,

Am 22.11.22 um 13:39 schrieb Karol:
> Hi,
>
> Have you been able to customize the item display page? I am trying to
> edit the file: untyped-item.component.html but without effect.
[…]

yes, I have.
First I tried it in the main tree w/o a theme, after the DSpace 7.4
workshop last week I made it in the theme…

You'll find the slides here:
https://docs.google.com/presentation/d/1mRrq-lM_cntHP7iTAVYA_9Nkw-WU07B-IHRpvRG2xOE/edit#slide=id.g18742d32e1c_2_12

CU

Michael

Karol

unread,
Dec 11, 2022, 2:00:08 PM12/11/22
to DSpace Technical Support
Thank You Michael! 
Reply all
Reply to author
Forward
0 new messages