File node.tpl.php: Is there a way to edit without modifying the core file?

drupert55 - August 6, 2009 - 09:09

Hello.

Is there a way to make modifications to core files such as node.tpl.php without actually editing that file?

For example, can I duplicate this file, make modifications then place it in the /sites folder to override the original version? I want to add a sort order for the $sticky var.

Thanks.

All themes contain a

cog.rusty - August 6, 2009 - 11:21

All themes contain a node.tpl.php file which can be edited. It is also easy to make a customized copy of any theme (by renaming it and editing its .info file), which you can place under sites/all/themes, and use that one instead of the original.

In any case, also check these modules:
http://drupal.org/project/weight
http://drupal.org/node/398508

you could use a views block

lasac - August 6, 2009 - 11:16

you could use a views block

You can create a sub theme.

duvien - August 6, 2009 - 11:21

You can create a sub theme. Or try http://drupal.org/project/custompage though i haven't used it so not sure if it'll fit your needs.

http://drupal.org/project/contemplate might also be useful.

Thanks for your replies. I'm

drupert55 - August 6, 2009 - 21:26

Thanks for your replies.

I'm still in newbie status so even though I might not quite know how to apply some of your replies, the more I continue to use this software, I'll get there.

@cog.rusty - I checked out your references and for 'Comparison of Node Ordering Modules', although I couldn't see the entire table (sidebar overlaps last column), it looks like very important info as to the understanding the infrastructure. Good stuff.

@lasac - I wish I knew more (something) about views. That's on my to do list. Hopefully I can find a good tutorial on it. If I knew more about it, I could figure out how to order the sticky nodes which I still haven't figured out and haven't gotten a response to a previous thread I created, so I'll be winging it. I'll write some kind of routine in the node.tpl.php file now that cog.rusty explained how I can make changes.

@duvien - I'm going to look into your suggestion of a sub-theme as soon as I get past coming up with a way to order front page stickys the brut-force way (I'm not going to alter timestamps) and hopefully get a solution to my feeds not updating dilemma that I posted earlier today.

I got my hands full.

Thanks again folks!

drupert55: i would advice you

lasac - August 7, 2009 - 09:18

drupert55: i would advice you to first start with the views module. It will make your live much easier. Just click around it play with the different views types (block, page, feed etc) play with the filters, arguments etc. It is so much easier then it looks like!

Thanks lasac. I'll give it a

drupert55 - August 9, 2009 - 05:10

Thanks lasac.

I'll give it a shot.

I know this post is older (I

Foonaka - January 4, 2010 - 23:25

I know this post is older (I just stumbled on it looking for something else) and I'm not sure if you ever figured out Views or not, but for you or any others that may stumble upon this, Lynda.com has a great tutorial on their site that includes Views basics, along with some other, very helpful information. That was how I learned to use Views and CCK. The name of the course was "Drupal 6: Online Presentation of Data". Of course you'll have to pay for it, but the subscription is worth it if you need other training, as well...

 
 

Drupal is a registered trademark of Dries Buytaert.