Hi,

On my front page I have a 'welcome text' box, a 'testimonials' area, and I want the content to be editable separately from the markup because I don't want the user to break the mark up.

What is the simpliest way of doing this? I've looked into panels and panes but it looks like overkill for what I'm doing.

Is it possible to reference a particular node in the php with a template tag type thing?

Thanks

Andy

Comments

bwv’s picture

Have you tried the composite layout module?

awelch’s picture

Hi, I looked into this module.

I was able to take for example my home page and add a couple of additional nodes and blocks to appear in the same page. However, one area, I want to display a list of my testimonials.... So I've got a content type called testimonial and I've made a view with a link of my testimonials (which look like a link and an a short piece of text.

So basically I want to display all the items from that list view into my composite front page layout... so that I can add a jquery jcycle plugin to the list to cycle through the testimonials.

Is it posible to display a view in a composite layout or is that something that needs panels. I didn't get on well with panels. I couldn't get any of the content I attempted to put into the panels to save for some reason. E.g. I choose a layout, added some content to the area and then hit save in required places but it didn't appear to save.

Please direct me to any more documentation that is available on composite layout module.

Thanks

Andy

bwv’s picture

You can embed a view in a node, then put the node in your composite layout. I can verify that this code works in d6:

<?php
$viewName = 'name_of_your_view';
print views_embed_view($viewName);
?>

I provide this information with the disclaimer that it is, from what I understand, not advisable to put php code directly into a page.

You could put the same data into a block, then embed the block in your composite layout, which I think is a more secure method.

awelch’s picture

Hi,

I'm at the stage now where I've got the content I require for the home page

I've got a node of type page called front page and within that is:
a node of type page called welcome text
a view in a block showing a list of testimonials
a view in a block showing commercial theatre productions
a view in a block showing school theatre productions

I'm pleased to get to this stage. Thanks for the help!

I now have quite a lot of unnecessary div tags in my markup

For example I've got nested the following markup:-

bodycontent div
composite div
composite zone div
node 21 div
block view testimonial block 2 div
content div
view testimonial div
view content div
item list div

before I get to my first UL

All I ideally need is:-

bodycontent div
block view testimonial block 2 div
and the UL

Can you point my in the right direction to find out how to reduce some of this mark up?

Thanks

Andy

awelch’s picture

Hi, this can be done by digging into the module code. In fact the composite layout module looks to have templates for each layout template. this is probably stating the obvious.

Cheers

Andy

awelch’s picture

It seems that the views markup is the main culprit. Can you direct me to some support on how to use the views templating system.

This post goes a way to explain some of the argument revolving around the views markup: http://www.mattfarina.com/2009/8/horror-views-markup

I am a advocate of simple markup rather than a lot of ids and classes so I would prefer to add my own if needs be rather than the other way round.

Cheers

Andy

bwv’s picture

In the View you have created, look for a line in the upper part of the Views panel that says "information." I believe that will give you all the data you need on the Views templates.

awelch’s picture

thanks, appreciate your patience

awelch’s picture