Explorar el Código

Ticket #4492 - Use separate pages for categories in breadcrumb.

AntonLV hace 3 años
padre
commit
b4231da5f4
Se han modificado 1 ficheros con 7 adiciones y 1 borrados
  1. 7 1
      modules/base/text/classes/BxBaseModTextTemplate.php

+ 7 - 1
modules/base/text/classes/BxBaseModTextTemplate.php

@@ -130,8 +130,14 @@ class BxBaseModTextTemplate extends BxBaseModGeneralTemplate
         if(!empty($CNF['OBJECT_CATEGORY']) && !empty($CNF['FIELD_CATEGORY'])) {
             $oCategory = BxDolCategory::getObjectInstance($CNF['OBJECT_CATEGORY']);
 
+            $aParams = [];
+            if(isset($CNF['URL_CATEGORY']))
+                $aParams['page'] = bx_append_url_params(BxDolPermalinks::getInstance()->permalink($CNF['URL_CATEGORY']), [
+                    'category' => '{keyword}'
+                ], true, ['{keyword}']);
+
             $aTmplVarsItems[] = array(
-                'url' => $oCategory->getCategoryUrl($aContentInfo[$CNF['FIELD_CATEGORY']]),
+                'url' => $oCategory->getCategoryUrl($aContentInfo[$CNF['FIELD_CATEGORY']], $aParams),
                 'title' => $oCategory->getCategoryTitle($aContentInfo[$CNF['FIELD_CATEGORY']])
             );
         }