Page 1 of 1

products module layout help needed

Posted: Tue Sep 04, 2012 3:48 pm
by nickm321
Hi. I've been stumbling around trying to understand the templating of the products module, and wondered if anyone could give me any pointers?

What I would like is the following:
  1. Shop hosted on one page/url in the website: i.e. website.com/shop.
  2. This page will always show the hierarchy list on the left.
  3. At the top level, the main portion of the screen will show products from the category "Featured".
  4. At each hierarchy sublevel, the main portion of the screen will show the products in that hierarchy level.
  5. When a product is clicked on, it's details are displayed in the main portion of the screen. As always, the hierarchy list is on the left. Preferably with the current level highlighted.
  6. A breadcrumb trail on all pages.
I'm no noob to cmsms templating, just rather confused by the templates system in the products module. Can anyone help, or point me to a good guide?

Thanks in advance,
Nick.

Re: products module layout help needed

Posted: Tue Sep 04, 2012 8:47 pm
by JohnnyB
There's a lot of information that could be posted depending upon how far you want to take this. But, here are some quick suggestions:

1. Be sure to look at the module's help page. It will give you the tag and all of the options needed to place into a page or template.
2. Create a page called, 'Shop' and assign it to its own Template. Call the template, Shop for simplicity.
3. Be sure to use Mod Rewrite method of creating urls. In the config.php file, use the following:

Code: Select all

$config['url_rewriting'] = 'mod_rewrite';
$config['page_extension'] = '/';
This will allow you to have a /shop/ web address for the shopping site.
Be sure the server is set up to use mod_rewrites (they usually are although you may need to adjust your .htaccess file. See the htaccess.txt file in the /docs/ directory of your CMSMS installation for more information.
4. Put your shopping tags for categories, etc., in the Shop template. Be sure to include a shop tag in the shop page too.

Do a search for, "CMSMS Products Documentation". I can't remember where it is available but it was either a .odt or .pdf. I think it might be from Ted Kulp and Robert Campbell.

Re: products module layout help needed

Posted: Tue Sep 04, 2012 9:35 pm
by Dr.CSS
I hate to tell you this but / is not an extension...

Re: products module layout help needed

Posted: Tue Sep 04, 2012 9:39 pm
by JohnnyB
Dr.CSS wrote:I hate to tell you this but / is not an extension...
Correct. But, I've been using that config like that since about 2005 with success. Then in htaccess, I also rewrite to make sure there is a trailing slash. For some reason, that combination always works the best for me.

Re: products module layout help needed

Posted: Wed Sep 05, 2012 12:15 am
by nickm321
Thanks for the info mww.

1. I've pored over the module's help page a lot, quite useful, but a bit sparse.
2. Done already.
3. Also done. I have pretty urls working on the site. Products has the option, but it has never worked. It gives me the impression it's getting to be a stale module. As it's one of only two good ecommerce modules for CMSMS, that's a problem for future consideration of what CMS to use.
4. I tagged a few products with the category "Featured". I kept coming unstuck as the page kept being completely broken with the smarty {Products category="Featured"}. This is with all default templates. I installed a fresh copy of CMSMS elsewhere to debug. It seems the preference "Use new Summary view=Yes" breaks the products module. Great!

What I really need some help with now, is getting the hierarchy list to show on every page. There are three states the shop page will be in:
1. The state on arrival when someone goes to website.com/shop. This should have hierarchy on the left. I would like Featured on the right.
2. The state when a hierarchy item has been clicked. Hierarchy on the left, current node highlighted. Products of that node on the right.
3. Product detail state. Still the hierarchy on the left.

The problem is that each state (if that's the right term) uses a different template. Do I somehow call hierarchy view from summary? If I had category="featured" in Hierarchy view, would that not just create an endless loop? What I want visually is pretty run-of-the-mill for a shop, just seems rather tricky in the products module. No doubt someone might come along with two lines of code to make me look daft! :)

Re: products module layout help needed

Posted: Wed Sep 05, 2012 12:49 am
by nickm321
Ok, cracked it for the most part now: http://scubascene.nickmtech.co.uk/shop

For each state, I created two templates, embed and layout. I made the layout templates default.

So in the top level state, it shows hierarchy_layout template, with hierarchy code in the left div, and {Products category="Featured" summarytemplate="summary_embed"} in the right div.

In summary view state, the summary code is in the right div, and {Products action=hierarchy hierarchytemplate="hierarchy_embed"} in the left.

In detail veiw state, the detail code is in the right div, and again {Products action=hierarchy hierarchytemplate="hierarchy_embed"} in the left. No need for a detail embed template.

Phew! :D