nextcloud / cms_pico

🗃 Integrate Pico CMS and let your users manage their own websites
https://apps.nextcloud.com/apps/cms_pico
GNU Affero General Public License v3.0
134 stars 41 forks source link

How to set site specific theme variables #238

Closed pfrydlewicz closed 1 year ago

pfrydlewicz commented 1 year ago

Hello to all,

In Pico CMS site variables are set in the config.yml (e.g. author, etc.). These can be used in themes.

However, in my understanding, in Nextcloud this is not possible to the user, as

  1. he has no access to the pico cms config.yml (admin only)
  2. every user wants to set his own values, it must be site specific

How does the solution look like for this problem in this Nextcloud app? I am explicitly not talking about a .php file, but a config.yml, where I want to set theme specific values.

Thank you

PhrozenByte commented 1 year ago

For page-specific user data (e.g. author) use the YAML Front Matter of the page, for site-specific user data (e.g. theme configs) use the YAML Front Matter of common meta file, e.g. _meta.md (the _ makes the page inaccessible). You can then access this data in Twig using e.g. {{ pages["_meta"].meta.my_config_value }}.

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in two days if no further activity occurs. Thank you for your contributions! :+1: