Drupal sub subthemes? - drupal

I am trying to do a set of secondary sub-themes based on a sub-theme (starterkit) from Zen.
Ideally:
Parent Theme
Section 1
Section 2
Section 2A
I have my parent theme installed and working. For the section sub themes, I copied the parent theme, and renamed the appropriate files and folders, and changed the base theme in the .info to the name of the parent theme. Yet it is not inheriting certain things like template.php (section themes do not have them because they are supposed to be inherited I thought)- which means I don't receive body classes like my parent theme does.
What I really need to achieve is having specific style for these different sections, mainly text color and a background image change. Is this the simplest way to do it? I don't want to have one huge stylesheet so any pointers are appreciated.

Are you running D 6.20 ? There was a fix for a subtheme inheritance issue in that update.
http://drupal.org/node/481142
Eric

Related

WordPress / Gutenberg - Front and Editor Styles in One File?

I've got a lot of custom stuff to style inside my current project ( first one made with Gutenberg) and editing two files (that include a lot of media queries) makes the task deeply infuriating.
Is it possible (and viable) to merge the 'frontend' styles and the editor styles within one CSS file in WordPress? So I can have the 'frontend' and 'editor' versions opposite one another in the CSS file and nothing flips out?
This will cause unnecessary code in the admin panel.
Write CSS Separately for Gutenberg(editor styles). Gutenberg CSS file must include these: heading(h1,h2 etc...), , quote etc... Add this style even if the style element is for your front end. These attributes must be placed in editor styles.
Then enqueue the editor styles CSS file both.
Ali is mostly right but the reasoning is kind of reversed.
You want the public views to be as small as possible, so while adding weight to Gutenberg would suck, adding weight to public views is much worse and will negatively impact page scores?

Prestashop changes to theme

I have been tasked with making a small design change (CSS) to a Prestashop site that used an off the shelf theme.
I know that in WordPress you can make a child theme to put your design changes in which is best practice.
Is there a similar method I should be using in Prestashop? Or alternatively is there anywhere in the dashboard I can put these changes?
If you're building from a default theme, then the correct way would be to go to Themes > Add New Theme > Create New Theme > Copy default-bootstrap and create a new theme.
There are no child themes in PrestaShop (any kind of inheritance system for themes would majorly complicate an already complex system). What you have is what you work with. If you bought a third party theme, then go modify it directly (modify .tpl files, modify global.css, etc.). IF you copied default theme, then work with your copy (just don't work with default theme, it may get updated).
An event better way would be to install compass and modify .sass files (that is the most correctest :D way).

ASP.NET Theme'ing along with customer specific images and css

We have a ASP.NET solution using images, css and .skin files with in the App_Theme/{selected theme}. The themes today contains many, many files and images and for a customer theme we add a new folder to the App_Themes and copy all files to the new folder and make the 10-200 changes on images, skin and css's.
The issue here is that the default theme, the one we normally have when we develop, evolve's and grows making theme customer theme out of date. So when an upgrade comes we have to go through all files looking for changes and hopefully finding them all. Sometimes we miss things that are really important.
The perfect solution would be to have a base theme that contains the base css, skin and images. And when we add a new customer theme we only tell the system what has been changed, what css-selectors to override and what images to use instead of the images from the base theme. In my understanding, if using the normal ASP.NET theme functionality in App_Themes folder, you can only have ONE theme and not a BASE theme and then say a DeliveryCustomer-theme that has a different background and some other images that the solution shall use instead of the ones in the BASE-theme.
Does anyone have some guidelines to solve this in a maintainable way for the future. I seen that people override the App_Theme path to make it work with custom skins.
thanks!
Use the concept of a base theme like you described. Pull out all common CSS rules into another file, let's call it base.css.
Take base.css and all the images that are common, and put them in a folder outside of App_Themes, and just include the CSS file like you normally would any other on your master page.
<link rel="stylesheet" type="text/css" href="/styles/base.css" /> <!-- Note this isn't in app_themes -->
Then, make sure your CSS files in various themes only specify the delta for your styles.
Ok, so here is how I'v done it know.
I have created a Default theme that is the original theme with all the css-files, skin-files and images that is needed, and that is alot. This theme is in the App_Themes folder. Them I'v created a new folder called ThemeSkins next to the App_Themes folder. In this folder I have all the new skins in different folders. The folders name is the name of the new theme that one want's to have. In each of the skin folders there are css-files that contains only the selectors that I want to overload. There is also images that I want to replace.
I have created a ThemeCreator tool that does three things:
Remove all themes except the Default theme in the App_Themes folder. This is to only have one main theme to work on for the developers. There will still be work that needs to be done in the ThemeSkins, but the overall work load will be minimal.
Next the tool looks at the folders that is in ThemeSkins and creates a folder under App_Themes for each skin with its name. Then it copies the Default theme into all the new skin folders that it just created.
The last thing is that it will merge the skin specific files into the newly created skin under App_Themes and let the user know what files were added just for information. The tool adds a prefix, "z_", on all css-files so that these are loaded last of all css-files and there for will overload the default selectors.
The thing that remains is to update the skin-files, so far, no customer has needed changes in these files. But when they do, I guess I just add a skin files and have to update the default in a automatic way since the skin-markers can't be overloaded as css-selectors can.
This works really smooth and gives us a nice and lean way to work with skins on our themes.
Any one got a better idea how to get the same result? the major issue using ASP.NET themes are that you can't use a default theme and then just apply skins to it without using the shape and color attribute in the skin-files. This is not recommended as the skin files will copy out all attribute to all the places that they are needed in the markup and not just reference them as css-classes do.

Drupal theme files outside of theme folder

Is there a place where I can place override theme files other than a theme's folder? For example, if I wanted to override the appearance of a view's row in the same style for more than one theme without having to use more than one file.
If there isn't a generic way to do this (for any theme file), is there a way to do it for a view's theme files?
In your module, you can use hook_theme to declare a theme function or template for your view's row. This way, your single template will be used by all your themes without any special code in them. See the Theming your views in your module section in the Views's API Advanced Help page.
You could include an include_once type statement in your tpl.php file and just import the code from where ever. This way you have any number of files that refer to one.
It is not recommended though since if you move your theme folder or rename anything this can be harder. Also if you put your theme in another site you need to keep track of all of these off-theme hacks.
I think views seeks tpls inside of the theme folder. It's be nice to have something like that though.

Simple Drupal sub-themeing...what am I doing wrong...?

I'm trying to set up a very basic subtheme with Drupal. I've been led to believe that the subtheme will inherit the settings of the base theme and the two themes will look almost identical.
Here are the steps I am taking...
Creating a new folder at '/sites/all/themes/sub_theme_name'.
Creating the info file 'sub_theme_name.info' in this folder. Here are the contents...
$Id$
name = sub_theme_name
description = This is a demo sub theme.
version = 1.0
core = 6.x
base theme = garland
Browse to the Themes Admin page. Enable my subtheme and set it to the default.
Browse to my front page...this is where I expect everything to look identical or almost identical to the base theme 'garland'. The problem is that no CSS files are being inherited.
Any ideas?
There is a little gotcha in the docs.
All style sheets defined in the parent
theme, but there is an option so this
can be controlled. Furthermore, your
subtheme must define at least one
stylesheet in order to inherit parent
stylesheets.
So if you define a stylesheet, even if it is empty it should work.
I reckon that you should start with project zen.

Resources