[support] Blocks and views or coding in page-front.tpl.php
Hi all,
I have a HTML design and I am transferring it into Drupal templates.
There is a table with four cells on the homepage (and on the homepage
only). In each cell there are a maximum of three titles of the most
recent items. Each of the four cells represent a different contenttype.
I created a block with the right content for the first cell, but I got
stuck constructing the table and its content with templates. More
specific, I got stuck on understanding the "display", "row", "style" and
"field" parts of the view section.
Because it took me too long I ended up writing php code in the
page-front.tpl.php file.
Would anyone of you suggest to go and use blocks the way I first tried
it and if so - how?
Thanks in advance for the trouble taken,
Kerpel
Similar Topics
| Topic | Started |
|---|---|
| [support] All images disappeared. image_resize_filter problem? | 3 days 7 hours ago |
| [support] Enabling Clean URLs in 6.19 | 3 days 19 hours ago |
| [support] Stuck Installing Drupal-SQLite | 4 days 17 hours ago |
| [support] including profile edit form on a page... | 5 days 14 hours ago |
| [support] Problem with hook_block on Drupal 6.x | 6 days 10 hours ago |
| [support] Youtube video playing twice | 6 days 13 hours ago |
| [support] Unserializing Data for Use in a View | 6 days 14 hours ago |
| [support] Advice on availability-type module(s) | 1 week 3 hours ago |
| [support] Page navigation | 1 week 15 hours ago |
2 comments
Re: [support] Blocks and views or coding in page-front.tpl.php
Ole,
- Row style: fields
- Style: Unfomatted
- Fields: Sounds like you just want "Node Title" (with the option, "link
to node" checked on).
- Display: click on the dropdown and select "block" and then click "add
display."
I always use Views for this kind of stuff... so much more maintainable than
coding directly on your template.
Don't give up on Views. It's awesome! Definitely takes some getting used to,
because it is so powerful and flexible.
As for placing the view in page-front.tpl.php ...
If your theme had separate regions for that spot like for example Litejazz
or Acquia Marina, then you could use Drupal's block administration to put
the views in the right spots. But it sounds like your theme might not, which
is cool, not a problem.
Check out instructions here for how to directly invoke the placement of a
block into your template:
<a href="http://drupal.org/node/345361#comment-2587878" title="http://drupal.org/node/345361#comment-2587878">http://drupal.org/node/345361#comment-2587878</a>
Shai
Re: [support] Blocks and views or coding in page-front.tpl.php
Shai,
thanks for the great reply. I had the Views part done already but now I need to place it on the right spot. Thanks for the link you sent me. I am sure I will succeed sooner rather than later.
Thanks again!
Kerpel
Ole Kerpel
Developer
Internationaal Instituut voor Sociale Geschiedenis
Postbus 2169
1000 CD Amsterdam
T: 0208500137
E: <a href="mailto: ... at iisg dot nl"> ... at iisg dot nl</a>
<a href="http://www.iisg.nl" title="www.iisg.nl">www.iisg.nl</a>
Ole,
* Row style: fields
* Style: Unfomatted
* Fields: Sounds like you just want "Node Title" (with the option, "link to node" checked on).
* Display: click on the dropdown and select "block" and then click "add display."
I always use Views for this kind of stuff... so much more maintainable than coding directly on your template.
Don't give up on Views. It's awesome! Definitely takes some getting used to, because it is so powerful and flexible.
As for placing the view in page-front.tpl.php ...
If your theme had separate regions for that spot like for example Litejazz or Acquia Marina, then you could use Drupal's block administration to put the views in the right spots. But it sounds like your theme might not, which is cool, not a problem.
Check out instructions here for how to directly invoke the placement of a block into your template:
<a href="http://drupal.org/node/345361#comment-2587878" title="http://drupal.org/node/345361#comment-2587878">http://drupal.org/node/345361#comment-2587878</a>
Shai
Hi all,
I have a HTML design and I am transferring it into Drupal templates. There is a table with four cells on the homepage (and on the homepage only). In each cell there are a maximum of three titles of the most recent items. Each of the four cells represent a different contenttype.
I created a block with the right content for the first cell, but I got stuck constructing the table and its content with templates. More specific, I got stuck on understanding the "display", "row", "style" and "field" parts of the view section.
Because it took me too long I ended up writing php code in the page-front.tpl.php file.
Would anyone of you suggest to go and use blocks the way I first tried it and if so - how?
Thanks in advance for the trouble taken,
Kerpel