Using Configuration Sets - Exemplified with the Function „PrintCategoryTre
In the previous chapter you already got to know the function „PrintCategoryTree“ and used it to generate a menu tree of the categories. The function „PrintCategoryTrees“ provides different parameters through the use of a configuration set.
Select the configuration set icon. As usual in the Portalsuite, you find a list of all configuration sets on the left which should still be empty, and the edit-mode in the middle. Apply a new configuration set. You have to define for which template functions you want to apply the configuration set already during appliance. Select the function „PrintCategoryTree“ from the dropdown bar. As you can see, there are configuration sets for several other functions.
The following edit-dialog appears in the middle:
Now you see all settings, parameters and their configuration clear arranged in the form. Important is: The configuration values are stored under a name in the data base. You will need this name later in order to set up the link to this configuration set in the templates. This gives also the possibility to apply different configuration sets for a template function under different names. Just enter „test“ as name.
The several parameters have reasonable default values. Those are the default values we used in the previous tests when we were working without configuration sets.
In order to test the effect we change the „Number of sublevels“ to 2. Afterwards save the configuration set.
Please change the test template as follows, so that the configuration set is actually used:
Template test template:
{TemplateInclude name="HTMLHead"}
<table border=1><tr><td valign=top>
<? PrintCategoryTree ("test"); ?>
</td><td valign=top>
<p class=Text>
This is a test template.<br>
Current: <? echo (date ("d.m.Y")); ?>
</p><br>
<? PrintCategoryArticles (); ?>
</td></tr></table>
</body>
</html>
Therewith we refer to the configuration set named „test“ we just applied when calling the PrintCategoryTree function. When you now call the preview, the third sublevel of the category tree should not be indicated anymore. Ergo the parameter regarding the „Number of sublevels“ is effective: Only the first and the second level is shown.
Edit the configuration set „test“ and alter the dropdown of the „link“ from „Yes“ to „No“. Afterwards call the preview again. Now the menu should not be working anymore since the link to the categories has been reversed through the altered parameter.
Also try the parameter „Show Hidden Categories“ (of course you have to define some categories as hidden in order to observe the effect) as well as the other parameters like sorting etc. Solely you should keep off from the micro template settings for now since we will cater to them separate and in detail in the following chapter.
Alterations at the configuration set affect straight so that alterations at the template are inapplicable. Therewith also non-programmers without template knowledge are able to change configurations and to define several settings.
Also the functionality of the other template function’s configuration sets follows the same principle: Apply configuration set under a name, set parameters and refer to the name of the configuration set with the first parameter of the Portalsuite functions. The meaning of the several parameters is described elaborately and documented in the online-help as well as in the template reference.
Continue to recommend this article:
|