I have installed DSpace on my PC. I am using Mirage as a default theme and now I want to customize it for my DSpace. I want to change CSS files (redesign it), but I don't know the steps to properly set my customizations. I can edit my CSS files in [dspace]/webapps/themes/Mirage/lib/css/
folder, but after rebuilding DSpace they will be removed. What is the correct way doing customizations over already installed theme? Should I edit CSS files and add them to [dspace-source]/dspace/modules/src/main/
folder and then rebuild my webapps
? I have read official documentation about that, but I couldn't find proper answer to my question.
How to customize DSpace theme?
Asked Answered
- Create a folder for your theme in [dspace-src]/dspace/modules/xmlui/src/main/webapps/theme/[yourTheme]
- Copy the CSS (or js or xsl) files you wish to modify into that directory - you can find a copy of the source files in [dspace-install] as you have referenced, or you can find them on the project github page
- Edit your changes
- Run the maven build in [dspace-src]/dspace: "dspace package" - this command will pull the source files for the theme and overlay your customizations. The results are built into the "target" folder.
- cd into [dspace-src]/dspace/target/dspace-installer
- Run "ant update" - this command will take the built files and install them into [dspace-install]
- Restart tomcat
The following page has some resources that might be useful.
https://wiki.duraspace.org/display/DSDOC5x/XMLUI+Configuration+and+Customization
Thank you for your answer! Does it mean that when I want to modify some file in my DSpace, I should do it in [dspace-source]? Is this procedure for all type of files? Because, along theme files, I have configuration .cfg files, .xconf, .xml files that are necessary to be modified sometimes. –
Redvers
Yes, you should make your changes in [dspace-source], save those changes to a source code repo like git, and re-build. If you have been making changes in your install directory, be very careful to save those before running the build since the whole install directory will be rewritten. –
Kilogram
It's clear. And also one issue: I have discovered that when I rebuild my [dspace-source] with modifying one file in webapps folder, in next rebuild this file will be automatically rewritten in my install folder, even if I don't include this file again. Is it correct observation? Like, modified files are kept somewhere for each next rebuild, even if they are not included in .../modules/... folder for next rebuild. –
Redvers
Some files may still be in the target folder from build to build. If you run "mvn clean package" it will wipe out the target directory and build it fresh. –
Kilogram
@Kilogram You are dspace developer? –
Sedulity
@StilgarDragonclaw, I am not currently working on DSpace. –
Kilogram
@Kilogram But if I had any questions about setting up dspace, you would know that, right? –
Sedulity
I created chat room for dspace. chat.stackoverflow.com/rooms/227459/… –
Sedulity
© 2022 - 2024 — McMap. All rights reserved.