-
Notifications
You must be signed in to change notification settings - Fork 20
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
Need tutorial on how to convert themes to BD from D7 #29
Comments
Although you've already proven your knowledge, the official procedure is to apply for an account at https://github.com/backdrop-ops/contrib. :)
Agreed, I thought we turned it off but looks like they're indeed on.
Could you elaborate?
I think the only options here are to override the header.tpl.php, or the block--system-main.tpl.php file, neither are really ideal substitutes. This may be a result of our separation between layout and theme, which may have resulted in a separation between functionality and theme as a side-effect. |
The slider provided by Clean Theme seems like the sort of thing that should not be provided by a theme at all. It's functionality, or at the very least, layout. If you built a site in Clean Theme, you wouldn't be able to easily switch to another theme. Of course, it's open source, and we can't stop anybody from doing what that want, but...this seems like something that we don't particularly want to encourage. If a site builder wants to include Nivo Image Slideshow in their site, the "preferred" way would be for them to grab a module for the functionality, then drop the pane/block/whatever into a layout. Is that right, or am I missing something? |
Technically that may be a reasonable POV, but every CMS has many (probably the majority} themes/templates which provide sliders or front page images these days. Users will expect this, and themers will expect to be able to do it. |
Ah! Yes that's normal behavior. The "main page content" block only exists if you're overriding an existing menu path. So if you were to override "node/1" for example, the "main page content" would exist. But if you create a layout at "my-custom-path", the main page content block doesn't exist because it wouldn't contain anything. So my suggestion of overriding block--system-main.tpl.php isn't going to work.
Yep, I think you're right that the expectation is there that the theme can add functionality, even if that's been somewhat discouraged in the Drupal community, it's still been possible. Perhaps we could make the homepage modifiable through some dedicated template... I'm not sure about it. |
I'm not finding this, but I'll raise an issue in the right place. |
I'd like to add my 2 cents regarding functionality in themes. I personally hate it when themes provide functionality like a slider. No offence, but themers aren't the best coders. I find implementations are often not flexible (they're made to work a certain way and that's it) and things that should be options/configurable are hard-coded. I put my vote behind separating functionality & design. As @cellear said, themes should be interchangeable. Now that themes are no longer responsible for defining regions, there's no reason you can't easily switch themes with little-to-no changes to a site necessary. |
I too like the new separation between themes and layout, and the resulting separation between themes and functionality, but it really is the case a lot of the time that the design and functionality go hand-in-hand, for example a theme intended for a brochure site is different than the theme for an e-commerce site. I think we'll need to solve this old problem in a new way with Backdrop. Themes are likely to become "skin-only" and add-on functionality might be through new, unconventional means. One option is bundling a directory of config files to pre-configure a layout, new blocks, a slideshow, rotators, etc. With the right configuration, a theme wouldn't need additional modules for something like a rotator, since it can just convert an |
I'm just curious about this:
So how and where do we define regions for a theme? |
Through Layouts' template files. Here are the ones included in Backdrop core: https://github.com/backdrop/backdrop/tree/1.x/core/layouts And note that you're creating regions for layouts, not themes. |
@BWPanda thanks, interesting! This seems similar to how Omega 4.x does it. I like it. |
Seriously though, @quicksketch @jenlampton @cellear, we cant launch in 13 days and have talent like @danny-englander still unable to discover about basic things like defining regions. To the original point of this issue, and excuse the nagging, docs pages soon please? |
@docwilmot I think we need to do two things:
As for the launch of Backdrop CMS, our priority is to get Backdrop out on Jan 15th. After we get backdrop out, then our priority will shift back to the community tools that are needed to support it. First things first :) |
https://backdropcms.org/layouts needs a better title IMO. How about "Build with Blocks and Layouts". I realize this puts blocks and layouts in the same documentation section, but I think they need to be explained together anyways. A more detailed "place Blocks in the regions created by Layouts" I guess. |
Love it :) |
I was looking at the docs and theme structure on https://api.backdropcms.org/themes and I am wondering if a theme can declare a layout? I am envisioning a layouts folder in my theme folder that then can be used in the layouts management page. I just don't want to go down a rabbit hole before I start a theme conversion. |
Hi @danny-englander! In short, no. The whole point of separating layouts from themes is so you can to change your theme without breaking your site, and so that you can easily use a different layout on any page (the home page, for example, often uses a different layout than the rest of the site) If your site needs a special layout then you'll need to create both a layout and a theme. The CSS for the layout will go in the layout (so that it can work with any theme) and the CSS for the theme will go in the theme (so that it can work with any layout). You can then change your "default" layout to use the new layout you have created, and you'll see it on every page of your site. |
Hi @jenlampton, so it sounds like I can declare a layout in a custom theme? I am picturing this in my theme folder:
|
Loving this new separation! 👍 |
@danny-englander No. Layouts and themes are completely separate and can not be packaged together. (That would defeat the point of the separation, and your site would still break if you changed your theme) Layouts are a new concept in Backdrop. Where Drupal had modules and themes, Backdrop has modules, themes, AND layouts. For an example of the anatomy of a layout see the core/layouts folder and the three layouts within. All you can do to a layout in a theme is override the *.tpl.php file, or .css (just like you can with anything else). For example: you may be able to get away with using the core two-column layout and overriding the CSS to make the columns different widths. But if you need a four-column layout, you'll need to add your own in /layouts/four_col. Here's an example directory structure (abbreviated)
|
@jenlampton - that's perfect, thank you! |
Converting tutorial is located here: https://api.backdropcms.org/converting-themes Closing this issue. |
Just did my first theme conversion of the Clean theme https://www.drupal.org/project/clean_theme. See it here at http://wilmurt.com/
There are a few things which need to be mentioned for persons hoping to do that as I'm sure you know. These were my personal thoughts:
<nav>
tag<h1>
on the front page but<strong>
elsewhereClean came with a slider on the front page which is baked into the page.tpl.php. Since this template is now individual layout files, how does a them provide a slider now? Override layout templates? Provide a layout-front-page.tpl.php? This was a head-scratcher, which I still havent figured.
Finally if I wanted to list this theme on BD contrib page, whats the procedure?
I will try to put these thought into a coherent document eventually, but just wanted to record this here to highlight the issues.
The text was updated successfully, but these errors were encountered: