Closed (works as designed)
Project:
Image
Version:
5.x-1.3
Component:
image.module
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
11 Jul 2007 at 15:38 UTC
Updated:
11 Feb 2008 at 17:39 UTC
Hello and thanx for this great module and to every active developper!
I'd like to display the Image size links into the node $content div instead of its $links div. Precisely, just above the "Full node image".
Any idea? Many thanks in advance. Arsène
As a newbie in php (well, I still manage to patch and contribute some modules and have them working properly) I just tried to replace the $links by $content in the image.module, but nothing changed...
Comments
Comment #1
drewish commentedi'm not quite clear what you'd like to do. perhaps you could make up a mockup and post a screen shot.
Comment #2
doc2@drupalfr.org commentedInstead of this http://arsene.richard.free.fr/ged/image/image-links-before.png
I'd like something like this http://arsene.richard.free.fr/ged/image/image-links-after.jpg
It could be great if:
- these links could behave as field values, so that they could be weighted, labelled, etc...
- css/alt text or some other mark up could tell wether the link will open in the same window or another.
- By the way, I've updated to v.1.4 and it does work well.
- I've always had issues with the autosave.module , so I disabled it.
Comment #3
VDG commentedThis is merely a theming issue. Go to "yoursite_base_directory/themes/yoursite_theme/". Copy the file "node.tpl.php" to "node-image.tpl.php". Everything you change there will only be reflected in nodes of type "image". If you now temporarily put
print_r($node->links);in this file, you get an array with all link-items that get processed by
print $links;Use what you need on the place you want (don't forget to use l() or check_url(url()) for links), then remove the
print $links;Example:
print l($node->links['image_size_thumbnail']['title'], $node->links['image_size_thumbnail']['href'], _array_with_your_attributes_or_NULL_, $node->links['image_size_thumbnail']['query']);There might be better ways, but this should get you up and running pretty fast.
Comment #4
doc2@drupalfr.org commentedHuge thanks already, as I'm pretty sure this will be a huge step for me!
I may come back here to follow up on this topic.
Comment #5
doc2@drupalfr.org commented1- OK, so for the first piece of code, I get:
http://arsene.richard.free.fr/ged/templating/node-image/CodePiece1.png
2- For the 1st+2nd piece of code:
http://arsene.richard.free.fr/ged/templating/node-image/CodePiece1+2.png
3- For the 1st+2nd+3rd piece of code:
http://arsene.richard.free.fr/ged/templating/node-image/CodePiece1+2+3.png
4- For the 1st+3rd piece of code (2nd removed - other node):
http://arsene.richard.free.fr/ged/templating/node-image/CodePiece1+3.png
3 and 4 return a broken template display. You'll probably find the error quickly.
5- I've tried to put
just above
so that the links would appear just above the -10 weighted images. But it returned me a blank page.
Therefore, I'm not very confident in going on templating. Could you just show me the code I would have to insert above the
<div class="content">?I think that with some practice I'll manage it. I understand how links are coded thanks to your first two pieces of code. I think I'll be able to reproduce this somewhere else.
I have the remaining 2 weeks to finish my DMS, so I won't spend much time on templating from now on. Thank you again anyway for the first clues.
Comment #6
doc2@drupalfr.org commentedI get a first result, for image content-type nodes, with a node-image.tpl.php file in drupal>themes>*chosentheme*> which full code is:
Next step is to individualize the links to display, on one hand, a label for the image size links and, on the other hand, a right-aligned div for the click2bookmark link.
It currently looks like this: http://arsene.richard.free.fr/ged/templating/node-image/CodePiece4.png
Comment #7
doc2@drupalfr.org commentedOK, I think I had server memory limits exceeded / bad settings. And sorry for the previous long and messy posts. I was a n00B!
Instead of templating, you can use the term_display.module to "weight" them. Per nodetype weighting is lacking as well as theming possibilities, but it can already simply do a lot by itself without the need of templating with PHP and so on.