CMS MADE SIMPLE FORGE

Products

 

[#8136] detailtemplate taken into acount on summaryview

avatar
Created By: Belery Olivier (kube)
Date Submitted: 2012-07-13 06:49

Assigned To: Robert Campbell (calguy1000)
Resolution: Won't Fix
State: Closed
Summary:
detailtemplate taken into acount on summaryview
Detailed Description:
Because of pretty url (i guess), the detailtemplate param is lost during the
Createlink method (in the product default/summary action)

This makes different product views impossible (unless filtering on a product
field and generate the corresponding html in the default details template).

I saw you did found a solution for this in the news module so it can handle both
summarytemplate AND detailtemplate when using pretty urls.
on line 351 of the default news action you add a /d,value of the
detailtemplateparam

This is a "better than nothing" solution that would gladly be implemented in the
product module.

Now (dreaming he!) why not implementing this generated string BEFORE the product
name in the URL ?? (like the page id and return id) That would be more seo
friendly...

History

Comments
avatar
Date: 2012-07-13 07:31
Posted By: Belery Olivier (kube)

Ok i did a test the "better than nothing" solution and it works. Here is what i
changed (tell me if i'm right :-)  ) :

IN Products.module.php line 263:

$this->RegisterRoute($str.'\/(?P<productid>[0-9]+)\/(?P<returnid>[0-9]+)\/(?P<junk>.*?)\/d,(?P<detailtemplate>.*?)$/',
array('action'=>'details'));

IN action.default.php line 447

if( product_utils::can_do_pretty($params['notpretty']) ) {
    $prettyurl = product_ops::pretty_url($row['id'],$detailpage);
    if (isset($params['detailtemplate']))
    {
    	$prettyurl .= '/d,' . $params['detailtemplate'];
    }
  }

      
avatar
Date: 2012-07-13 09:43
Posted By: Belery Olivier (kube)

Hi callguy1000,

I just saw status is now "Won't Fix". Can you explain why ? Is this fix not good
? Is there a better way of archieveing the same thing ? Some big change in the
future preventing this ?

HTH
      
avatar
Date: 2012-07-13 12:18
Posted By: Robert Campbell (calguy1000)

Products module is slated to get News/CGBlog style custom URLS.  Adding
detailtemplate and other parameters to the URL is just another kind of ugly.

There is no way to keep the URL pretty and have all of the flexibility of
disabling pretty URLS.  With pretty urls enabled some functionality is lost. 
This is known and there is no real way to fix it.
      
avatar
Date: 2013-01-21 11:56
Posted By: funkyhead (funkyhead)

Hi men,

What about {cge_module_hint} in CGExtensions Module, it can be helpfull for this
?
I've tried whitout success... but perhaps i use it in a wrong way.
      
Updates

Updated: 2013-09-05 18:01
state: Open => Closed

Updated: 2012-07-13 09:07
resolution_id: 5 => 8

Updated: 2012-07-13 07:31
resolution_id: => 5