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

drewish’s picture

i'm not quite clear what you'd like to do. perhaps you could make up a mockup and post a screen shot.

doc2@drupalfr.org’s picture

Instead 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.

VDG’s picture

This 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.

doc2@drupalfr.org’s picture

Status: Active » Closed (works as designed)

Huge 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.

doc2@drupalfr.org’s picture

1- 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

<?php // 2nd piece of code
print $links;
?>

just above

  <div class="content">
   <?php print $content ?>

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.

doc2@drupalfr.org’s picture

I get a first result, for image content-type nodes, with a node-image.tpl.php file in drupal>themes>*chosentheme*> which full code is:

<?php phptemplate_comment_wrapper(NULL, $node->type); ?>

<div id="node-<?php print $node->nid; ?>" class="node<?php if ($sticky) { print ' sticky'; } ?><?php if (!$status) { print ' node-unpublished'; } ?>">

<?php print $picture ?>

<?php if ($page == 0): ?>
  <h2><a href="<?php print $node_url ?>" title="<?php print $title ?>"><?php print $title ?></a></h2>
<?php endif; ?>

  <?php if ($submitted): ?>
    <span class="submitted"><?php print t('!date — !username', array('!username' => theme('username', $node), '!date' => format_date($node->created))); ?></span>
  <?php endif; ?>

       <div class="content">
// Beginning of CodePiece #4
    <?php if ($links): ?>
      <div class="links"><?php print $links; ?></div>
    <?php endif; ?>
// End of CodePiece #4
    <?php print $content ?>
       </div>

  <div class="clear-block clear">
    <div class="meta">
    <?php if ($taxonomy): ?>
      <div class="terms"><?php print $terms ?></div>
    <?php endif;?>
    </div>

  </div>

</div>

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

doc2@drupalfr.org’s picture

OK, 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.