DragonflyCMS Projects > Storez > [fixed] Theme customisation > Community Forums > Phoenix Netology
Forum Index > eCommerce > Storez

[fixed] Theme customisation Reply to topic


I've just installed Storez and decided to customise the layout a little by editing the templates (cos that's what templates are for), and came across an issue that I wonder if you would take into consideration for a future release.

Take the search menu for example.

The template used is search_menu.html. I edited this template and found I was not getting exactly the results I was expecting. On examining the code I see the search menu template is output by this function in includes/functions.php

function search_menu(){ global $storez_config, $cpgtpl; OpenTable(); $cpgtpl->assign_vars(array( 'S_CO_NAME' => $storez_config['companyName'], 'L_SEARCH' => _STOREZ_TEMPLATE_SEARCH, 'L_MAIN' => _STOREZ_TEMPLATE_MAIN, 'L_RANDOM' => _STOREZ_TEMPLATE_RANDOM, 'L_ADVANCED'=> _STOREZ_SEARCH_ADV, 'U_CO_LOGO' => $storez_config['companyLogo'], 'U_SEARCH' => getlink('Storez&file=search'), 'U_ADVANCED'=> getlink('Storez&file=adv_search'), 'U_STOREZ' => getlink('Storez'), 'U_RANDOM' => getlink('Storez&file=random') )); $cpgtpl->set_filenames(array('body' => 'storez/search_menu.html')); $cpgtpl->display('body'); CloseTable(); echo '<br />'; }

The problem is that the function is calling OpenTable() and CloseTable() (which using reDesign3 puts a <div class="table"> wrapper around the output, and it also echo's a <br /> at the end.

I can only change / remove the table div and the line break by editing PHP code, which kinda defeats the point of templates.

This happens in other *_menu() functions as well.

Would you consider putting all output, whether it be a simple line break or anything else, in the templates? I've made the changes I want for now, but if I update the code I'll have to re-edit the PHP.

Please enter your server specs in your user profile! 😢


Thanks - I can have a look and add any changes you require.

When it was setup, it wasn't envisaged that a theme would cause such issues, since OpenTable() et al used to be a standard way of doing things.

Having said that, on one installation I setup as a Bookstore, OpenTable() et al are actually empty and templates are highly customized Smile

I guess it's time I looked at issuing an update, so feel free to suggest changes.

DonationsPro for vBulletin, SMF, MyBB, DragonflyCMS

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


Phoenix wrote
When it was setup, it wasn't envisaged that a theme would cause such issues, since OpenTable() et al used to be a standard way of doing things.


Indeed, I used to wrap everything in OpenTable() as it was a quick way to put content in nice looking boxes, but that was when we were all using tables for layout as well.

Nowadays I try to ensure the template does ALL the work as far as output is concerned, which means no "echo" statements anywhere in code.

If you would just remove the "echo <br />" and add the "<br />" into the template it'd look the same but allow us to adjust the layout completely via templates.

Please enter your server specs in your user profile! 😢

All times are Australia/Adelaide


Jump to: