Hi Folks,
I am still trying to understand sub-themeing. I have four themes installed and two enabled. Bartik(enabled), Seven(enabled), Garland, Stark. I tried a minimal, trivial sub-theme of Bartik by creating a subdirectory /sites/all/themes/bartik-cjm populated as follows:
bartik-cjm/ bartik-cjm.info css/ local.css
bartik-cjm.info:
name = Bartik-cjm base theme = Bartik
core = 7.x
stylesheets[all][] = css/local.css
According to everything I've read, and it has been a increasing amount, this should be sufficient to create a sub-theme named "Bartik-cjm" which inherits everything from Bartik and overrides local.css with my copy. I believe I should see this as one of the options in admin/appearance, and I don't. I can see that $data[system_list][theme] is populated from the MySQL database (select * from cache_bootstrap where cid = "system_list";), which only has my original four themes in the serialized object.
So, either the database must be updated somewhere, somehow, by someone, -- OR -- Drupal must look at the filesystem and realize that there is more to the story than the database knows and extend the list. So, how does Drupal become aware of the custom sub-theme?
Have you tried:
1. Make a copy of the "Bartik" folder from the core>themes file. 2. Put this folder in your sites>all>themes folder 3. rename this folder "bartik-cjm 4. open the "bartik.info file and add "stylesheets[all][] = css/local.css" 5. Rename bartik.info file to "bartik-cjm" 5a. Create a file in the css folder called "local.css" since it's here you will be over riding the Bartik original css files 6. check all the other files in the "bartik-cjm" folder for "Bartik" and replace this with "bartik-cjm" 7. Go to Admin/appearance and you will now see your subtheme "bartik-cjm"
Pia
Hi Folks,
I am still trying to understand sub-themeing. I have four themes installed and two enabled. Bartik(enabled), Seven(enabled), Garland, Stark. I tried a minimal, trivial sub-theme of Bartik by creating a subdirectory /sites/all/themes/bartik-cjm populated as follows:
bartik-cjm/
bartik-cjm.info
css/
local.css
bartik-cjm.info:
name = Bartik-cjm base theme = Bartik
core = 7.x
stylesheets[all][] = css/local.css
According to everything I've read, and it has been a increasing amount, this should be sufficient to create a sub-theme named "Bartik-cjm" which inherits everything from Bartik and overrides local.css with my copy. I believe I should see this as one of the options in admin/appearance, and I don't. I can see that $data[system_list][theme] is populated from the MySQL database (select * from cache_bootstrap where cid = "system_list";), which only has my original four themes in the serialized object.
So, either the database must be updated somewhere, somehow, by someone, -- OR -- Drupal must look at the filesystem and realize that there is more to the story than the database knows and extend the list. So, how does Drupal become aware of the custom sub-theme?
--
Chris.
-- [ Drupal support list | http://lists.drupal.org/ ]
From: "Pia Oliver" pia@piasworld.com To: support@drupal.org Sent: Thursday, October 10, 2013 10:02:07 AM Subject: Re: [support] Sub-theme
Re: [support] Sub-theme Have you tried:
- Make a copy of the "Bartik" folder from the core>themes file.
- Put this folder in your sites>all>themes folder
- rename this folder "bartik-cjm
- open the "bartik.info file and add "stylesheets[all][] =
css/local.css" 5. Rename bartik.info file to "bartik-cjm" 5a. Create a file in the css folder called "local.css" since it's here you will be over riding the Bartik original css files 6. check all the other files in the "bartik-cjm" folder for "Bartik" and replace this with "bartik-cjm" 7. Go to Admin/appearance and you will now see your subtheme "bartik-cjm"
Pia
Hi Pia,
No. I haven't done that for a very specific reason and that reason is that your recommended procedure does not give me a sub-theme; it gives me a custom theme which is a modified copy of Bartik rather than a sub-classed descendant. In this case, I am no longer inheriting from the Bartik base theme; I will have a copy which means that any changes to the base theme will be ignored and I don't really have a sub-theme; I have a modified new base-theme. I am lead to believe that what I have done is sufficient. ( https://drupal.org/node/225125 ), but clearly there is something that I don't understand, because my understanding is at variance with practice.
Thanks for the help,
Chris.
Chris,
My understanding is that unless you create a theme from scratch, with all the template files, you need to use the structure of a "base" theme. Therefore, you modify the templates and css files in the renamed copies of the files. This becomes your own "subtheme".
If you want to do a theme from scratch you must create the other files.
Pia
From: "Pia Oliver" pia@piasworld.com To: support@drupal.org Sent: Thursday, October 10, 2013 10:02:07 AM Subject: Re: [support] Sub-theme
Re: [support] Sub-theme Have you tried:
- Make a copy of the "Bartik" folder from the core>themes file.
- Put this folder in your sites>all>themes folder
- rename this folder "bartik-cjm
- open the "bartik.info file and add "stylesheets[all][] = css/local.css"
- Rename bartik.info file to "bartik-cjm"
5a. Create a file in the css folder called "local.css" since it's here you will be over riding the Bartik original css files 6. check all the other files in the "bartik-cjm" folder for "Bartik" and replace this with "bartik-cjm" 7. Go to Admin/appearance and you will now see your subtheme "bartik-cjm"
Pia
Hi Pia,
No. I haven't done that for a very specific reason and that reason is that your recommended procedure does not give me a sub-theme; it gives me a custom theme which is a modified copy of Bartik rather than a sub-classed descendant. In this case, I am no longer inheriting from the Bartik base theme; I will have a copy which means that any changes to the base theme will be ignored and I don't really have a sub-theme; I have a modified new base-theme. I am lead to believe that what I have done is sufficient. (https://drupal.org/node/225125https://drupal.org/node/225125), but clearly there is something that I don't understand, because my understanding is at variance with practice.
Thanks for the help,
Chris.
-- [ Drupal support list | http://lists.drupal.org/ ]
On 10/10/13 2:45 PM, Pia Oliver wrote:
Re: [support] Sub-theme Chris,
My understanding is that unless you create a theme from scratch, with all the template files, you need to use the structure of a "base" theme. Therefore, you modify the templates and css files in the renamed copies of the files. This becomes your own "subtheme".
If you want to do a theme from scratch you must create the other files.
Pia
What make a theme a sub theme is the presence of a "base theme" item in its .info file. You don't copy all the files, only the files you need to change, and you will automatically inherent the others from the base theme.