Keyword

how to use image place holder for module template override

  • Loai Ahmed
  • Loai Ahmed's Avatar Topic Author
  • Offline
  • New Member
More
3 weeks 3 days ago #178689 by Loai Ahmed
Hi,
I hope you all are doing well.
I am trying to use this piece of code in a module that retrun filtered k2 items
<?php
                    //Create placeholder items images
                            $src = $item->image;
                    if (!empty( $src)) {                                
                        $thumb_img = '<img src="'.$src.'" alt="'.$item->title.'" />';
                    } else if ($is_placehold) {                    
                        $thumb_img = yt_placehold($placehold_size['listing'],$item->title,$item->title);
                    }    
                    echo $thumb_img;
                ?>
But it is not rendering any thing, the items has no image so the if statment shouold go to the placeholder part of the code, but seems not working, I doubt the function for the place holder is no called, what should I do?

Thank you all.

Please Log in or Create an account to join the conversation.

  • Fotis
  • Fotis's Avatar
  • Offline
  • Administrator
  • JoomlaWorks Support Team
More
3 weeks 3 days ago #178691 by Fotis
You merely copied code from some other module. If there is no reference to the used functions like (yt_placehold) or custom variables like ($is_placehold), this will not work as-is.

Ask for assistance where you got that module.

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

Please Log in or Create an account to join the conversation.

  • Loai Ahmed
  • Loai Ahmed's Avatar Topic Author
  • Offline
  • New Member
More
3 weeks 3 days ago #178692 by Loai Ahmed
Got it sorted, thank you for your kind reply.

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum