Closed (fixed)
Project:
Node Gallery
Version:
6.x-2.0-alpha11
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
18 Dec 2009 at 12:50 UTC
Updated:
13 Nov 2010 at 04:40 UTC
Hi,
I want to display the title of an Image just below it. I've also created a custom text-field called "Pris" which I also want to display below the Image.
How do I do that?
Thanks.
Comments
Comment #1
dbeall commentedHi cholden, You can do what you need by using the node-image-default.tpl.php file from the node_gallery/themes folder.
Rename it to node-node_gallery_image.tpl.php and place it inside your theme's folder with the other tpl.php files
Then customize that file to suit your needs..
such as move this part
down below the content div to look like this
If you don't want it to have a link, just use this part
There is a quick bit in the handbook about this in 'style,views and theming'
http://drupal.org/node/544748#tpl
I did a quick test of a custom field added to the 'galley Image' content type and it displays below the image without doing any customizations.. You do have to edit the gallery relationship and check mark your new field for display.
http://drupal.org/node/544642#configr ,Configuration for Each Gallery Relationship
The handbook does need a few updates as some items are working better now with alpha11.
I will have a closer look at things in the handbook during the next 2 weeks and do some updates.
I am like everyone else, I learn more by helping and this helps the handbook get better to.
If you need some more help with this, please post it here and I will help you get this done..
Comment #2
cholden commentedHi,
Thanks for your reply.
I've tried to follow your instructions, but can't get it to work. It's like the node-node_gallery_image.tpl.php file is ignored (and i have tried to clear the cache).
I've edited the relationship and enabled the new field I created. When i upload new images or edit existing ones the new field appears correctly. But when i view the gallery it doesn't display that filed.
http://grab.by/1hTx
I got the title to display just by removing a "display: none" in css.
http://grab.by/1hTy
Thanks.
Comment #3
dbeall commentedI tested the node-node_gallery_image.tpl.php with garland and goldfish themes, on a local wamp.
So the file was in root/themes/garland/[...tpl/php]. and the goldfish in the site/all/themes/goldfish/
If you have content permissions, the pris field has to be open to view(content type field setting) that is default(i believe).
Comment #4
arturus-1 commentedFor display the title gallery on page images of gallery i have added a code in the file node-image-default.tpl.php
Example here
http://club.shintoptrophy.ru/node/2389
Comment #5
dbeall commentedwell, that is the hard way to do it. But the problem is that when you upgrade the node_gallery module, you will have to edit the file again.
node-image-default.tpl.php file should be copied to the theme folder and renamed to node-node_gallery_image.tpl.php
Comment #6
cholden commentedThere are no changes at all when editing the node-image-default.tpl.php in the modules/node_gallery folder or when I'm duplicating and renaming it to theme-name/node-node_gallery_image.tpl.php
When I view the detailed-view of an image the custom "pris" field displays fine:
http://grab.by/1jPo
But it still doesn't in the image list:
http://grab.by/1jPp
Another problem is that I want the image to pop up in lightbox. It works perfect when clicking the thumbnail, but the title links to the node of the image like this screenshot also shows:
http://grab.by/1jPo
And I dont get what you mean by this:
Thanks.
Comment #7
dbeall commented@cholden, the file needs to be copied to your theme folder.. They are kept in the node_gallery/theme folder for use when you need them. There are 6 available tpl files to use.
if you use a contributed theme, it would be in
sites/all/themes/'theme name'/node-node_gallery_image.tpl.php
if you use a core theme it would be in
themes/'theme name'/node-node_gallery_image.tpl.php
In the content type, there is 'manage fields' and 'display fields' settings, but it is on by default.
You can also set the title 'pris' to display 'inline' with the 'display fields' settings in the content type.
( administer > Content type > Gallery Image > Display fields )
+Also if you use CCK, it has a content permissions module, with field permissions.
( administer > User management > Permissions ) in CCK
The issue with lightbox not working with the title on-click.. not sure how to code that, but an easy work around is to remove the link action from the title..
In this part...
Change it to this..
That way the title will show, but it has no link, which means they have to click the thumbnail which will open lightbox
To get the 'pris' field to show in thumbnail page..It would be in the gallery-image-thumbnail.tpl.php by adding it to your theme folder, then add the field to it. I am sure it's something like..
<div class="field-label"><?php print $title; ?></div>But I don't know what to put in place of $title.. it might be more like..
<div class="field-label"><?php print $field_pris['#value']; ?></div>I am not a cck expert, but the answer is someplace there.. I have to do a little more looking at that part. I have this in my local test install and I am looking for the answer..
Comment #8
dbeall commented@cholden, I probably won't be able to do much this week as I am heading out today to my moms for xmass. her internet connection is crappy. will be back next week for sure.
Comment #9
dddave commentedMmh, this could definitely need some documentation or better yet an easy UI.....
Comment #10
justintime commentedSounds like the original issue was resolved.