Adding static pages
This feature allows to store the HTML content for static pages and show the links to these pages in specific sections of the user interface:
The HTML content is stored in a new table of the GN’s database.
The link to pages can be showed in different points of the GN’s GUI according to a list of “sections” associated to each page. In this PR is introduced the support to show the links for the top toolbar and the footer.
Each page can be in 3 states:
HIDDEN: visible to administrator.
PRIVATE: visible to logged users.
PUBLIC: visible to everyone.
Pages can be added to different page sections. Currently the sections implemented are TOP (top menu of the main page) and FOOTER (footer of the main page).
Only the administrator can edit the pages and see the pages in HIDDEN status.
The creation and the management of the content is done via the API.
Some restrictions:
It is not possible to apply custom CSS to the page.
Any external image must be loaded externally.
Examples of API usage
Before executing the following examples, see Example of CSRF call using curl for details on the usage of the CSRF token (instead of the value "X-XSRF-TOKEN: e934f557-17a3-47f2-8e6b-bdf1a3c90a97"
used in the examples) and cookies in the requests.
Remove a page from a section
To remove a page from a section DELETE /api/pages/{language}/{pageId}/{section}
curl -X DELETE "https://instance.geocat.live/geonetwork/srv/api/pages/eng/contactus?format=LINK" -H "accept: */*" -H "X-XSRF-TOKEN: 7cfa1a0d-3335-4846-8061-a5bf176687b5" --user admin:admin -b /tmp/cookie
Change the page status
The status of the page can be changed with the method PUT /api/pages/{language}/{pageId}/{status}
where status could assume these values:
PUBLIC - Visible to every user
PUBLIC_ONLY - Visible to not logged users
PRIVATE - Visible to logged users
HIDDEN - Hidden to anyone
Other methods in the API are to change/delete a page and to GET the list of the pages or the info of a specific one.