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

Rework template wrapper, bring back template_part() #1678

Merged
merged 1 commit into from
Jul 16, 2016

Conversation

QWp6t
Copy link
Sponsor Member

@QWp6t QWp6t commented Jul 15, 2016

This brings back the previous sidebar_path() functionality, but I've re-implemented it as part of a more generic template_part() helper function. The helper function is aware of the main template and it will first check for partials appended with the main template name.

So if you have...

  • partials/sidebar.php
  • partials/sidebar-front-page.php

And you load your sidebar with App\template_part('partials/sidebar');

Then when the front-page.php template is loaded, the sidebar-front-page.php partial will also be loaded.

Additionally, this PR alters some of the language to be a little more consistent with Sage 8. Instead of "wrap" and "unwrap," I'm using "layout" (e.g., base.php) and "main" (e.g., page.php) in the Template class.

@QWp6t QWp6t merged commit 325c4d4 into sage-9 Jul 16, 2016
@QWp6t QWp6t deleted the sage9-rework_wrapper branch July 16, 2016 05:44
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.

1 participant