change default image for publisher in Data Catalog App #4114
Replies: 6 comments 1 reply
-
@stefan-korn you can replace NULL("") with a url to a custom default image here: |
Beta Was this translation helpful? Give feedback.
-
@janette : Thanks for you reply. Okay, it would work changing it for the dataset view changing it in index.jsx like you described, but only if you change the if condition here too: But still changing it here would not change it on the "publisher" view. I suppose publisher view is taking its list from here: And also it seems not really DRY having to change it in two places for dataset view and api view. |
Beta Was this translation helpful? Give feedback.
-
If you have images for all publishers then just edit the src/assets/publishers.json in your data-catalog-app. I thought you were asking how to set up a different default image if a publisher did not have one defined under assets. |
Beta Was this translation helpful? Give feedback.
-
It is about setting up a different default image if a publisher did not have one defined under assets. |
Beta Was this translation helpful? Give feedback.
-
Hello, In the short term, your best bet would be to copy the relevant components (PublisherList, Organization) from data-catalog-components into your app and make the changes there. The default image is set as a default prop in the Organization component. |
Beta Was this translation helpful? Give feedback.
-
Okay, thanks, So I need to copy PublisherList and Organization from data-catalog-components src/components over to data-catalog-app src/components and then I need to change the imports in data-catalog-app like in src/template/publishers/index.jsx and src/templates/dataset/index.jsx to point to the src/components in data-catalog-app instead of the data-catalog-components? |
Beta Was this translation helpful? Give feedback.
-
First of all, sorry for posting this in the DKAN discussions while it is related to the Data Catalog App. But Data Catalog App does not have discussion, and I did not want to post this as an issue.
So there is a default image that is used for a publisher in data catalog app if no imageURL has been defined in the publishers.json in the Data Catalog App. It is: https://s3.amazonaws.com/dkan-default-content-files/files/group.png
Now if I want to change this image which is defined here as far as i can see:
https://github.com/GetDKAN/data-catalog-components/blob/main/src/components/Organization/index.jsx#L69
Do I need to change this in the Data Catalog Components or is there an easy/recommend way to change it in the Data Catalog App (I do not consider replacing the the URL in the dist of Data Catalog App a valid approach).
Please bear with me, if this in only a lack of understanding React.
Beta Was this translation helpful? Give feedback.
All reactions