EZ-Pages sidebox

Customizing the Important Links sidebox

Three sideboxes show links to internal content:

To get a link to a specific page into the this sidebox, go to Tools > EZ-Pages, and edit the page you want to add. Look at the settings for Sidebox (between Header and Footer).

For the page to show up in the EZ-Pages sidebox, the Sidebox radio button must be set to Yes and the sort order must be greater than 0.

We create the override file includes/templates/YOURTEMPLATE/sideboxes/tpl_ezpages.php.

Right before the list end

  $content  .= '</ul>' . "\n";

we add the link:

    $content .= '<li><a href="https://www.zen-cart.com/" target="_blank" rel="noreferrer noopener">The Greatest Shopping Cart Ever!</a></li>' . "\n" ;

How do I add text to the EZ-Page Sidebox?

To insert the text, we firstly create some override files. If it doesn’t already exist, create the following directory

includes/templates/YOURTEMPLATE/sideboxes

and copy includes/templates/template_default/sideboxes/tpl_ezpages.php
into it. Similarly, if they don’t already exist, create an

includes/languages/YOURLANGUAGE/extra_definitions/YOURTEMPLATE

directory for each language you are using and copy includes/languages/YOURLANGUAGE/extra_definitions/ez_pages_definitions.php into them.

Now let’s create the text for insertion. Open each of the ez_pages_definitions.php files that you just created and insert the following define statement in the appropriate language

define('BOX_TEXT_EZPAGES', 'The text you want to insert into your EZ-Pages sidebox');

This doesn’t have to be plain text. If you wish, it can be any string of HTML.

Next we tell the EZ-Page sidebox to use the text. Open the copy that you made of tpl_ezpages.php and insert the line marked below

 $content = "";  
 $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';  
 $content .= BOX_TEXT_EZPAGES;  <font color="#ff0000"><----- this is the line that you insert</font>  
 $content  .= "\n" . '<ul style="margin: 0; padding: 0; list-style-type: none;">' . "\n";

Finally, upload the new files to your server and check the results in your browser.




Still have questions? No problem! Just head over to the Zen Cart support forum and ask there in the appropriate subforum. In your post, please include your Zen Cart and PHP versions, and a link to your site.

Is there an error or omission on this page? Please post to General Questions on the support forum. Or, if you'd like to open a pull request, just review the guidelines and get started. You can even PR right here.
Last modified September 4, 2020 by Scott C Wilson (9e8cba3b).