-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Undefined variable: _PAGE_ #118
Comments
Hi @immanuelfodor, it is a variable I use to know what is the current page so that I don't display the add link button if it doesn't make sense. @ArthurHoaro any idea how I could now do to detect current page identifier from within templates? |
Ah ah, this was a bug not a feature: shaarli/Shaarli#1551 More seriously, this variable was injected by the plugins manager and wasn't designed to be used in theme. So with a better code division, it's no longer accessible. I can inject the template name (= filename) in the rendering function, so it would be accessible in included template files. It would be effective in the next release. Would that work for you? |
I found an alternative which is creating myself a variable in each template containing its name (example: https://github.com/kalvn/Shaarli-Material/blob/support-v012/material/linklist.html#L4). So what you propose would totally work for me but if you prefer not to do it, I'm fine too :) |
I've rebuilt my Shaarli using the |
Use either legacy key _PAGE_ or new 'template' one. Related to kalvn/Shaarli-Material#118
Hi, my Shaarli master latest container logs are containing many of the following lines, it looks like something is not present in the header template that is being used. Maybe related to #117? I know you do some checks to avoid displaying the FAB on the add form, for example, but it's just a guess.
2020/11/13 04:53:51 [error] 11#11: *44 FastCGI sent in stderr: "PHP message: PHP Notice: Undefined variable: _PAGE_ in /var/www/shaarli/tmp/page.header.c04e6db3e3da5484d981ebaa00b75abc.rtpl.php on line 3" while reading response header from upstream, client: 192.168.1.2, server: , request: "GET / HTTP/1.1" ...
The text was updated successfully, but these errors were encountered: