Drupal 7 Bartik Subtheme Video


Creating bartik subtheme for Drupal & by kiwipion

 

Introduction

Moing forward I am going to be basing tutorials on Bartik. It's best to setup your own sub-theme this will allow you to keep your own files such css and templates and allow you to easily upgrade to later versions of Bartik.

Creating a subtheme is straight forward but sometimes people leave out the odd line which does cause problems. This tutorial will be a step by step guide which wil hopefully get your subtheme created easily.

Setup

  • Create your subtheme folder in sites/all/themes directory. I'll call mine nige_bartik and go into the folder.
  • Create your info file, to keep my naming convention the same as the folder I'll call mine nige_bartik.info. Then copy the contents of themes/bartik/bartik.info file into your new file.
  • Rename the name field to your new subtheme.
  • Delete the lines for package and version
  • Add a new line underneath core and add
    base theme = bartik
  • Remove all the stylesheets and add your own one. I'll create my own folder called css and create a css file called mystyle.css.
  • Add mystyle.css to your .info file for example
    stylesheets[all][] = css/mystyle.css
  • Now I'll add color support to the subtheme. Copy the file themes/bartik/css/colors.css into your subthemes css directory and the copy themes/bartik/color folder into the subtheme directory
  • Add the css file to your .info as such
    stylesheets[all][] = css/colors.css
  • Your .info file should look something like this
    name = nige_bartik
    description = A flexible, recolorable theme with many regions.
    core = 7.x
    base theme = bartik
     
    stylesheets[all][] = css/mystyle.css
    stylesheets[all][] = css/colors.css
     
    regions[header] = Header
    regions[help] = Help
    regions[page_top] = Page top
    regions[page_bottom] = Page bottom
    regions[highlighted] = Highlighted
     
    regions[featured] = Featured
    regions[content] = Content
    regions[sidebar_first] = Sidebar first
    regions[sidebar_second] = Sidebar second
     
    regions[triptych_first] = Triptych first
    regions[triptych_middle] = Triptych middle
    regions[triptych_last] = Triptych last
     
    regions[footer_firstcolumn] = Footer first column
    regions[footer_secondcolumn] = Footer second column
    regions[footer_thirdcolumn] = Footer third column
    regions[footer_fourthcolumn] = Footer fourth column
    regions[footer] = Footer
     
    settings[shortcut_module_link] = 0
  • Now clear your cache, go into your appearance list and enable your new subtheme. Hopefull it will show up in your appearence list as such

Comments

Submitted by Anonymous (not verified) on

Thanks for the tut! I was just wondering, what kind of file manager/terminal are you using in the video? Thanks!

Submitted by nigel on

I'm using a mac and got midnight commander via homebrew, its a golden oldie but still works fine. My terminal is iterm2 and am using zsh shell.

Submitted by Elvis (not verified) on

I do enjoy and think you work is of good standard, and is very help to drupal beginners, thanks buddy!! Oh

Submitted by Kim (not verified) on

Enjoed the read. thanks!

Submitted by gChen (not verified) on

Notice: Undefined index: #secondary in gretch_preprocess_page() (line 60 of C:\xampp\htdocs\ORRUCU\themes\gretch\template.php).

Pages

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.

Recent Tweets

  • New post: Posting location co-ordinates to a drupal service - Part 2 http://t.co/MQhlVKBNKC 1 month 4 days ago
  • New post: Posting location co-ordinates to a drupal service - Part 1 http://t.co/2xlYgqFaJ0 1 month 5 days ago
  • New post: Connecting a drupal service with a mobile application - Part 2 http://t.co/01cFtAunDs 1 month 5 days ago
  • New post: Using drupal services to connect to mobile applications - Part 1 http://t.co/VEURftHCef 1 month 5 days ago
  • New post: Creating Drupal 7 video gallery http://t.co/HvpKU7uT 3 months 1 week ago