By havran on
Hi,
I need render teasers of nodes side by side on one row like this:
<div class="row">
<div class="teaser left">node teaser</div>
<div class="teaser right">node teaser</div>
<div class="cleaner"></div>
</div>
I have implemented hook_view() with node counter on my module , and on my theme i have odd and even counter for left/right class... This is working ok but i have problem if i have only odd number of nodes on page - i need append last (empty) right teaser after last odd teaser and close opened div. How to i can detect last node?
Thanks for advice.
Comments
Re: Render teasers of nodes side by side on one row - solution
Ok, i have found solution hard way (trial and error). I have dig two functions from taxonomy.module and one function from archive.module, rename, slightly modify and override taxonomy/term menu (and archive menu) in mymodule_menu() hook...
from taxonomy module:
taxonomy_render_nodes() and taxonomy_term_page()
on taxonomy/term menu i change callback to mymodule_taxonomy_term_page() function (modified taxonomy_term_page) (same for archive menu callback) and insert odd/even program logic into mymodule_taxonomy_render_nodes() function
Template look like this:
Maybe this example help someone. Maybe is there better way for do this but i have found this way :).
Thanks for DRUPAL!
--
My first drupal site - http://www.enigma.sk/kope-vas-muza/ (now developing)
--
My site - Svoji.SK
My first Drupal site - http://www.enigma.sk/
Hi, Is there a module for
Hi, Is there a module for this?
greetings, Martijn