Jump to content

Recommended Posts

Posted

HI,

   I am using FieldtypeImageExtra module. I have one imagextra field. But it is not getting displayed in front end. Please guide me how to display it.

If i make it as image field, description, tags are getting displayed in front end. I want to add and display extra field.

Regards,

Pravin

Posted

How do you added this extra field?

And what is the code you're using in frontend to display it?

Hi,

  I have added field type as ImageExtra. I want know how to call fields i.e description, credits and tags.

Currently i have added code like this

foreach( $page->photo_album as $img ){

                            $img = $img->size(575, 385);

                        echo "<li data-thumb='$img->url' data-alt='$img->description'><a id='toTop' href='#' class='topopup'><img class='slide' src='{$img->url}' alt='$img->description'></a></li>";                        

            

                        echo $page->credits;

                        }

but credits field is not displaying. description is displaying.

Regards,

Pravin

Posted

Don't understand it completely but you display images descriptions of an image field with multiple images like this:

<?php 
// get the images (if your image field is called "images")
$images = $page->images;

// do a foreach loop to display each image
foreach($images as $image) {
	// now you can use all of the image's attributes like description
	echo $image->description;

	// or the url
	echo $image->url;
}
  • Like 1
Posted

Don't understand it completely but you display images descriptions of an image field with multiple images like this:

<?php 
// get the images (if your image field is called "images")
$images = $page->images;

// do a foreach loop to display each image
foreach($images as $image) {
	// now you can use all of the image's attributes like description
	echo $image->description;

	// or the url
	echo $image->url;
}

Hi Nico Knoll,

 Thanx for quick reply.

I have added FieldtypeImageExtra module. It gives me extra field other than description and tags and it is labelled as Credits. Database entry shows its name as credits. I can view this field below image. I want to display this field in front end just like displaying Description and Tags.

Regards,

Pravin

Posted

Nico has already shown you an example :-)....Have you tried echoing out the 'credits' field in the normal PW way? i.e. inside the foreach in Nico's example...

echo $image->credits
Posted

You have to put it in the loop of course:

<?php 
// get the images (if your image field is called "images")
$images = $page->images;

foreach($images as $image) {
	echo $image->credits;
}
  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...