peterpp Posted August 1, 2014 Share Posted August 1, 2014 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 Link to comment Share on other sites More sharing options...
Nico Knoll Posted August 1, 2014 Share Posted August 1, 2014 How do you added this extra field? And what is the code you're using in frontend to display it? Link to comment Share on other sites More sharing options...
peterpp Posted August 1, 2014 Author Share Posted August 1, 2014 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 Link to comment Share on other sites More sharing options...
kongondo Posted August 1, 2014 Share Posted August 1, 2014 Hi, I have added field type as ImageExtra. I want know how to call fields i.e description, credits and tags. Regards, Pravin You mean this module by Ryan? https://processwire.com/talk/topic/417-extending-image-field/?p=3351 Link to comment Share on other sites More sharing options...
Nico Knoll Posted August 1, 2014 Share Posted August 1, 2014 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; } 1 Link to comment Share on other sites More sharing options...
peterpp Posted August 1, 2014 Author Share Posted August 1, 2014 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 Link to comment Share on other sites More sharing options...
kongondo Posted August 1, 2014 Share Posted August 1, 2014 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 Link to comment Share on other sites More sharing options...
peterpp Posted August 1, 2014 Author Share Posted August 1, 2014 Thanx Kongodo for the quick reply. I tried your solution but no luck. It doesn't show on front end. Regards, Pravin Link to comment Share on other sites More sharing options...
Nico Knoll Posted August 1, 2014 Share Posted August 1, 2014 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; } 1 Link to comment Share on other sites More sharing options...
peterpp Posted August 1, 2014 Author Share Posted August 1, 2014 HI all, Thanx for your help. It worked for me now. Regards, Pravin Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now