简体   繁体   中英

Drupal 6 Block Theming

I may be barking up the wrong tree but...

I've got a section of content for a website which is a list of several blog articles but the design to be implements shows the first 5 rows having an image, title & teaser and the following 10 items showing only a title.

This doesn't seem like an uncommon design and, to me, this should be a single block view of 15 items with a conditional statement in the appropriate .tpl.php file to determine how each item should be displayed.

I've tried a few variations of overridding style output (block) & row style output (fields) but I'm not managed to figure out how do this?

Does anyone know how to do this or can point me in a different direction to resolve this?

Views should be adding classes such as views-row-1 , views-row-2 so you will be able to change the styling via css.

If that's not enough, if you are using fields, you will probably want to look at overriding the Row style output - the default file is views-view-fields.tpl.php, you can change it to something like views-view-fields--VIEWID.tpl.php

(You may need to check the views UI Basic settings > themes to find the right ones, it's kind of fussy.)

If you look in the preprocess function it iterates over the rows and creates the html output, you could add some custom logic there and the tpl to omit fields as you see fit.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM