Closed mexthecat closed 1 year ago
This pull request 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:
Thank you for your contribution :heart:
Passing some Nextcloud metadata (like the current user) to theme developers is a good idea for sure, we should definitely implement this! :+1: However, I've some thoughts about the implementation. We shouldn't use meta
for this, since meta
stores a page's metadata, i.e. its YAML Front Matter. For Nextcloud metadata we should use something else.
I'd suggest adding a new Twig global variable nextcloud
instead - this also makes it easy to detect whether a theme is being used with Pico CMS for Nextcloud, or pure Pico (e.g. {% if nextcloud %}
). Furthermore I wouldn't limit this to the user, there surely is more useful metadata. Right now I can think of Nextcloud's start page URL (usually the dashboard app) next to the user ID, but there surely is more. Some input from others is very welcome, we can add more variables at any time.
Some more notes about the implementation: Please remove the pico_cms_public_user
config, just leave it null
then. And we shouldn't pass IUserSession
down to Pico
via PicoService
, rather use \OC::$server->query(IUserSession::class)
inside Pico::__construct()
instead. Pico uses no DI, we shouldn't force it here.
To get this merged later, please also check our CONTRIBUTING.md
- especially the DCO - and sign off your commits.
This pull request 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:
I have added the current user id to the meta info.
This allows me to add an Login Button on the Webseit if a user is not logged in to nextcloud.
I'm using it to show restricted content if a user is logged in.
were
/index.php/s/o7qRnkdFSQ4CyK6
is a public link to a pdf file and/index.php/f/82572
is a private on.Maybe there is an other way to solve this ...