Subarticles and print icon configuration

In version 4.3.2 we removed "Show subarticles" and "Show tool icons" checkboxes from the section editor. These settings were part of old PHP-based templates being not compatible with Saurus API templates.

Since they were widely used here is a sample how to create custom configuration form in the content template in case you want to continue using them.

Custom configuration form

{* Configuration form for the site editors *}

{if $in_editor}
   {* save data *}
   {if $smarty.get.save}        
       {custom_conf_save id=$id show_subarticles=$smarty.get.show_subarticles}
       {custom_conf_save id=$id show_printicon=$smarty.get.show_printicon}
   {/if}
   {* load data *}
   {custom_conf_load id=$id name="tpl_conf"}
   {assign var="show_subarticles" value=$tpl_conf.show_subarticles}
   {assign var="show_printicon" value=$tpl_conf.show_printicon}

   <fieldset>
    <legend>Settings</legend>

    <form name="custom_conf_vars" action="{$self}" method="GET">
    <input type="hidden" name="save" value="1">
        <input type="hidden" name="id" value="{$id}">

    {* if settings not set yet then search for old ver3 values *}
    {if ! $tpl_conf }
        {assign var="show_subarticles" value=$current_obj->all.on_alamartiklid}
        {assign var="show_printicon" value=$current_obj->all.on_printlink}
    {/if}
    <table cellpadding="2" cellspacing="2">
            <tr>
        {* show subarticles *}

                <td width="20px">
                  <input type="checkbox" id="show_subarticles" name="show_subarticles" value=1 {if $show_subarticles} checked{/if}>
                </td>
                <td nowrap><label for="show_subarticles">{sysword word="Naita alamartiklid"  type="editor"}</label></td>

        {* show print icon *}

                <td width="20px">
                  <input type="checkbox" id="show_printicon" name="show_printicon" value=1 {if $show_printicon} checked{/if}>
                </td>
                <td nowrap><label for="show_printicon">{sysword word="Naita prindi ikoon" type="editor"}</label></td>

        <td><input type="submit" value="Save"></td>
          </tr>
            </table>
   </form>
  </fieldset>
{/if}

{* Use configuration data in public view *}
{custom_conf_load id=$id name="tpl_conf"}

Using configuration variable in the template

{if $tpl_conf.show_subarticles}
{.. print subarticles code ...}
{/if}