This forum is for assistance with theme development.

Alternating colours for Product listing in Ecommerce module - How?

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 :

template.php functions not available in sub-themes!?

The theme engine do not include my "mytheme" "template.php" file and others... following situation:

Example directory:

How do I do that? paging articles and blogs without screen refresh.

Hi Guys,

tips needed from any theming gurus (is Dub about?) out there who can point me in the right direction to do this:

http://www.todayonline.com/articles/154756.asp

I love the way you can page back and forth between the pages, without loading the entire page again and without scrolling.

Phil

Some basic theme questions

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?

To Block or not to Block?

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).

How does a theme check to see if users are logged in?

For my page.tpl.php, I want to show certain sections only if somebody is logged into the website.

I tried:

 if ($user->uid) { 
echo "internal stuff goes here";
 } 

...but this did not work.

Any suggestions as to how I could get this to work?

Pages

Subscribe with RSS Subscribe to RSS - Theme development