creating a gallery

Hi, all

I’m trying to create a gallery, but need to change the php code a little for it to work. Ive done java programming 5 years ago so Im a little out of practice! But not much php.

I need to change the name (gallery is your content type machine name) when I looked in drupal its called field_image_gallery but where do I change this in the code below?

[php]

<?php $imgcount = count($node->field_img['und']); for ($i = 0; $i < $imgcount; $i++) { $image_uri = $node->field_img['und'][$i]['uri']; // url $masthead_raw = image_style_url('gallery-thumb', $image_uri); ?>
  <a href="<?php print file_create_url($node->field_img['und'][$i]['uri']); ?>" rel="group-<?php print $node->nid; ?>" class="fancybox">
    <img class="image<?php print ($i + 1);?>" src="<?php print $masthead_raw; ?>" />
  </a>
<?php } ?>
[/php]

Hi, welcome to the forum. ;D

The code you supply creates a list of thumbnails with clickable links to change the image.
I’m not quite sure i understand the question, I think you want to rename the whole gallery, the code for that is not included here.

Red :wink:

Hi, Redscouse

Thank you for your intro to me, its Nice to be here!

I’ve managed to fig it myself now but thank you for trying to help me out on this problem.

The code is correct I just needed it to point to the right place. I did this by changeing the name on the code where it says field_img

Thanks

p.s how do i say its resolves on here? :wink:

Cool, I’m glad you figured it out :wink:

as for marking, it looks like someone has already marked it as solved.
Red :wink:

Sponsor our Newsletter | Privacy Policy | Terms of Service