-
Notifications
You must be signed in to change notification settings - Fork 59
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
#22 : header_var with 'defined', not 'default' #25
Conversation
The default state doesn't work with default when empty, use twig's defined instead
My issue was more that the "show_sidebar" setting is used to determine if the pagination should be shown. |
OK, I see, I have modified the wrong variables assignments. Does the 'default' work fine for you? |
sorry, can't test right now. |
Yes, both the logic (using However, I suggest using the value from
|
Because twig's `default` filter checks for "undefined or empty" but `header_var` returns `null` if it doesn't find anything, we have to use Grav's `defined` filter (which checks `!== null`). Fixes getgrav#25
The settings where also inconsistently applied when comparing |
* Remove redundant default value for theme_var('blog-page') The default value of `/blog` is already defined in the blueprint, so an empty value will already always fall back correctly. * Use correct function when looking for default value - #25 Because twig's `default` filter checks for "undefined or empty" but `header_var` returns `null` if it doesn't find anything, we have to use Grav's `defined` filter (which checks `!== null`). Fixes #25 * Use correct variable names when applying blog settings - #22 Fixes #22 * Use consistent lookup order for settings in blog page and items The current behavior of sometimes using a default value from another page is confusing. This commit ensures that the blog settings will always use the first option found in the following list: 1. Header variables from the current page 2. Settings from the page in header variable `blog_url` 3. Settings from the page in theme variable `blog-page` 4. Default value (true)
The default state doesn't work with default when empty, use twig's defined instead