I'm trying to get the ECommerce Products listing page to show an alternating background colour for each product teaser. I've found a few guides in the forums on how to get alternating background colours for nodes ... information such as this:
A neat trick is to count how many times each of the hooks is called, so you can pass an extra variable. re :
I'm just looking for answers to some basic questions, but the Theme Developer's Guide is so high-level, it isn't very helpful to anyone just staring out of the gate.
How do most people deal with the Drupal administration nav? My public site leaves no room for such a nav, is it customary for administrators to use a different theme than the public?
I want to create a block, and put that block in my template. How is this done? I'm just looking for 'create block named X, place Y code in Z file to call this block'. Is this possible?
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).