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 the ability to nest layouts #2886

Closed
Jared-Dev opened this issue May 23, 2017 · 18 comments
Closed

Add the ability to nest layouts #2886

Jared-Dev opened this issue May 23, 2017 · 18 comments

Comments

@Jared-Dev
Copy link

It would be nice if layouts in October could be nested so that you could pick your injection point! An example would be...

root-layout.htm

description = "Root Layout"
==
<html>
	<head>
		...
		{% styles %}
	</head>
	<body>
		{% page %}
		{% scripts %}
	</body>
</html>

nav-layout.htm

description = "Nav Layout"
layout="root-layout"
==
<nav>
	...
</nav>
{% page %}
<footer>
	...
</footer>

titled-layout.htm

description = "Title bar layout for non-home pages"
layout = "nav-layout"
==
<title-bar>
	...
</title-bar>
	{% page %}

about.htm

description = "The about us page"
layout = "titled-layout"
==
<div class="container">
    <div class="row">
        <div class="col-xs-12">
            <!-- about content here -->
        </div>
    </div>
</div>

Using this syntax allows you to maintain your tag pairs and pick your injection point for the content of a page. i.e. the homepage would set it's layout to the nav-layout whereas the about pages sets its layout to the titled-layout

@LukeTowers
Copy link
Contributor

The layout's currently get rendered from https://github.com/octobercms/october/blob/master/modules/cms/classes/Controller.php#L373 so use that as a starting point to figure out how to implement nested layouts.

@daftspunk
Copy link
Member

This is going to need some clear advantage over the following:

root-layout.htm

description = "Root Layout"
==
<html>
    <head>
        {% partial 'site/meta' %}
    </head>
    <body>
        {% page %}
        {% partial 'site/scripts' %}
    </body>
</html>

nav-layout.htm

description = "Nav Layout"
layout="root-layout"
==
<html>
    <head>
        {% partial 'site/meta' %}
    </head>
    <body>
        <nav>
            ...
        </nav>
        {% page %}
        <footer>
            ...
        </footer>
        {% partial 'site/scripts' %}
    </body>
</html>

titled-layout.htm

description = "Title bar layout for non-home pages"
layout = "nav-layout"
==
<html>
    <head>
        {% partial 'site/meta' %}
    </head>
    <body>
        <title-bar>
            ...
        </title-bar>
        {% page %}
        {% partial 'site/scripts' %}
    </body>
</html>

about.htm

description = "The about us page"
layout = "titled-layout"
==
<div class="container">
    <div class="row">
        <div class="col-xs-12">
            <!-- about content here -->
        </div>
    </div>
</div>

@Jared-Dev
Copy link
Author

@daftspunk For the titled-layout where is the nav? The point of a chained layout is to keep the markup DRY.

I also can't tell where the layout = "" tags do anything for anything but the about.htm

@github-actions
Copy link

This issue will be closed and archived in 3 days, as there has been no activity in the last 30 days. If this issue is still relevant or you would like to see action on it, please respond and we will get the ball rolling.

@github-actions
Copy link

This issue will be closed and archived in 3 days, as there has been no activity in the last 30 days. If this issue is still relevant or you would like to see action on it, please respond and we will get the ball rolling.

@github-actions
Copy link

This issue will be closed and archived in 3 days, as there has been no activity in the last 30 days. If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue.

@bennothommo
Copy link
Contributor

@LukeTowers were you planning on implementing this?

@LukeTowers
Copy link
Contributor

@bennothommo yes, at some point

@github-actions
Copy link

This issue will be closed and archived in 3 days, as there has been no activity in the last 30 days.
If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue.
If this issue is critical to your business, consider joining the Premium Support Program where a Service Level Agreement is offered.

@github-actions
Copy link

This issue will be closed and archived in 3 days, as there has been no activity in the last 30 days.

  • If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue. - If this issue is critical to your business, consider joining the Premium Support Program where a Service Level Agreement is offered.

@github-actions
Copy link

This issue will be closed and archived in 3 days, as there has been no activity in the last 30 days.
If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue.
If this issue is critical to your business, consider joining the Premium Support Program where a Service Level Agreement is offered.

@github-actions
Copy link

This issue will be closed and archived in 3 days, as there has been no activity in the last 30 days.
If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue.
If this issue is critical to your business, consider joining the Premium Support Program where a Service Level Agreement is offered.

@github-actions
Copy link

This issue will be closed and archived in 3 days, as there has been no activity in the last 60 days.
If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue.
If this issue is critical to your business, consider joining the Premium Support Program where a Service Level Agreement is offered.

@github-actions
Copy link

This issue will be closed and archived in 3 days, as there has been no activity in the last 60 days.
If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue.
If this issue is critical to your business, consider joining the Premium Support Program where a Service Level Agreement is offered.

@github-actions
Copy link

This issue will be closed and archived in 3 days, as there has been no activity in the last 60 days.
If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue.
If this issue is critical to your business, consider joining the Premium Support Program where a Service Level Agreement is offered.

@github-actions
Copy link

This issue will be closed and archived in 3 days, as there has been no activity in the last 60 days.
If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue.
If this issue is critical to your business, consider joining the Premium Support Program where a Service Level Agreement is offered.

@github-actions
Copy link

This issue will be closed and archived in 3 days, as there has been no activity in the last 60 days.
If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue.
If this issue is critical to your business, consider joining the Premium Support Program where a Service Level Agreement is offered.

@daftspunk
Copy link
Member

It is an age-old DRY vs WET debate. This adds significant overhead to the experience of October so as mentioned we'd need to see a clear advantage to justify it. Thanks for the suggestion anyhow!

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

No branches or pull requests

4 participants