Template Tuesday & A Pot Pie

Another day with no new contributors. So I have no “shout-out”s to start off tonight’s post with. I see that 68.85% of my visitors return almost daily. That’s pretty good. I’m glad to see people returning, and I hope that you all get something out of reading my blog.  That means the 31.15% are new visitors each day. I wish even 1% of those would make a contribution.  I’ve currently got a Pot Pie in the oven. They are pretty nasty tasting but they are inexpensive and it gives me just about enough time for this post.

Those that are unaware. I posted a new bounty over the weekend.  If you read my last Statistics Saturday post you’ll see it’s worth the bounty.

Ok on to today’s Template Tuesday post.

Today I’m going to talk about Template Hooks. What they are, what they do, and why they are so important. To put it in simple terms a hook is like a place-marker.  It’s an area within the Pligg template files that specifies a specific place. These are all done with predefined Smarty variables. Even though Pligg uses a hybrid of what’s called Template-lite and Smarty. Template-lite is nearly identical.

Hooks are all check actions. Meaning if something = something, then do something. They all stat out the same checkActionsTpl location=

{checkActionsTpl location=”tpl_pligg_body_start”} is located in the pligg.tpl file right after the  <body> tag. So if a module needs to add something directly after the body tag he knows there is a hook there to use.

All modules use these hooks that are throughout the Pligg template system. Some hooks can be inside an element such as a form, others may surround an element. The idea of surrounding an element is that a module then has the ability to completely replace an element if it needs to.

For example. I have a module coming out for Pligg 2 which needs to add something to the title area of a template, however there is no hook available where I need to add something. So I can use a hook above it, and a hook below it, to strip out the entire title code and replace it with my own.

This give a module author great flexibility to create some interesting stuff. In theory 1 module could completely rearrange your site. That is why hooks are very important. There are some 3rd party template designers that don’t add them in, or if they do, they don’t add them to the correct spot. This can make things horrible for a site owner if they install a module that is relying on those hooks to be there.  So just a word of caution about 3rd party template sellers. The ones that have been around and are reputable should be easy to spot by how long they have been around. Here is a list of the base hooks a template is required to have for compatibility.

We actually get people that are mad at us because a module doesn’t work right in their template. 99.9 times out of 100 it’s because the template author didn’t build the template to the basic Pligg template authoring standards. They should be angry with the template author, not the module author.

Here is where people make the mistake. They pick a template on how it looks, not on how it functions. I always tell people to use the default template as a guide, and modify it accordingly to how you want it to look. That way at least you know that the functionality is all going to be  there. If you are unable to modify the default template to your needs, then by all means hire someone to do it.  Don’t be afraid to invest money in your website. Building a good website takes time, money, and patience.  There isn’t any way around that.

Well that’s all I have for today. My Pot Pie is almost finished. A quick break to eat and then it’s back to work.
As always, I hope that you will take a moment to make a contribution. You can see why it’s so important to me, you can get yourself some free stuff , and it also makes you feel all warm and fuzzy inside knowing you helped out a total stranger in need. Try it!

If you wish to give a tangible item, you can always check out the wishlist.

Tune in tomorrow.

~ ChuckRoast

 

 

Help ChuckRoast