HELP! How to Get Continuous Block Lists Across More Than 1 Region

chipp203 - July 21, 2008 - 20:15

I would greatly appreciate any help someone can offer with this issue:

I've created a view in the views module (teaser list) of a particular node type....BUT i dont want the teaser list to be continuous....I want to be able to split the list up across different regions that I choose.

I know that the views.bonus.module can deliver 3 column panels that can do some of what i need. But ideally i would like to be able to have teaser lists be continuous across certain regions that I specify.

I'm really seeking to replicate the look of this site:

http://www.forever21.com/category.asp?catalog_name=FOREVER21&category_na...

The listed items should wrap around a central element as on that page. If there is an easier way to do this without using regions please tell. I would very uch like to know!!

Also how would i get a pager to run on a page like this if i only list say 20 items per page?

If it was me I would

nevets - July 21, 2008 - 20:25

If it was me I would "simply" theme the view output. Using you example url I am guessing the view has a term id as an argument in which case you could use the taxonomy image module to associate an image with a term and then use theming to get the layout you want "injecting" the image at the appropriate place.

Thanks for a quick

chipp203 - July 21, 2008 - 20:32

Thanks for a quick response...i'm downloadin/installng the taxonomy image module right now.

Its the 'injection' that has me stumped....how will I get the list items to wrap around a centrally placed image element? Any ideas? I guess what i'm looking for is something the quivalent of float:center (which does'nt exist)??

If we use you example URL we

nevets - July 21, 2008 - 22:02

If we use you example URL we can think of it as

Div Left | Div Middle | Div Right
Div bottom

So I would float Div's Left, Middle and Right to the left and set width to 30-32% (33% seems to be a challange in IE).
In the left div I would place the first 4 nodes, in the middle div the taxonomy image, the right div the next four nodes and the bottom div any remain nodes

This was my first thought

chipp203 - July 22, 2008 - 03:28

This was my first thought and seems pretty logical.....except how do i get a pager to work with this scenario?

lets say i have 40 items. the first 20 will be on page 1 in the layout described above... how do i get the other 20 to follow suit on page 2??

I was thinking:

1) use 1 view to generate the block list
2) Make sure that the view filters node as distinct (only one 'instance')
3) clone this resulting block using Multiblock. Each block would output 4 distinct nodes
4) Put each block in its own region as at Forever21

My only question is as above...how to get a pager to work...

I somehow think theres another (easier) way to do all this. If anyone knows one please let me know. Thanks for your brain storming nevets :)

I think you are over

nevets - July 22, 2008 - 04:14

I think you are over thinking it. You only need one view with the number of nodes/records limited to 20 and tells views to using paging. The theme function will then get at most 20 nodes to layout as you desire. This page, http://drupal.org/node/42597, would suggest the pager is added by views after calling the theme function.

so are you saying I should

chipp203 - July 22, 2008 - 04:23

so are you saying I should output this 20 item 'view' as a page and then theme it? If you how would I accomplish that wrapping effect?

I guess what i'm asking is

chipp203 - July 22, 2008 - 04:26

I guess what i'm asking is what code could i use in my regions to extract say the first 4 nodes for page 1....bearing in mind that i would need nodes 21-24 for the 2nd page in that same area.

There is more than one way

nevets - July 22, 2008 - 04:43

There is more than one way to do what you want. Lets start by assuming the nodes are in $items. You could them split them into three arrays something like this

$top_left = array_split($items, 0, 4);
$top_right = array_split($items, 4, 4);
$bottom = array_split($items, 8);

Note that actual code should probably include error checking (what if there a 3, 7, etc nodes?)

Also note the code does not care if is displaying the first, second or Nth page. It just gets a list of nodes.

You can then loop through each of the three sub arrays outputting the needed html.

I'm still at a loss.... Does

chipp203 - July 22, 2008 - 04:13

I'm still at a loss....

Does anyone know how I can replicate this style layout for drupal:

http://www.forever21.com/category.asp?catalog_name=FOREVER21&category_na...

Going out of my mind!!

Any other ideas....anyone?

chipp203 - July 22, 2008 - 19:35

Any other ideas....anyone?

 
 

Drupal is a registered trademark of Dries Buytaert.