Skip to content
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

'if isset .Site.Params "paginatedSections"' in 'home-content' doesn't work. #86

Closed
SamyGhannad opened this issue Apr 27, 2017 · 2 comments
Assignees

Comments

@SamyGhannad
Copy link

Hi,
Although I've set 'paginatedSections' parameter in config.toml to have content from two different sections on the index page but it seems the check to see if 'paginatedSections' is set or not doesn't work and the 'else' get's executed which falls back to rendering contents in 'post' section only.
Here's how I've set the paginatedSections:

[params]
  paginatedSections="post test"
  description = ""
  cover = "images/cover.

I've tried to fix it myself but had no luck in doing so. Just trying to figure out what's wrong, I tried to see if if isset .Site.Params "paginatedSections" is really working, changing 'paginatedSections' to some other variable like 'description' works as intended.
I couldn't figure out why other variables can be checked if they're set or not, but not 'paginatedSections'.
Any help would be appreciated.

Here's the code that causes the problem.

        {{ if isset .Site.Params "paginatedSections" }}
            {{ $.Scratch.Set "paginatedSections" .Site.Params.paginatedSections }}
        {{ else }}
            Here we are ! <!-- Just to check if 'else' gets executed -->.
            {{ $.Scratch.Set "paginatedSections" "post" }}
        {{ end }}```
@vjeantet vjeantet self-assigned this Apr 29, 2017
@vjeantet
Copy link
Owner

Params variables are case sensitive, and all lowercase ....
Fixed in master

thanks for repporting

@SamyGhannad
Copy link
Author

Thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants