Recent Topics

SkinBeginHtmlBody plugin event?

Started by on Sep 24, 2008 – Contents updated: Sep 24, 2008

Sep 24, 2008 18:42    

Hi everyone

I am wanting to insert something just after the <body> tag of my skin via a plugin so I have started to look at the events that can be triggered. I have found SkinEndHtmlBody but can't find details of the corresponding SkinBeginHtmlBody. Have I just missed something in the docs or does this not exist?

Many thanks
Lee

Sep 25, 2008 11:33

Well, I guess it is a little crude but I can just put the trigger event higher up in the skin to solve the problem...

<body>
<?php
$Plugins->trigger_event('SkinEndHtmlBody');
?>

.......

Sep 25, 2008 11:55

You can actually add a custom trigger to your plugin/skin

skin :

$Plugins->trigger_event( 'my_groovy_event', $params );

Plugin :

	function GetExtraEvents()
	{
		return array(
			'my_groovy_event' => 'some cool descriptive text that\'s only ever seen in source' );
	}

¥

Sep 25, 2008 12:20

Ah, I see now...... Many thanks for your help.

I guess there is a bit of a problem when it comes to skins with this kind of thing as no skin will have the new event in them. I guess this could be a problem for the people who aren't comfortable with editing skin files.

I recently installed the Google analytics plugin and it didn't work out of the box due to the fact that the skin I was using from the skin repository didn't have the trigger event code in for SkinEndHtmlBody. I'm not sure if there is a way around this really other than checking to see if all the skins and all new skins uploaded to the repository have the standard b2evo triggers in them. It would be great to make this process easier for newbies.

Thanks again for your help.
Lee


Form is loading...

Content Mangement System – This forum is powered by b2evolution CMS, a complete engine for your website.