PDA

View Full Version : Image does not show in article and gallery pages


mondingnibai
03-20-2015, 01:07 AM
I successfully created a plug-in. I have also a template called show_image, this show image is located below the navbar. I want to show a image right here, so I create a plug-in and call the variable I declare in the show_image. It works, but in the article page and gallery page does not. what would be the problem here?

Here's the plug_in code:

ob_start();

include('image.php');
$my_image = ob_get_contents();
ob_end_clean();

vB_template:: preRegister('show_image', array('my_image' => $my_image ));

Lynne
03-20-2015, 04:13 PM
What hook location are you using? If you go into debug mode and go to the articles or gallery page, see if that hook location is even called on those pages.

mondingnibai
03-21-2015, 12:12 AM
What hook location are you using? If you go into debug mode and go to the articles or gallery page, see if that hook location is even called on those pages.

Yupz those pages or templates are called.I am using the global_start hook location.

cellarius
03-21-2015, 06:05 AM
global_start is not present in CMS. Try using parse_template or one of the global_bootstrap hooks.

Lynne
03-21-2015, 05:15 PM
Yupz those pages or templates are called.I am using the global_start hook location.
As Cellarius stated, the global_start hook is not present on the CMS pages. You need to look at the list of "Hooks Called", not under the list of "Included Files".

mondingnibai
03-26-2015, 01:09 AM
Thank to both of you @cellarius and @lynne. I much appreciated your time for giving me some tips. Thanks Guyz.
@lynne your right so I check the hook called and its working fine now.