You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/develop/customize.md
+65Lines changed: 65 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,8 @@
2
2
3
3
As we just saw, overriding configured values is an easy and common way of customizing your instance to your needs. Sometimes, however, you need to provide custom files too: logos, templates... We show how to perform these custom changes.
4
4
5
+
## Update the logo
6
+
5
7
We are going to change the logo, take an *svg* file and update your **local** static files (You can use the [invenio color logo](https://github.com/inveniosoftware/invenio-theme/blob/master/invenio_theme/static/images/invenio-color.svg)):
6
8
7
9
```console
@@ -25,3 +27,66 @@ Go to the browser [*https://localhost:5000/*](https://localhost:5000) or refresh
25
27
If you do not see it changing, check in an incognito window; the browser might have cached the logo.
26
28
27
29
Need further customizations? Have you thought of creating your own extensions? How to add them to your InvenioRDM instance is explained in the next section - [here](../extensions/custom.md).
30
+
31
+
## Change colors
32
+
33
+
You might also be wondering: *How do I change the colors so I can make my instance look like my institution's theme?*
34
+
35
+
We are going to change the top header section in the frontpage to apply our custom background color. Open the `assets/scss/<your instance shortname>/variables.scss` file and edit it as below:
36
+
37
+
```console
38
+
$navbar_background_image: unset;
39
+
$navbar_background_color: #000000; // Note this hex value is an example. Choose yours.
40
+
```
41
+
42
+
Then, run the `invenio-cli update` command as above and refresh the page! You should be able to see your top header's color changed! You can find all the available variables that you can change [here](https://github.com/inveniosoftware/invenio-app-rdm/blob/master/invenio_app_rdm/theme/assets/scss/invenio_app_rdm/variables.scss).
43
+
44
+
## Change search results
45
+
46
+
Changing how your results are presented in the search page is also something quite common.
47
+
48
+
We are going to update the search result template so we can show more text in the result's description. Create a file called `ResultsItemTemplate.jsx` inside `assets/templates/search` folder and then edit it as below:
49
+
50
+
```console
51
+
import React from 'react';
52
+
import {Item} from 'semantic-ui-react';
53
+
import _truncate from 'lodash/truncate';
54
+
55
+
export function ResultsItemTemplate(record, index) {
Then, run the `invenio-cli update` command as above and refresh the page! You should be able to see more text in each result's description! You can find all the available templates [here](https://github.com/inveniosoftware/invenio-app-rdm/tree/master/invenio_app_rdm/theme/assets/templates/search).
70
+
71
+
## Change the record landing page
72
+
73
+
When you click on a search result, you navigate in the details page of a specific record. This section shows you how to change the way the information is displayed in the details page.
74
+
75
+
We are going to configure our instance to use our template for displaying the information in the record's landing page. Open the `invenio.cfg` file and add the below:
76
+
77
+
```console
78
+
from invenio_rdm_records.config import RECORDS_UI_ENDPOINTS
Inside the `page_body` block you can restructure the page as you want! You can check the default record landing page template [here](https://github.com/inveniosoftware/invenio-rdm-records/blob/master/invenio_rdm_records/theme/templates/invenio_rdm_records/record_landing_page.html).
0 commit comments