Exclusive eBooks, Software Solutions, Quality Guaranteed
 
Web NukeBiz
Welcome to NukeBiz · Members
Amazon
show cart or checkout0 items
Cart Value: 0.00

Forums » DragonflyCMS Projects » Storez » [fixed] Theme customisation
[fixed] Theme customisation
A comprehensive shopping cart solution.
Topic initiation via Bugger.

Post new topic    Reply to topic    Printer Friendly Page     Forum Index »  eCommerce » Storez

View previous topic :: View next topic  
Author Message
Kendle
New Poster
New Poster

Offline Offline
Joined: Apr 26, 2007
Posts: 3
Location: England
PostPosted: Fri Jul 08, 2011 4:22 pm
Post subject: [fixed] Theme customisation

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

Code::
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.


Kendle please enter your server specs in your user profile! Crying or Very sad
Back to top
View user's profile Visit poster's website
Phoenix
Chairman
Chairman

Offline Offline
Joined: Mar 17, 2004
Posts: 1543
Location: Netizen
PostPosted: Sun Jul 10, 2011 7:43 am
Post subject: Re: Theme customisation

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


Phoenix's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Back to top
View user's profile Visit poster's website ICQ Number Yahoo Messenger Photo Gallery
Kendle
New Poster
New Poster

Offline Offline
Joined: Apr 26, 2007
Posts: 3
Location: England
PostPosted: Mon Jul 11, 2011 10:18 pm
Post subject: Re: Theme customisation

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.


Kendle please enter your server specs in your user profile! Crying or Very sad
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic    Reply to topic    Printer Friendly Page    Forum Index »  eCommerce » Storez
Page 1 of 1
All times are GMT + 9.5 Hours



Jump to:  


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum