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

Add ability to override service name on a page #335

Merged
merged 2 commits into from
Jan 25, 2017

Conversation

joelanman
Copy link
Contributor

This is to fix #129

The fix is to not use include for the 'propositional header' but have the code directly in layout.html. In nunjucks, you can't define a block in an include from outside that include.

We don't really need to use include in this situation, as the header is not used elsewhere.

The example page looks like this:

image

@joelanman
Copy link
Contributor Author

relevant section from nunjucks docs:

An included template does not participate in the block structure of its including template; it has a totally separate inheritance tree and block namespace. In other words, an include is not a pre-processor that pulls the included template code into the including template before rendering; instead, it fires off a separate render of the included template, and the results of that render are included.

@colinrotherham
Copy link
Contributor

All works fine for me.

I was a bit confused (at first) seeing serviceName set in both config.js and service_name available as a content block in override-service-name.html—i.e. “which one do I edit??”.

But it all makes sense now.

(This might break naming convention but perhaps "blocks within blocks" should follow a service_name_override pattern?)

@joelanman joelanman force-pushed the override-service-name branch from bfbcd1e to 81f00b6 Compare January 25, 2017 16:46
@joelanman joelanman merged commit 2f4d5b3 into master Jan 25, 2017
@joelanman joelanman mentioned this pull request Jan 25, 2017
@kr8n3r kr8n3r deleted the override-service-name branch November 6, 2018 09:08
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

Successfully merging this pull request may close these issues.

Can't override servicename on individual pages
2 participants