3

Is there a way of making front-page containing 2 views, without using panels module in Drupal 6.x?

thanks

7 Answers7

10

If you don't want to use Panels, you could create the 2 views as blocks (like you can for the side bar etc). Then add then to the centre content and make them only viewable on the front page...

x3ja
  • 928
  • 5
  • 19
  • Ahm, quick question, I have the same dilemma and I already considered your solution, I am very new to Drupal 6 and I wonder how to make it viewable only on the Front page? Should I add it as a filter or I would be configuring on my blocks? Thanks. – Tsukimoto Mitsumasa Aug 27 '12 at 15:43
  • Sorry, I only used Drupal for a short while and it was 3+ years ago now. I think it would be a block configuration thing, but I'm not sure. Maybe ask another question here about how to achieve what you want? – x3ja Aug 28 '12 at 09:28
2

Why not use panels? If you insist, just code it in page-front.tpl.php.

yhager
  • 1,632
  • 15
  • 16
1

views_embed_view is the way to go. You can call any view. You can do it in page-front.tpl.php or in jsut he body if you have PHP Filter enabled.

IvanSF
  • 301
  • 2
  • 8
1

Make one View to a page and make the path to that page the frontpage.

Take the other Views you want added to the frontpage and add them as block and make them only visible on the path to the frontpage.

I've used a solution like that on a Drupal 6 site prior to Panels being stable enough for it to be usable. I also used the Views exclude previous module then to enable me to have multiple lists of the same content without having the same content show up in all of the lists.

VoxPelli
  • 2,697
  • 1
  • 16
  • 22
1

Screw panels and multiple blocks! What's wrong with a nice view attachment? It's native to views (no extra module!!) and super easy!

  1. Create a new Display: Attachment
  2. Configurate it:
    • attach it to [your page display]
    • attach it before or after
  3. Set fields and filters and such, like you'd do with any type of display, or just inherit from your Defaults
  4. That's it! The attachment is loaded before or after the page display automatically without any extra blocks or modules or hassle.

You can give the attachment a header and footer text etc like you can any type of display.

Rudie
  • 52,220
  • 42
  • 131
  • 173
1

You can use the views_embed_view function to embed a view anywhere in your template.

In your case, you can use it in your page-front.tpl.php to display the two views in the front page.

Pierre Buyle
  • 4,883
  • 2
  • 32
  • 31
0

Here is what I did on Drupal 7.x.

The question was for Drupal 6.x, but I guess that most people who will stumble on this page would be using Drupal 7. I am new to Drupal, so I have no idea if this could apply to Drupal 6.

As x3ja menitionned I also used blocks.

I already had my views created for pages. On each view I added a new display with "+ Add" button and selected the "Block" display. Select a name for your block "Some block". Don't forget to save your view ;)

Go to example.com/admin/structure/block and search for the block you have just created. It should be in the "Disabled" section. In the drop down Region menu select "Content". Save. Then search for your block which should be in the "Content" section. Click "configure" in the Operation column. In "Visibility settings > Pages > Show block on specific pages" check "Only the listed pages" and write "".