Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I wanted to create a base layout to provide default layout sitewide and variations of base layout to inherit regions, CSS and JS files from base layouts (Just like sub themes)
wait. I am submitting the patch. I am not sure whether the code is added to the right place. But it works for me, for now, it uses only the regions, CSS and JS declarations from base layout,
in sub layout.inc we have to specify the base layout name
; file sub.inc
name = sub
description = sub layout
; base or parent layout
base layout = base
Comment | File | Size | Author |
---|---|---|---|
#6 | omega-base_layout_support-506436-6968986.patch | 5.73 KB | vinoth.3v |
#5 | omega-base_layout_support-506436-6964046.patch | 6.52 KB | vinoth.3v |
#1 | base_layout_support-506436.patch | 6.36 KB | vinoth.3v |
Comments
Comment #1
vinoth.3v CreditAttribution: vinoth.3v commentedAdding my first patch to omega.
Comment #2
vinoth.3v CreditAttribution: vinoth.3v commentedComment #3
fubhy CreditAttribution: fubhy commentedComment #4
dasjovinoth.3v: check your editor to comply with drupal coding standards. you can review patches using Dreditor which indicates that your patch adds white spaces for empty lines which shouldn't be the case
Comment #5
vinoth.3v CreditAttribution: vinoth.3v commented@dasjo
Thank you for advice, I am using Geany on ubuntu. It is fixed :)
adding another patch.
Comment #6
vinoth.3v CreditAttribution: vinoth.3v commentedSorry previous one was wrong,
Comment #7
dasjothat's much better vinoth.3v :) sorry about being picky but dreditor still shows some (trailing) white-spaces
Comment #8
dddbbb CreditAttribution: dddbbb commentedHas this idea stalled or is anyone else still interested?
I personally think it's a great idea. I was working with multiple layouts just today and was wondering if there was a better way than repeating my code so much in each layout; "Sub layouts" seems like a great solution to this potentially.
Has a version of this concept already snuck into dev without me noticing by any chance?
Comment #9
msmithcti CreditAttribution: msmithcti commentedThanks for the patch! This is certainly something that is interesting and worth consideration. Looks like the patch is pretty out of date and needs a re-roll. As mentioned above there is also some whitespace issues too.
Comment #10
fubhy CreditAttribution: fubhy commentedI still think this is an interesting addition for our layouts. Do you want to re-roll the patch? Some parts of this patch still need to be optimized but in general the idea of base layouts makes sense.
Comment #11
vinoth.3v CreditAttribution: vinoth.3v commentedThe patch has not considered many aspects of the Omega layout system since it was written in early days of Omega 4.x. When I writing that patch, I just wanted to add base layout Css & Js files to sub layouts. So patch was created that way. But with Omega later updates, now it is possible to include base layout Css & Js in sub layout.inc files in path directly, so I am not using the patch right now.
Yes, it is worth If Omega have such a Optional feature. but the patch is not enough. Better you can put your time on other part of the Omega.
Lets see if any one need this feature.
Comment #12
fubhy CreditAttribution: fubhy commentedYes, what you said here is true, one can re-use css/js across layouts... but base layouts would do that automatically - that's the actual benefit. So I think we really should implement this. It's not too hard to write that code anyway...
Comment #13
vinoth.3v CreditAttribution: vinoth.3v commentedThat's Great!
Comment #14
fubhy CreditAttribution: fubhy commentedTagging
Comment #14.0
fubhy CreditAttribution: fubhy commentededit
Comment #15
HeathN CreditAttribution: HeathN commentedI am confused. Does Omega 4 allow for base/sub layouts? I need this as a bunch of my pages are needing altered HTML but also need the same header and footers.
Comment #16
fubhy CreditAttribution: fubhy commentedNo, I never wrote the code to implement that... You can of course copy a layout multiple times and re-use parts of it, but there is no inheritance.