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

Pass through the calculated dimensions to the template #34

Merged
merged 8 commits into from
Sep 13, 2018

Conversation

ramonski
Copy link
Contributor

@ramonski ramonski commented Sep 13, 2018

Description of the issue/feature this PR addresses

This PR passes the calculated page/content dimensions through to the rendered template.
The values are available in the options dictionary from within a page template, e.g.:

<pre tal:content="options"/>

{'page_width': 210.0, 'name': 'DIN A4', 'format': 'A4', 'margin_right': 20.0, 'content_width': 170.0, 'margin_top': 10.0, 'margin_left': 20.0, 'content_height': 277.0, 'margin_bottom': 10.0, 'page_height': 297.0}

Current behavior before PR

The template had no knowledge about the calculated dimensions

Desired behavior after PR is merged

Calculated dimensions can be used in page templates

--
I confirm I have tested this PR thoroughly and coded it according to PEP8
and Plone's Python styleguide standards.

@ramonski ramonski merged commit 8b2b704 into master Sep 13, 2018
@ramonski ramonski deleted the template-rendering branch September 13, 2018 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant