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.
Asked
Active
Viewed 4,545 times
7

Mark O'Connor
- 76,015
- 10
- 139
- 185

Ziyaddin Sadigov
- 8,893
- 13
- 34
- 41
1 Answers
7
- 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

terrywb
- 3,740
- 3
- 25
- 50
-
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. – Ziyaddin Sadigov Nov 20 '15 at 19:29
-
2Yes, 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. – terrywb Nov 20 '15 at 19:56
-
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. – Ziyaddin Sadigov Nov 20 '15 at 20:47
-
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. – terrywb Nov 20 '15 at 20:54
-
@terrywb You are dspace developer? – Stilgar Dragonclaw Oct 08 '20 at 20:11
-
@StilgarDragonclaw, I am not currently working on DSpace. – terrywb Oct 08 '20 at 21:28
-
@terrywb But if I had any questions about setting up dspace, you would know that, right? – Stilgar Dragonclaw Oct 08 '20 at 23:53
-
I created chat room for dspace. https://chat.stackoverflow.com/rooms/227459/dspace-repository-guide-help-room – Stilgar Dragonclaw Jan 17 '21 at 20:05