Managed text blocks
This chapter explains how to create small manageable blocks of text where you don't need drag & drop
1 STEP - create parameter
- Log in to administration panel
- Open tab Developer -> Modules config
- Select "Configuration" on the left
- Press yellow icon near "Translations" on the right (you can create new group for your parameters also)
Here you see default parameter "copyright" and maybe some other parameters of your theme. You need to create new parameter. Press "New record" and insert data for your new parameter:
- Name - any name you like
- Key - unique identifier without special characters of spaces (will be used in PHP code)
- Value - select type of parameter. Usually "wysiwyg languages". "Languages" means that it will have different values for each language. Next to this field will appear appropriate value field. Enter required text.
- Admin - leave unchecked. Checking this box means that this parameter can be managed only in Developer -> Configuration tab. Leaving it unchecked enables management from Standard -> Configuration.
Press "Save".
Display parameter on the website
Open layout file in your theme (eg. ip_themes/ip_default/main.php) and add following line where you like the new text to appear:
<?php
//display the value
echo $parametersMod->getValue('standard', 'configuration','translations','parameter_key');
?>
Example
Default theme of ImpressPages CMS uses this technique to display website name:
<?php
echo $parametersMod->getValue('standard', 'configuration', 'main_parameters', 'name');
?>
Write a comment
You must be logged in to comment.