Hi all, I'm developing a small module that adds some meta-tags to the item pages. So far I've managed to generate the tags that contain the item's url, title, description, address, price, etc. (thanks to $class_tpl->get_template_vars(..) ), but I'm struggling a bit with the images. What I need is to get the urls of the item's images (fullsize, no thumbnails). Any help would be mucho appreciated! Greets --Pierre
It's the same as the thumbs except it's "photos" instead. (e.g. yoursite.com/photos/) Also the full images don't have the "small_" prefix as the thumbnails have. If you open the "viewlisting(2).tpl" file you can clearly see the url for both the thumbnail images as well as the url for the full images.
A few things that may help you in this matter, Pierre: Module development documentation: Modules documentaion Modulehooks documentation The viewlistings.php file has a modulehook around line #117: $modules->call_hook('viewlisting_end', $listing_rs); // Call any module functions The layout.tpl file has this modulehook in the <head>element for every page: {modulehook function="tpl_layout_head" options=""} If it were me, I would work with the hook in the viewlistings as it would be much more straight forward. In this particular case something like this: PHP: function logbe_metadata($listing_rs) { $i = 0; $max = count($listing_rs['data']); foreach ($listing_rs['data'] as $pic) { logbee_meta_array[$i]['title'] = '<meta blah, blah, blah...' .$listing_rs['data'][$i]['title']. '/>'; ... do more stuff ... ++$i; } $class_tpl->assign('lb_meta', $logbee_meta_array);} Then in your instructions, tell the user to insert "{$lb_meta}" in the <head> element of their main template file, "layout.tpl".
Also as a side note for development, although the smarty "get_template_vars()" is a great feature, it also adds additional processing for variables that have already been processed and available through our modulehook system. So, always check if the variables are already available in the modulehooks and use the smarty "get_template_vars()" when unavailable. Your users will appreciate it especially on a busy site.
Great, thanks a lot for the help! I took my inspiration from the 'canonical' module, but will go back to my keyboard...
Ok, I think the module's ready. I tried to access http://classifiedmods.com, but couldn't log in. How should I proceed in order to make my module publicly available?