One Drupal Themers Path for Defining a New Panel

14 Apr in build, drupal, how to, panels, theme
article image
My goal is to continue my work exploring the 960 grid system. I ‘mostly’ like the mark-up, and I really like the visual representation. The classes and id’s seem to fit my style. I have an awesome “Mothership” (morten), and developing some very cool subthemes for a client that will allow them some incredible flexibility and the ability to add new themes (colors, images, shapes) pretty quickly without losing the overall look and feel... Anyway…
My next evolution was to use 960.gs with panels. I love the flexibility and flow of panels so now I need to create my own panel with specific mark-up for 960.gs, and so that it will fit into my “Mothership”. At the time of this blog post I am using Panels 6.0-3-alpha4. My plan is to create a 3 panel layout that is large, medium, and small. For 960.gs using the 12 grid, I am creating a grid_5, grid_4, and grid_3. Here we go…

Finding Nemo (tpl files)

As a themer I feel very fortunate that merlinofchaos uses timplefifs (morten) almost as a philosophy. I found the files I wanted to work /panels/plugins/layouts This is my first go at this, so I didn’t want to fuss with the flexible layout, and I didn’t want to add or guess at any extra variables, so I decide to start with one of the three column layouts (threecol_25_50_25)

My First Path

I copied all of the files into a new folder called panelcool
copyfolder.png


I renamed the files.
renamebefore.png
renameafter.png


Then I dug right into what I know best first… the tpl file, and here is where I make my mark-up changes, the new code looks like this.


<div class="container_12" <?php if (!empty($css_id)) { print "id=\"$css_id\""; } ?>>
  <div class="grid_5 alpha">
    <div class="inside"><?php print $content['left']; ?></div>
  </div>

  <div class="grid_4 alphaomega">
    <div class="inside"><?php print $content['middle']; ?></div>
  </div>

  <div class="grid_3 omega">
    <div class="inside"><?php print $content['right']; ?></div>
  </div>
  <div class="clear">&nbsp;</div>
</div>
<div class="clear">&nbsp;</div>



Now it’s time to suck it up and work with the function. The function can be found in the renamed file (panelcool.inc) here is the BEFORE and AFTER…

BEFORE

function panels_threecol_25_50_25_panels_layouts() {
  $items['threecol_25_50_25'] = array(
    'title' => t('Three column 25/50/25'),
    'icon' => 'threecol_25_50_25.png',
    'theme' => 'panels_threecol_25_50_25',
    'theme arguments' => array('id', 'content'),
    'panels' => array(
      'left' => t('Left side'),
      'middle' => t('Middle column'),
      'right' => t('Right side')
    ),
  );

  return $items;
}


AFTER

function panels_panelcool_panels_layouts() {
  $items['panelcool'] = array(
    'title' => t('Panel Cool'),
    'icon' => 'panelcool.png',
    'theme' => 'panelcool',
    'theme arguments' => array('id', 'content'),
    'panels' => array(
      'left' => t('Left side'),
      'middle' => t('Middle column'),
      'right' => t('Right side')
    ),
  );

  return $items;
}


Optional Stuff

I changed the png image so I could see the changes :)
I didn’t mess with the css for this because the 960.gs css is already in my theme, so the layout will be controlled by that file, but if you want to add the css file add 'css'=> 'panelcool.css', to the array $items['panelcool'] = array(, that will get it loading for you.


Head back to a panel layout screen and BAMO!
hereitis1.png
panelsin543.png


Next week we’ll make our new Panel into a module so we don’t hack Panels2 by leaving our directory in there… it’s in alpha after all, we don’t want to move and replace the file every time.

Comments

A module should take...

just about 60 seconds, and you'll spend most of it on the .info file =)

just implement the directories hook, tell it what directory you want your layouts in and copy your layout directory over to your module. Finis.

Or stick it in your theme, if you like. That's barely documented so far, but your theme can provide layouts too.

Drew Brees jersey

just implement the directories hook, tell it what directory you want your layouts in and copy your layout directory over to your module. Finis.

Module inspiration

I've actually created a module that provides a few new layouts without messing around with files in the Panels module – it is, however, for Panels 3, but feel free to take a look:

http://github.com/kdb/bibliotek.kk.dk/tree/4a4494273ea92c921be46d9fe0087...

page doesn't exist

Can you provide another link for this? Thanks in advance.

Please write the followup to this article

This is really cool and would be even cooler if it could be wrapped into a module so that panels wouldnt need to be hacked...
Is the process for this the same with panels 3?

really looking for the right way to do this and it feels like you are so going in the right direction

great article, thanks

I am using Drupal two years

I am using Drupal two years and I love it.Great tutorial.

nice way

nice alternative to define a new panel ...

Good Article

I am not much into reading, but somehow I got to read nice information on your site. Simple to understand and helpful. We will look forward for your future updates. Thanks

beijing

beijing shenzhen affiliate merchant accounts dropship fulfillment cali bar store cali bar supplies metro credit card credit card machine Gold Investment Barbecue Rich Forever affiliate discount china bar Stool bar Stool bar Stool bar stool merchant cash advance merchant accounts

110

what's your name? bmx

I like to push the

I like to push the boundaries. I love creating unique, clean, usable design for the web and other digital sources. Now I am doing ccna for better job.

Drupal Themes

I always try to find tutorials on Drupal & I find this article good one to learn something about Drupal.In few days I've learned a lot about Drupal through many blogs.I must appreciate you for this information.Thanks. Bijaya, Small Storage Boxes

Drupal Themers

I noticed that it's very hard to hire a Drupal Themer, anyone else have experienced that? What can the community do to ensure that there're enough Drupal Themers and Developers so that Drupal can continue to grow and succeed. By the way , If you need any helps of seo services then you may contact at Professional SEO Company UK near London. Expert SEO services consultant will rank your website into top 10 positions on Google, Yahoo and Bing.

Best Drupal Themers

If their license allows it, buy a Joomla one you like and convert it. It's not super hard to convert a theme and you can hire a coder for that if you want for probably a lot cheaper than a designer to design a new one.Professional SEO and Internet marketing company near Kolkata, India. Contact now at info@competeinfotech.com or call us straightly at +91.9433365039. We offer best SEO, Social Media and Link building services for all range of business and their sites. For mpre details contact at : http://www.competeinfotech.com

sf

We'd love to follow. As you a lot about this topic in your facebook account, I've shared. I own the web site below has a few. If you follow them in you'll be happy. borsa Petrol Fiyatları borsa haberleri canlı borsa borsa forum Batak bitkisel ürünler Palavra Haber Bahçe makinaları bahçe çapa makinaları Bahçe makinaları tarım mainaları çapa makinası çapa makinası fiyatları çim biçme makinaları çapa makinaları havuz kimyasalları

Finding Nemo

Finding Nemo is a 2003 American computer-animated film written by Andrew Stanton, directed by Stanton and Lee Unkrich and produced by Pixar Animation Studios for Walt Disney Pictures. It tells the story of the overly protective clownfish Marlin, voiced by Albert Brooks, who along with a regal tang called Dory, voiced by Ellen DeGeneres, searches for his son Nemo, voiced by Alexander Gould. Along the way he learns to take risks and that his son is capable of taking care of himself.

Nice comment for a nice

The film received overwhelmingly positive reviews and won the Academy Award for Best Animated Feature. It was a financial blockbuster as it grossed over $864 million worldwide. It is the best-selling DVD of all time, with over 40 million copies sold as of 2006 and is the highest grossing G-rated movie of all time. In 2008, the American Film Institute named it the tenth greatest animated film ever made during their 10 Top 10. It was also the first Pixar animations studio film not to be released in November. By the way you can visit : http://www.charlottemarketingfirms.com/

Drupal Themers Path for Defining a New Panel

A user with sufficient permission can define new roles for your site, create new user accounts, and assign different permissions to the roles; the screens to manage users and roles can be found at path "admin/user".

Hi...

Can you provide more links for this? Thanks in advance.

Drupal Theme

The key features for using Drupal development are it is ease-of-use and large selection of modules and themes.

I like your blog topic

Hello i like your blog topic so first of all .I added it to my favorites website list and will be checking back soon.

Good Theme

I am pleased by reading this one and will definitely share with my friends..

Like It

I really like this post for its conception or theme.

In my twitter I have shared

In my twitter I have shared this one and getting so much good response.

I have shared this one in

I have shared this one in many forums and the community like it.

I think the diagrams, pics

I think the diagrams, pics has done the trick...

Nice post

A good seo consultant will help your business capitalize the ever changing needs towards online research and marketing. A good SEO expert can only be a good SEO consultant because it is an expert whose experience as well as knowledge can help your site to improve your website ranking. It is a fact that use of an expert SEO consultant can increase visibility of your site, productivity, sales as well as bottom line. For more details contact at www.seoexpertconsultant.co.uk/

informative post

Explore Talent Interesting post with valuable information you got here! I am really thankful for sharing this blog and time into the stuff you post!!

pvc strip curtains

[url=http://www.hisure-pvc.com][b]pvc strip curtains[/b][/url] [url=http://www.hisure-pvc.com][b]pvc strip doors[/b][/url] [url=http://www.hisure-pvc.com][b]plastic strip curtain[/b][/url] [url=http://www.hisure-pvc.com/product/Inset-Proof-Door-Curtains_1.htm][b]Inset Proof Door Curtains[/b][/url] [url=http://www.hisure-pvc.com/product/Wide-PVC-Sheet_1.htm][b]pvc sheets[/b][/url] [url=http://www.hisure-pvc.com/product/Anti-Static-Door-Curtains_1.htm][b]Anti Static Door Curtains[/b][/url] [url=http://www.hisure-pvc.com/product/Wide-PVC-Sheet_1.htm][b]pvc clear sheet[/b][/url] [url=http://www.hisure-pvc.com/product/Wide-PVC-Sheet_1.htm][b]pvc sheet supplier[/b][/url] [url=http://www.hisure-pvc.com/product/Wide-PVC-Sheet_1.htm][b]extruded pvc sheet[/b][/url]

Post new comment