Keyword

how to use image place holder for module template override

  • Loai Ahmed
  • Loai Ahmed's Avatar Topic Author
  • Offline
  • New Member
More
3 years 1 week 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.

More
3 years 1 week ago #178691 by JoomlaWorks
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.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • Loai Ahmed
  • Loai Ahmed's Avatar Topic Author
  • Offline
  • New Member
More
3 years 1 week 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