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/make_it_your_own.md
+37-1Lines changed: 37 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -149,10 +149,46 @@ Inside the `page_body` block you can restructure the page as you want! You can c
149
149
Since we modified `invenio.cfg`, we need to re-start the server to see our changes take effect.
150
150
151
151
152
-
## Use a custom controlled vocabulary
152
+
## Define a custom controlled vocabulary
153
+
154
+
InvenioRDM deals with many controlled vocabularies. And since agreeing on standard
155
+
vocabularies is notoriously difficult, InvenioRDM allows you to use the controlled
156
+
vocabularies **you** want. Here we show how to customize your resource types vocabulary,
157
+
but the same approach holds true for any other vocabulary.
158
+
159
+
We start by copying [the default resource types vocabulary file](https://github.com/inveniosoftware/invenio-rdm-records/raw/master/invenio_rdm_records/vocabularies/resource_types.csv)
160
+
and modifying it with our own vocabulary entries. Make sure to keep the same headers!
161
+
162
+
!!! info "Use the hierarchy to your advantage"
163
+
You will notice the hierarchy in the default file. It reduces repetition and makes sections visually clear. You can use that pattern for your own entries too.
164
+
165
+
Save this file in the `app_data/vocabularies/` folder. We call ours `resource_types.csv`. Very original!
166
+
Then edit `invenio.cfg` to tell InvenioRDM to use this file.
167
+
168
+
```python
169
+
# imports at the top...
170
+
from os.path import abspath, dirname, join
171
+
172
+
# ...
173
+
174
+
# At the bottom
175
+
# Our custom Vocabularies
176
+
RDM_RECORDS_CUSTOM_VOCABULARIES= {
177
+
'resource_types': join(
178
+
dirname(abspath(__file__)),
179
+
'app_data', 'vocabularies', 'resource_types.csv')
180
+
}
181
+
```
182
+
183
+
!!! info "Other vocabularies"
184
+
See the [Vocabulary source code](https://github.com/inveniosoftware/invenio-rdm-records/blob/master/invenio_rdm_records/vocabularies/__init__.py)
185
+
in invenio-rdm-records to know the keys for the other vocabularies.
186
+
187
+
Restart your server and your vocabulary will now be used for resource types!
0 commit comments