detailpagetemplate for Products Module Not Workign

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
montedavis
Forum Members
Forum Members
Posts: 64
Joined: Wed Jul 03, 2013 7:44 pm

detailpagetemplate for Products Module Not Workign

Post by montedavis »

Hello,
I've installed the products module on a fresh install of CMSMS 2.2.5. I would like to have multiple detail pages, with different detail templates. I've read the module help and searched the forums. I've tried using the {cge_module_hint} tag but cannot get the products module to show the detail template. When the products are listed on the page and you click the product link instead of using the defined detail template the page always uses the default detail page.

{cge_module_hint module=Products summarytemplate=50 detailtemplate=47 detailpage=47}

Here is a link to a test page: http://181.224.134.170/~pixelsanddots/i ... -test-page

Thank you for your help in advance,

Monte
montedavis
Forum Members
Forum Members
Posts: 64
Joined: Wed Jul 03, 2013 7:44 pm

Re: detailpagetemplate for Products Module Not Workign

Post by montedavis »

Is it possible to have unique detail page template for the products module? I've been unable to get this functionality to work...has anyone gotten this to work? I can get the default detail page to work but when I add the detailpagetemplate to the {products} smarty tag the products module always defaults to the default detail page template. I'm not sure if the snippet below from the module help page means that you can "only" use the detail page template....although at this point I'm not using pretty urls or hierarchy path.

"Options:
Default Detail Page *required*:
When using pretty URLS, and either a URL slug exists, or the "Use Hierarchy Path" preference (described below) is enabled, a page id will not be specified on the URL. For this purpose it is ncessary to tell the module which content page the detail view should be displayed on."


Any direction on getting this to work is appreciated.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: detailpagetemplate for Products Module Not Workign

Post by calguy1000 »

You have not mentioned exactly what you are trying to achieve OR what version of what environment you are using. It makes a difference. You absolutely MUST specify this information.

A primer about pages, templates and views.
--
- A page has an id, an alias and is associated with a template.
- Modules have different views to render data (summary, search, detail, hierarchy, category...). the rendering of those views is also controlled by templates. But they are different templates.
- in CMSMS there must be some way of determining a page id to do some rendering on so that a page template can be determined. If the page id is NOT in the URL then some other preference or config entry or something must be used to specify a page id.
- Modules can decide for themselves how to build URLS that result in rendering a view of some of that module's data on a page. Some modules are more flexible than others.
- Pretty URL's are intended to be human readable, and 'somewhat' better for SEO.
- You cannot include combinations of different parameters on a URL and in any shape or form call it 'pretty'. So, by enabling pretty URL's you may be restricting your choice of options wrt. module behavior.
i.e: You cannot have detailpage, detailtemplate, sort order, page limit, summary template, page number, etc. parameters on a URL and call them pretty in any way. Whatever way you slice it those urls are just ugly.

About Products.
--
Products has the ability to allow unique URL slugs to each item. This indicates that there is one and only one URL to display that item. And therefore you need to specify the 'detail page' preference so that it can know what page id, and therefore page template to use for all detail views. For rendering the detail view it will use the default 'detail template'.

Products has a detailpage parameter that CAN be used to generate a URL that indicates a different content page, to use when rendering a specific detail view WHEN NOT USING PRETTY URLS.

Products has a detailtemplate parameter that CAN be used to generate a URL that specifies what detail template to use for a view. WHEN NOT USING PRETTY URLS.

If you specify a default detail page, and pretty URLs are enabled, then that page will be used for ALL detail views. and the page id will not be on the URL, it turns off the 'detailpage' parameter. That is the behavior of the Products module.

You can also change what detail template will be used using the {cms_module_hint} smarty tag in your page template.

The {cms_module_hint} is a way of saying... 'on this page (or pages using this template) , when displaying this module action, add this parameter'. It has to be placed at the top of the template... before the <__html> tag. either in the template itself, or in the smarty-tags-specific-to-this page field.

i.e: {cms_module_hint module=Products action=details detailtemplate=foo}

If you want certain articles based on some information (category, age, time of day, phase of the moon, whatever)... to be displayed differently in the detail view WHILE having pretty URLS, URL slugs, etc, etc. you can accomplish this using logic inside your default detail template.

{* this code won't work it's just for illustration *}
{if $entry->category == 'foo'}
{include file='cms_template:foo_product_detail_view'}
{else}
{include file='cms_template:normal_product_detail_view'}
{/if}

Hope this clears it up
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Locked

Return to “Modules/Add-Ons”