User Tools

Site Tools


Sidebar

tutorials:design_adv:add_help_boxes

Add More Help Boxes

<tip c h>Note: Due to a bug in Smarty 3.1.8 which was packaged with previous releases, these instructions may not work correctly in older versions of the software.</tip>

This tutorial will describe one way to add more "help boxes", like you have on the listing placement process, by re-purposing one of the extra pages as a page to show help contents.

<tip c w>Warning: This is an advanced tutorial, involving making changes to template files.

Before attempting to make changes as described here, be sure you have a firm grasp of the basics. </tip>

  1. In your admin, go to Design > Manager and in your template set, inside the main_page section, create a new folder help_pages. The full path will be something similar to my_templates/main_page/help_pages/.<
  2. Go into this folder, and create a new template named test.tpl. Edit the new file and add something like "Test help!", later you will be adding more contents.<
  3. Now navigate to main_page/extra_pages/ and create a new template help_pages.tpl.<
  4. Edit the new help_pages.tpl file, and make sure you are on the <..> Source Code Editor tab. For the contents, enter the following:
{capture assign='explanation'}
{include file="help_pages/{$smarty.get.help|escape:'url'}.tpl"}
{/capture}
{include file='help_popup.tpl' g_type='system' g_resource='other'}

<

  1. In admin, go to Design > Page Attachments choose one of the extra pages you are not using, in this tutorial we will use extra page 17 as the example. Click edit next to the extra page.<
  2. For the Default Template, select extra_pages/help_pages.tpl and save the changes. Note that the sub-template attachment does not matter as it will not be using a sub-template in this case. <
  3. In admin, go to Pages Management > Extra Pages and click edit for the extra page you chose before.<
  4. For the Admin Note, enter Help Pages and save changes, so that you can easily remember which extra page is being used for the help pages.<
  5. On that same page, make note of the link to the extra page, everything starting with the index.php part, you will be using it later. It will be something like index.php?a=28&b=151.<
  6. Now the basics are all set up, it is time to try it out. You will need to use one of the extra pages as a test page. If you still have another extra page not used, it will have the default template attachment extra_pages/additional_page.tpl, so we will use that as the test page.<
  7. In admin go to Design > Manager and edit the template extra_pages/additional_page.tpl. At the top of the template, add this:
<a href="index.php?a=28&amp;b=151&amp;help=test" class="lightUpLink" onclick="return false;">
<img src="{external file='images/help.gif'}" alt="help" />
</a>

If you used a different extra page than 17, change the b= part to match the link for your own extra page.<

  1. Save changes, then view one of the extra pages that still uses that template, such as extra page 18. It should have a help icon that when clicked, should show the help lightbox with text "Test Help!". If it does, then you did everything correctly, continue on for how to start using this. If not make sure you followed all the instructions above. <
  2. To create new help contents, in admin at Design > Manager, simply create new templates in the folder you created help_pages/. Then use the same code that worked for the test, but at the end of the link where it has help=test, replace "test" with the template name, minus the end .tpl. For instance if you create a template file help_pages/how_to_dance.tpl, the URL you would use would be index.php?a=28&amp;b=151&amp;help=how_to_dance.<
  3. Note that if you specify an invalid value for the help= (for instance if the file does not exist), it will show a template error. <
  4. Also note that the templates you create in the help_pages/ folder should not try to use modules or addon tags, as any attachments in that template will not be loaded due to how it dynamically includes that template. <
tutorials/design_adv/add_help_boxes.txt · Last modified: 2014/09/25 16:55 (external edit)