By Sewdn on
Hi,
I have a basic Drupal question; at least i *think* it's trivial...
What I want to do:
I want to use tooltips in certain blocks, that show teaser-lists of my nodes.
In these blocks i use a view that only shows the thumbnail of the node.
In the tooltips i want to show the title, description and author of the node.
For being able to use the title and other properties of my node, I need to include these fields in the construction of my view.
But the standard way of showing these fields is to include the field in its own div.
Instead i want to use these fields to construct the 'title' attribute of the img field...
How to do this in Drupal (5.x)?
Thanks a lot!
Greetings, Pieter
Comments
Over ride the views output
Over ride the views output by themeimg the view: http://drupal.org/node/128741 for a primer.
You can modify the html in the views-list-my_view.tpl.php file anyway you want (including removing all the labels...).
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.
Thanks! This tutorial put me
Thanks!
This tutorial put me in the right direction.
I have another related question though... how to construct the node's link in these custom views?
In my previous node-list-block, every item in the list links to the page that displays the entire node. But i don't find how to construct these links in my custom themed view.
I tried to 'attach' the path to the node, by adding the field 'node: Link to node' and 'node:view link', but both don't seem to be included in the 'node'-object $node.
I also tried to construct the path manually by concatenating: base_path(), the section that the node was categorized in and the name of the node.
But i can't seem to find the actual name of my nodes (i have the id, and i have the title, but the name is contructed by the path module, to have nice readable urls).
How to find the path to my nodes?
Thanks
Ok, as far as I can
Ok, as far as I can remember, node: view link is a way of having a customized "Read more" type of message where you place some text (e.g. "Read more...") in the Options field.
Why cant you just use node: title as link?
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.
I want to link to the node
I want to link to the node when a user clicks on the thumbnail.
I need the path tho the actual page of the node to construct the link.
The site i'm talking about:
http://www.elsibel.com
the link of a node:
http://www.elsibel.com/post/see/revolutionaire-gadgets
so the path is constructed as follows:
- post
- section the node was posted in
- the name of the node (using the pathauto module)
I can't seem to retreive the complete path from the $node object
I can't construct the path, because i can't find the name of the node, that pathauto provided for the node...
What image modules are you
What image modules are you using? Isnt there an image formatter with link? For example, if you are using imagefield and imagecache normally theres a formatter with and without link for each imagecache preset, I would think the same goes for Image module derivatives also?
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.
I use imagecache. And i use
I use imagecache. And i use the 'with link' formatter, but since i constructed the node from scratch in a custom (themed) phptemplate function, i don't know how to access the link that is used by the default handler for the thumbnail 'constructor'.
This is the code i used to format the node (as a list view):