Skip to main content
Tweeted twitter.com/StackDrupal/status/735827978370846720
Remove noise
Source Link
Pierre.Vriens
  • 36k
  • 40
  • 50
  • 182

I am very new to Drupal and this is my first post in this community. What I am trying to achieve I know may be very simple but just don't know how! So I am looking forward for expert help.

First please see the screenshot:

enter image description here

Below is what I want to achieve:

  1. WHITE boxes are laid out as float: left;

  2. I want A, B and C to shift below their respective titles, i.e. at A1, B1 and C1 spots respectively.

  3. I want to make the TITLE + A1 to be under the same container so the container can float left itself. Same with TITLE + B1 and TITLE + C1

I copied views-view-unformatted.tpl.php file to my custom theme folder. The code snippet is rendering the data fine:

` $row): ?> <div>

`

But I want each of the field in $row to be printed in a way I want, e.g.:

` $row): ?> <div> title ?>
body ?>

`

I believe there is a way to do it but don't know how. $row->title or $row->body is actually printing (rendering) nothing.

Also, if I modify views-view-unformatted-tpl.php it will affect the entire site. So I want a separate view for this purpose. How to do this?

Somebody please help with the above!

Thanks in advance.

I am very new to Drupal and this is my first post in this community. What I am trying to achieve I know may be very simple but just don't know how! So I am looking forward for expert help.

First please see the screenshot:

enter image description here

Below is what I want to achieve:

  1. WHITE boxes are laid out as float: left;

  2. I want A, B and C to shift below their respective titles, i.e. at A1, B1 and C1 spots respectively.

  3. I want to make the TITLE + A1 to be under the same container so the container can float left itself. Same with TITLE + B1 and TITLE + C1

I copied views-view-unformatted.tpl.php file to my custom theme folder. The code snippet is rendering the data fine:

` $row): ?> <div>

`

But I want each of the field in $row to be printed in a way I want, e.g.:

` $row): ?> <div> title ?>
body ?>

`

I believe there is a way to do it but don't know how. $row->title or $row->body is actually printing (rendering) nothing.

Also, if I modify views-view-unformatted-tpl.php it will affect the entire site. So I want a separate view for this purpose. How to do this?

Somebody please help with the above!

Thanks in advance.

I am very new to Drupal and this is my first post in this community. What I am trying to achieve I know may be very simple but just don't know how! So I am looking forward for expert help.

First please see the screenshot:

enter image description here

Below is what I want to achieve:

  1. WHITE boxes are laid out as float: left;

  2. I want A, B and C to shift below their respective titles, i.e. at A1, B1 and C1 spots respectively.

  3. I want to make the TITLE + A1 to be under the same container so the container can float left itself. Same with TITLE + B1 and TITLE + C1

I copied views-view-unformatted.tpl.php file to my custom theme folder. The code snippet is rendering the data fine:

` $row): ?> <div>

`

But I want each of the field in $row to be printed in a way I want, e.g.:

` $row): ?> <div> title ?>
body ?>

`

I believe there is a way to do it but don't know how. $row->title or $row->body is actually printing (rendering) nothing.

Also, if I modify views-view-unformatted-tpl.php it will affect the entire site. So I want a separate view for this purpose. How to do this?

edited tags
Link
No Sssweat
  • 31.6k
  • 14
  • 55
  • 91
Source Link

How to modify HTML layout inside a View template

I am very new to Drupal and this is my first post in this community. What I am trying to achieve I know may be very simple but just don't know how! So I am looking forward for expert help.

First please see the screenshot:

enter image description here

Below is what I want to achieve:

  1. WHITE boxes are laid out as float: left;

  2. I want A, B and C to shift below their respective titles, i.e. at A1, B1 and C1 spots respectively.

  3. I want to make the TITLE + A1 to be under the same container so the container can float left itself. Same with TITLE + B1 and TITLE + C1

I copied views-view-unformatted.tpl.php file to my custom theme folder. The code snippet is rendering the data fine:

` $row): ?> <div>

`

But I want each of the field in $row to be printed in a way I want, e.g.:

` $row): ?> <div> title ?>
body ?>

`

I believe there is a way to do it but don't know how. $row->title or $row->body is actually printing (rendering) nothing.

Also, if I modify views-view-unformatted-tpl.php it will affect the entire site. So I want a separate view for this purpose. How to do this?

Somebody please help with the above!

Thanks in advance.