Hi,

Sorry but yes, I'm a newb and this is a newb question. But Drupal rocks and I love it! :)

Again, a question regarding my site at: http://phoenix.appdev.spritle.us

There are two, maybe three sub-templates I need to create. You can see examples of them here: http://phoenix.atomicspacelab.com/news/

I've done much searching, watched many tutorials on sub-themes but I can't get it to work.

My theme is not based upon any pre-built theme. It's just plain standards-compliant XHTML & CSS. From what I've read, this should not be a problem. That said, I've perused other themes and noticed a file called "node.tpl.php", for example:

<?php
// $Id: node.tpl.php,v 1.7 2007/08/07 08:39:36 goba Exp $
?>
  <div class="node<?php if ($sticky) { print " sticky"; } ?><?php if (!$status) { print " node-unpublished"; } ?>">
    <?php if ($picture) {
      print $picture;
    }?>
    <?php if ($page == 0) { ?><h2 class="title"><a href="<?php print $node_url?>"><?php print $title?></a></h2><?php }; ?>
    <span class="submitted"><?php print $submitted?></span>
    <div class="taxonomy"><?php print $terms?></div>
    <div class="content"><?php print $content?></div>
    <?php if ($links) { ?><div class="links">&raquo; <?php print $links?></div><?php }; ?>
  </div>

I feel bad for asking, given all the very-well written documentation available, but after three days of trying on my own I'm feeling stumped.

Thanks for your help!

Regards,

Tofu

Comments

Jeff Burnz’s picture

Drupal doesnt call subthemes, subthemes set a "base theme" in their info files, eg

base theme = MyBaseTheme

What has node.tpl.php got to do with this?

Please use the code tags to print blocks of code in the future.

tofuComputer’s picture

Thank you for your help. I've edited my original post so that its surrounded by code tags.

Could you elaborate on what steps are needed or point me to a tutorial that goes through each step? Again, my apologies for asking so much but so far, 99% of the videos/tutorials I've watched focus on developing themes/sub-themes based upon an existing theme, which I'm not doing.

Thanks,

Tofu

Jeff Burnz’s picture

Please explain what you are trying to do, because you've got me baffled. You are asking me to point you at a tutorial, but what about? What are you actually asking here?

You can't have a subtheme without a base theme, the base theme has to be built first, or use an exiting one - so thats why the videos and tutorials are all about that.

If you have built your own Drupal theme, then that becomes your base theme.

tofuComputer’s picture

My bad, thank you for pointing that out...

Ok...

I'm developing a new theme, which is going well so far:

http://phoenix.appdev.spritle.us/

But I've not been successful with developing a sub-theme. The sub-theme is simple, just a one-column layout instead of a two-column. I've got the base html and php regions code ready to go but I don't understand how to get the sub-theme to begin working. I'm obviously missing some vital code.

Thanks,

Tofu

tofuComputer’s picture

Thank you!!!! Really, thanks so much! :)

Issue resolved!

tofuComputer’s picture

Sadly, I'm re-opening this forum post...

The tutorial was great. But I still don't understand how one actually selects the sub-theme when making site content.

Can anyone shed some light on how this is completed?

Thanks,

Tofu

Jeff Burnz’s picture

You don't, thats simply not possible without programming. The best you can hope for is to set a different theme for site sections or pages or other conditions using either the Sections module or the Theme Key module.

tofuComputer’s picture

Thank you, I'm checking out Theme Key module now.

However, I don't understand why this is an issue? I mean look at it from the outside (like a newb like me would)...

You make a sub theme for certain pages in your site but no documentation on how to actually implement it?? (and when I say "implement" I don't mean uploading and making it active, I mean using it, actually assigning it).

I don't get it.

Thanks for your help.

Tofu

dvness’s picture

I, too, have been in search of a way to designate a subtheme to a particular parts of a site and it seems that the Sections Module works beautifully (requires no php). Check it out: http://drupal.org/project/sections

Jeff Burnz’s picture

Dude, you make a way valid point here - that from your perspective you expect this to be something that can be applied from within the UI.

Its an interesting idea and worth some thought, but, drupal is a do-ocracy man, if you want it, you have to do it (or pay/inspiire someone to do it for you).

Sections module is good also, forgot about that one.

tofuComputer’s picture

Yup, Jeff is right. The site I posted is now done but I ended up having to bring in one of my developers, who used conditional php tags to set which blocks appear on a given page. This way we didn't have to use a sub theme at all.

So yes, Drupal rocks but you gotta be able to code if you truly want custom results.

Thanks for your help everyone!

DC