Hi there,

I have created a page using views. I have been able to theme it pretty much as I wanted. Now, I would like to include some banners in between some content, like:

node1
->banner1
node2
node3
->banner2
...

If I edit the view template to add the banners, it will appear under every single node, and it will be the same banner everytime (always "banner1").

How can I add this banners in an easy way to be managed?

Comments

matt_harrold’s picture

You could use Views Custom Field and a little PHP code to select the right banner or skip it entirely if not needed on a particular node.

  /// please don't expect this code to work, it is "ball park", but untested ...

  switch($data->nid){
    case 1: //node 1

    print 'put first banner here';
    break;
    
    case 3: // node 3

    print 'put second banner here';
    break;

    default:
    // do nothing
 }