Add Layout Has No Class!
Permalink
Is there a way to override / edit the function of the "Add Layout" option? I desperately want to be able to add "Design" or at least a class name to a Layout. Here's the reasoning, maybe you can provide an alternative that will make me say, "Doh!" or maybe you can help me accomplish what I think I need to accomplish.
Besides adding a layout in the middle of a generally ZERO-COLUMN page, what if I want that specific section to have a different background. Or other unique attributes. I want my clients to not have to just choose a betwen Theme Layouts (Three Column, Full, Three then Full then Three again) but to be able to add a type of section anywhere.
I could add a block with multiple columns, where they could edit each box of content by scrolling to different TINYMCE editors on the same long editor page, but the Add Layout does all of this absolutely perfectly EXCEPT that it doesn't let you set a class.
So basically what I want to do is edit the "Add Layout" FORM to have one additional text input for a class name, and then have the <div> that's added there to have class="whatTheyPutInTheTextInput" as part of the code. If someone can help me with this, you will be HERO.
I did try creating a block and putting blocks within that block (since that's practically what the layout is)... But that didn't work. Wouldn't let me edit inner blocks. I also made a sad alternative with an "Open with Class" block and then you have to also add a "Close with Class" box. Bleh.
Besides adding a layout in the middle of a generally ZERO-COLUMN page, what if I want that specific section to have a different background. Or other unique attributes. I want my clients to not have to just choose a betwen Theme Layouts (Three Column, Full, Three then Full then Three again) but to be able to add a type of section anywhere.
I could add a block with multiple columns, where they could edit each box of content by scrolling to different TINYMCE editors on the same long editor page, but the Add Layout does all of this absolutely perfectly EXCEPT that it doesn't let you set a class.
So basically what I want to do is edit the "Add Layout" FORM to have one additional text input for a class name, and then have the <div> that's added there to have class="whatTheyPutInTheTextInput" as part of the code. If someone can help me with this, you will be HERO.
I did try creating a block and putting blocks within that block (since that's practically what the layout is)... But that didn't work. Wouldn't let me edit inner blocks. I also made a sad alternative with an "Open with Class" block and then you have to also add a "Close with Class" box. Bleh.
There is a separate 'Design' option available on each layout cell. If you click this and then choose the 'CSS' tab, you can assign a class to that layout area by putting the class name in the box.
That's exactly what I'm looking for, but I don't get that option.... I get the design option on blocks but not on layouts.
Are you logged in as SuperAdmin? Check permissions on the layout's parent area and the layout itself. I have attached a screenshot of what mine looks like.
I really appreciate you taking a look at this for me.
The screenshot shows you editing the design for a cell inside the layout. I want to be able to edit the design for the entire layout. The only way to make any edits to the layout as a whole is to click the plus button on the bar above the layout. It doesn't have the design option though.
The screenshot shows you editing the design for a cell inside the layout. I want to be able to edit the design for the entire layout. The only way to make any edits to the layout as a whole is to click the plus button on the bar above the layout. It doesn't have the design option though.
Ahhh!
What if you restricted the 'Add Layout' option to a specific editable area in the template and then applied the 'Design' to that area.
What if you restricted the 'Add Layout' option to a specific editable area in the template and then applied the 'Design' to that area.
Well, the idea is to not lock the Editor into a creative box of layouts. Basically imagine it like this, instead of choosing the layout from the theme settings, "Do I want two columns with this background, followed by a single column with this other background? Or do I just want a solid one column body?" He can start out with a solid and halfway down choose a three column section with special styling. So that he never really choose a page layout. He chooses, instead, the layout of the section he is currently in within that page.
I think I've solved my issue with a little trickery. I made a block that immediately closes its own block wrapper with a </div></div> And then starts some new Area()'s. I think I'll run into a few hiccups before I get it working smoothly, but it's a promising start. Downside... The "Design" option still won't help, beause these new blocks will be outside of its divs. But the upside is, I can use the form for creating the block to at least include a class.
I think I've solved my issue with a little trickery. I made a block that immediately closes its own block wrapper with a </div></div> And then starts some new Area()'s. I think I'll run into a few hiccups before I get it working smoothly, but it's a promising start. Downside... The "Design" option still won't help, beause these new blocks will be outside of its divs. But the upside is, I can use the form for creating the block to at least include a class.
I would still think the best option would be to somehow use a modified copy of home/concrete/core/models/layout.php at home/models/layout.php and get it to somehow allow design. But I haven't figured out Concrete's coding that well yet I guess. So far I've just broken it trying it that way.
Layouts are funky to say the least so I would imagine you will have all sorts of problems if you hack the system files. It is widely known amongst the developers, and the core team fully admits, that layouts were never designed for wholesale page creation. They were only introduced to allow minor tweaking to a page without a client needing to know how to build page type files. They are being fully re-written for 5.7 so if you ever plan on upgrading beyond 5.6.3 then I would advise against committing too much time and energy to this.
You say you want to assign classes to the layout areas so you can style them with CSS but is this really helpful? The users shouldn't have FTP access to the CSS files nor are they usually knowledgeable enough for that.
One of the powerful things I like about concrete5 is the ability to decide how much havoc you are going to allow your client to cause. In my experience, allowing a client to have full 'creative' control leads to nothing but chaos. Unlimited access to layouts is something I think might lead to such chaos but I don't know the design talents of your users.
That being said, what about building a page type file with a bunch (eg. 8 or so) full width Editable Areas and let the user add layouts to these areas to their hearts content. That way they can mix'n match the 'Design' features from areas, cells or the blocks within the areas. They can add a 3 column layout to the top area, a 2 column layout to the second area, etc, etc, ad nauseam.
You say you want to assign classes to the layout areas so you can style them with CSS but is this really helpful? The users shouldn't have FTP access to the CSS files nor are they usually knowledgeable enough for that.
One of the powerful things I like about concrete5 is the ability to decide how much havoc you are going to allow your client to cause. In my experience, allowing a client to have full 'creative' control leads to nothing but chaos. Unlimited access to layouts is something I think might lead to such chaos but I don't know the design talents of your users.
That being said, what about building a page type file with a bunch (eg. 8 or so) full width Editable Areas and let the user add layouts to these areas to their hearts content. That way they can mix'n match the 'Design' features from areas, cells or the blocks within the areas. They can add a 3 column layout to the top area, a 2 column layout to the second area, etc, etc, ad nauseam.