Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.
I’m relatively new to Drupal and am trying to wrap my brain around the best way to do things, which I’m finding out there are many. I need to have an image appear on each page depending on a variable set within that node. I created a CCK node type with this image field, so that’s not a problem. Getting it to appear on the page is not the problem, it’s figuring out the best way to do it that seems to be burning substantial brain cycles.
My initial go at it was to create a region in my theme, then create a block containing the logic I needed to determine which image to display and have that block display in that region in my page.tpl.php file. Okay so far – except that I just realized no $node variables are available in my block. I’m assuming I need to either create a module to create the block content or somehow use the _phptemplate_variables function in my template.php file. I’m trying to not only think about the logic, but the overhead involved in my approach. I could easily put the PHP logic right in my page.tpl.php file (where I know I have all the $node variables available), but I was trying to keep as much logic out of my PHP file as possible (good idea?). However, that approach seems to be the easiest approach with the least overhead. Regarding overhead, I’m referring to the Block method where the block would have to be called (overhead), I need to theme it for my purposes (more overhead), then I need to make the $node variables available to it (again, more overhead).
Hi everyone. I have been searching and fiddling for days on this issue. I have failed and must now ask for help. I have a menu that I am displying in my footer. I am using this code in the page.tpl.php file:
I am trying to create the tab look that this site current has. I was wondering if there is an easier way to do it other than the one I am currently having problems with.
First i created a background image for the a href tag. display:block; float:left; , however the first tab is shifted a little higher then the rest of the tabs.
Is there a different way to go about this? I am new to the drupal and PHP but have a pretty good HTML background.