Products detailpage template not working
Posted: Thu Jul 05, 2018 9:18 pm
I'm trying to use the Products module to display products by category, e.g. "bread", "buns", "rolls"
I'd like to be able to have a different detail page view for the different categories. I was hoping to use something like: {cms_module_hint action='details' module='Products' detailtemplate='55'} or {cms_module_hint action='details' module='Products' detailpage='40'} with Pretty URLs turned on but I'm not sure if this will work....for now I'm just trying to get the products module to work with pretty urls/url slugs turned off and to call a category specific detailpage='' or detailtemplate='' using the {products} tag. I think that just having the ability to call a category specific detailtemplate would allow me a category specific detail page view and would allow me to create different detail page views for each category, I don't think I even need a unique detailpage as the detail page would just be a wrapper around the detailtemplate. Category specific detail template ids/aliases could be called on category specific content pages.
I've read through the documentation for the products module and tried every way I can think of. Here is what I've gathered from the documentation...
You cannot call detailpage="foo" or detailtemplate="foo" on the {products} tag when using Pretty URLs or URL Slugs, e.g. the below code would not work with pretty urls or url slugs on. (I did have both of these settings turned on when I started but have turned them off.)
{Products category='Breads' summarytemplate='52' detailpage='36' detailtemplate='55'}
but you should be able to use detailpage="foo" or detailtemplate="foo" when you do not have pretty urls turned on, and/or do not have Slug URLs for product items.
Each time I try to call a detailpage="foo" for detailtemplate="foo" from the {products} the "default" template is returned.
I turned on the following on the product summary page (this only has a detailtemplate="40"):
{get_template_vars
<pre>{$entry|@print_r}</pre>
for my products list view I see the following:
$SCRIPT_NAME (string) = /index.php
$app_name (string) = callable
$sitename (string) = Klosterman Baking Company
$content_obj (object of type: Content) = {}
$content_id (string) = 35
$page_id (string) = bread
$page_alias (string) = bread
$lang (string) = en_US
$encoding (string) = utf-8
$page_title_product_name (string) = Bread
$product_breadcrumb (NULL) =
$product_meta_description_seo (string) = This is the content from the Bread page Description (title attribute)
$gcb_params (array) = [
.name (string) = CustomHeaderProductsDetail
]
$actionid (string) = m2f730
$actionparams (array) = [
.category (string) = Bread
.summarytemplate (string) = 52
.detailtemplate (string) = 40
.module (string) = Products
.action (string) = details
]
$returnid (string) = 35
$actionmodule (string) = Products
$mod (object of type: Products) = {
._colors (NULL) =
._actionid (string) = m2f730
._actionname (string) = default
->_image_directories (array) = [
.0 (string) = modules/Products/icons
]
._current_action (NULL) =
._errormsg (NULL) =
._returnid (NULL) =
}
$Products (object of type: Products) = {
._colors (NULL) =
._actionid (string) = m2f730
._actionname (string) = default
->_image_directories (array) = [
.0 (string) = modules/Products/icons
]
._current_action (NULL) =
._errormsg (NULL) =
._returnid (NULL) =
}
$module (string) = Products
$items (array) = [
[0] (object of type: Products\DisplayableProduct) = { }
[1] (object of type: Products\DisplayableProduct) = { }
[2] (object of type: Products\DisplayableProduct) = { }
[3] (object of type: Products\DisplayableProduct) = { }
[4] (object of type: Products\DisplayableProduct) = { }
]
$itemcount (integer) = 5
$totalcount (string) = 5
$pagecount (integer) = 1
$curpage (integer) = 1
$firstlink (string) = <<
$prevlink (string) = <
$lastlink (string) = >>
$nextlink (string) = >
$pagetext (string) = Page
$oftext (string) = Of
$currency_symbol (string) = $
$weight_units (string) = lb
but when I click on a product link I always end up on the default detail page using the default template.
The detail page and detail template I end up on are set as default in the template edit "advanced" tab and I do not have a default page set in the "advanced" section of the product module.
Thanks in advance for any help provided.
System settings below.
CMSMS Version 2.2.5
Installed Modules
AdminSearch 1.0.4
CGExtensions 1.61
CGSimpleSmarty 2.1.8
CMSContentManager 1.1.6
CMSMailer 6.2.14
CmsJobManager 0.1.2
DesignManager 1.1.4
FileManager 1.6.5
FilePicker 1.0.2
Gallery 2.3.2
JQueryTools 1.4.0.3
MenuManager 1.50.3
MicroTiny 2.2.2
ModuleManager 2.1.3
Navigator 1.0.8
News 2.51.3
Products 2.28.4
Search 1.51.2
TinyMCE 3.2-beta3
CMS Made Simple Config Settings
php_memory_limit
max_upload_size 8000000
url_rewriting none
page_extension
query_var page
auto_alias_content true
locale
set_names true
timezone America/New_York
permissive_smarty false
debug false
Performance and Tuning Information (recommended settings, but not required)
Allow Browser to Cache Pages Success On (True)
Browser Cache Expiry Period (minutes) Success 60
PHP 5.5+ Opcode Cache Success On (True)
Enable Smarty Caching Caution Off (False)
Enabling Smarty caching can have serious performance benefits for most websites.
Do a Compilation Check Success Off (False)
Remove cache files that are older than the specified number of days Success On (True)
PHP Information
Current PHP Version (phpversion) Success 5.6.36
md5 function (md5_function) Success On (True)
JSON functions (json_function) Success On (True)
GD version (gd_version) Success 2
tempnam function (tempnam_function) Success On (True)
Magic quotes in runtime (magic_quotes_runtime) Success Off (False)
Is E_ALL enabled in error_reporting (E_ALL) Success
Is E_STRICT disabled in error_reporting (E_STRICT) Caution E_STRICT is enabled in the error_reporting
Is E_DEPRECATED disabled in error_reporting (E_DEPRECATED) Caution E_DEPRECATED is enabled
Testing for time difference in the file system (test_file_timedifference) Success No time difference found
Testing for time difference in the database (test_db_timedifference) Success No time difference found
Checking if the HTTPD process can create a file inside of a directory it created (create_dir_and_file) Success 1
PHP Effective Memory Limit (memory_limit) Success 128M
Maximum Execution Time (max_execution_time) Success 300
PHP register_globals (register_globals) Success Off (False)
PHP output_buffering (output_buffering) Success 4096
disable_functions in PHP (disable_functions) Success
PHP Open Basedir (open_basedir) Success
Test for remote URL (test_remote_url) Success Success
fsockopen: Connection ok! Success
fopen: Connection ok! Success
File uploads (file_uploads) Success On (True)
Maximum Post Size (post_max_size) Caution 8M ?
Maximum Upload Size (upload_max_filesize) Caution 8M ?
Session Save Path (session_save_path) Success /opt/alt/php56/var/lib/php/session (0700)
Sessions are allowed to use Cookies (session_use_cookies) Success On (True)
Basic XML (expat) support (xml_function) Success On (True)
Checking for the XMLReader class (xmlreader_class) Success On (True)
Test ini_set (check_ini_set) Success On (True)
Test for the curl library (curl) Success On
Test curl version (curlversion) Success version 7.60.0, minimum recommended version is 7.19.7
Server Information
Server Software (server_software) litespeed
Server API (server_api) litespeed
Server Operating System (server_os) linux 2.6.32-531.1.2.lve1.2.54.el6.x86_64 on x86_64
Server Database (server_db_type) mysql (mysqli)
Server Database Version (server_db_version) Success 5.5.59
Check database access levels (server_db_grants) Success found a "grant all" statement that appears to be suitable
Copyright © CMS Made Simple™ 2.2.5 “Wawa”
I'd like to be able to have a different detail page view for the different categories. I was hoping to use something like: {cms_module_hint action='details' module='Products' detailtemplate='55'} or {cms_module_hint action='details' module='Products' detailpage='40'} with Pretty URLs turned on but I'm not sure if this will work....for now I'm just trying to get the products module to work with pretty urls/url slugs turned off and to call a category specific detailpage='' or detailtemplate='' using the {products} tag. I think that just having the ability to call a category specific detailtemplate would allow me a category specific detail page view and would allow me to create different detail page views for each category, I don't think I even need a unique detailpage as the detail page would just be a wrapper around the detailtemplate. Category specific detail template ids/aliases could be called on category specific content pages.
I've read through the documentation for the products module and tried every way I can think of. Here is what I've gathered from the documentation...
You cannot call detailpage="foo" or detailtemplate="foo" on the {products} tag when using Pretty URLs or URL Slugs, e.g. the below code would not work with pretty urls or url slugs on. (I did have both of these settings turned on when I started but have turned them off.)
{Products category='Breads' summarytemplate='52' detailpage='36' detailtemplate='55'}
but you should be able to use detailpage="foo" or detailtemplate="foo" when you do not have pretty urls turned on, and/or do not have Slug URLs for product items.
Each time I try to call a detailpage="foo" for detailtemplate="foo" from the {products} the "default" template is returned.
I turned on the following on the product summary page (this only has a detailtemplate="40"):
{get_template_vars
<pre>{$entry|@print_r}</pre>
for my products list view I see the following:
$SCRIPT_NAME (string) = /index.php
$app_name (string) = callable
$sitename (string) = Klosterman Baking Company
$content_obj (object of type: Content) = {}
$content_id (string) = 35
$page_id (string) = bread
$page_alias (string) = bread
$lang (string) = en_US
$encoding (string) = utf-8
$page_title_product_name (string) = Bread
$product_breadcrumb (NULL) =
$product_meta_description_seo (string) = This is the content from the Bread page Description (title attribute)
$gcb_params (array) = [
.name (string) = CustomHeaderProductsDetail
]
$actionid (string) = m2f730
$actionparams (array) = [
.category (string) = Bread
.summarytemplate (string) = 52
.detailtemplate (string) = 40
.module (string) = Products
.action (string) = details
]
$returnid (string) = 35
$actionmodule (string) = Products
$mod (object of type: Products) = {
._colors (NULL) =
._actionid (string) = m2f730
._actionname (string) = default
->_image_directories (array) = [
.0 (string) = modules/Products/icons
]
._current_action (NULL) =
._errormsg (NULL) =
._returnid (NULL) =
}
$Products (object of type: Products) = {
._colors (NULL) =
._actionid (string) = m2f730
._actionname (string) = default
->_image_directories (array) = [
.0 (string) = modules/Products/icons
]
._current_action (NULL) =
._errormsg (NULL) =
._returnid (NULL) =
}
$module (string) = Products
$items (array) = [
[0] (object of type: Products\DisplayableProduct) = { }
[1] (object of type: Products\DisplayableProduct) = { }
[2] (object of type: Products\DisplayableProduct) = { }
[3] (object of type: Products\DisplayableProduct) = { }
[4] (object of type: Products\DisplayableProduct) = { }
]
$itemcount (integer) = 5
$totalcount (string) = 5
$pagecount (integer) = 1
$curpage (integer) = 1
$firstlink (string) = <<
$prevlink (string) = <
$lastlink (string) = >>
$nextlink (string) = >
$pagetext (string) = Page
$oftext (string) = Of
$currency_symbol (string) = $
$weight_units (string) = lb
but when I click on a product link I always end up on the default detail page using the default template.
The detail page and detail template I end up on are set as default in the template edit "advanced" tab and I do not have a default page set in the "advanced" section of the product module.
Thanks in advance for any help provided.
System settings below.
CMSMS Version 2.2.5
Installed Modules
AdminSearch 1.0.4
CGExtensions 1.61
CGSimpleSmarty 2.1.8
CMSContentManager 1.1.6
CMSMailer 6.2.14
CmsJobManager 0.1.2
DesignManager 1.1.4
FileManager 1.6.5
FilePicker 1.0.2
Gallery 2.3.2
JQueryTools 1.4.0.3
MenuManager 1.50.3
MicroTiny 2.2.2
ModuleManager 2.1.3
Navigator 1.0.8
News 2.51.3
Products 2.28.4
Search 1.51.2
TinyMCE 3.2-beta3
CMS Made Simple Config Settings
php_memory_limit
max_upload_size 8000000
url_rewriting none
page_extension
query_var page
auto_alias_content true
locale
set_names true
timezone America/New_York
permissive_smarty false
debug false
Performance and Tuning Information (recommended settings, but not required)
Allow Browser to Cache Pages Success On (True)
Browser Cache Expiry Period (minutes) Success 60
PHP 5.5+ Opcode Cache Success On (True)
Enable Smarty Caching Caution Off (False)
Enabling Smarty caching can have serious performance benefits for most websites.
Do a Compilation Check Success Off (False)
Remove cache files that are older than the specified number of days Success On (True)
PHP Information
Current PHP Version (phpversion) Success 5.6.36
md5 function (md5_function) Success On (True)
JSON functions (json_function) Success On (True)
GD version (gd_version) Success 2
tempnam function (tempnam_function) Success On (True)
Magic quotes in runtime (magic_quotes_runtime) Success Off (False)
Is E_ALL enabled in error_reporting (E_ALL) Success
Is E_STRICT disabled in error_reporting (E_STRICT) Caution E_STRICT is enabled in the error_reporting
Is E_DEPRECATED disabled in error_reporting (E_DEPRECATED) Caution E_DEPRECATED is enabled
Testing for time difference in the file system (test_file_timedifference) Success No time difference found
Testing for time difference in the database (test_db_timedifference) Success No time difference found
Checking if the HTTPD process can create a file inside of a directory it created (create_dir_and_file) Success 1
PHP Effective Memory Limit (memory_limit) Success 128M
Maximum Execution Time (max_execution_time) Success 300
PHP register_globals (register_globals) Success Off (False)
PHP output_buffering (output_buffering) Success 4096
disable_functions in PHP (disable_functions) Success
PHP Open Basedir (open_basedir) Success
Test for remote URL (test_remote_url) Success Success
fsockopen: Connection ok! Success
fopen: Connection ok! Success
File uploads (file_uploads) Success On (True)
Maximum Post Size (post_max_size) Caution 8M ?
Maximum Upload Size (upload_max_filesize) Caution 8M ?
Session Save Path (session_save_path) Success /opt/alt/php56/var/lib/php/session (0700)
Sessions are allowed to use Cookies (session_use_cookies) Success On (True)
Basic XML (expat) support (xml_function) Success On (True)
Checking for the XMLReader class (xmlreader_class) Success On (True)
Test ini_set (check_ini_set) Success On (True)
Test for the curl library (curl) Success On
Test curl version (curlversion) Success version 7.60.0, minimum recommended version is 7.19.7
Server Information
Server Software (server_software) litespeed
Server API (server_api) litespeed
Server Operating System (server_os) linux 2.6.32-531.1.2.lve1.2.54.el6.x86_64 on x86_64
Server Database (server_db_type) mysql (mysqli)
Server Database Version (server_db_version) Success 5.5.59
Check database access levels (server_db_grants) Success found a "grant all" statement that appears to be suitable
Copyright © CMS Made Simple™ 2.2.5 “Wawa”