Support Forum
I'm at a bit of a loss figuring out how to use the template functions. I see that a lot of the plugins require special coding for placement etc, but I'm new to this and really don't know how everything fits together. The codex doesn't seem to have that info in it yet. If someone could point me in the right direction, I would really appreciate it.
Thanks!
You tend to find that plugin calls already exist in the templates even if the plugin isn't installed. For example you will see all the basic forum functions, and then you will see 'if (function_exists'('sp_PluginName'))'
So you don't need to manually add each plugin in to the templates, the themes are designed with the plugins in mind.
As to customising a function, if you type the function name into the Codex search, it will give you a list of arguments to configure it how you want it to behave.
If you are more specific, we can be more specific!
Ok, to be more specific, it's the use of the template tags that confuse me. Let's say I want to use the "Answers Topic" plugin. The plugin instructions says I need the special templates functions to be installed, which I have done. Further down it gives an example of where to put it. But to put it elsewhere it looks like I need to delve in the arguments, actions and hooks....which is all new to me, so it looks like I need to do some homework to understand it all....? So, as I said, if you could point me in the right direction to figure out how to understand, use and manipulate all of these things, I'd appreciate it.
Thanks!
Working from the 'Default' theme for example, if you open sp-resources/forum-themes/default/templates - then you have a template for every section of the forum. Open spTopicView.php - this template controls the layout and functionality of the topic page where the Answers Topic function is used.
If you have an editor capable of laying stuff out sensibly, scroll down to about line 172 and you should see the functions required for 'Answers Topic'
If you are referring to this codex article then the page does need updating as it is marked, so the information is not 100% current - but you have lost me when you say you have installed the template functions. It does clearly state 'If using any supplied themes from Version: 1.2.2 or newer the functions have been included for you' - so you shouldn't need to add anything, as I mentioned 'Default' themes topic view template and where to find that specific function. It might be worth making sure you have not doubled up by installing this yourself somewhere else.
As for manipulating the function to behave how you want it to, firstly find the function you wish to edit, copy the function name, for example 'sp_AnswersTopicAnswer' and paste it into the Codex search. Click the function and you will see a list of arguments that can be applied directly after the function in the template - examples are given on the Codex.
The Answers Topic function is a bit of a complicated one to start with however! Mostly the arguments involve CSS class names so there is not a huge amount you can do with it and it has a few different function calls for different stages of its use.
1 Guest(s)