Skip to content

Commit 78cc20d

Browse files
committed
Changed routes for post and products back to using only slug without id's
1 parent 1f67d00 commit 78cc20d

File tree

2 files changed

+29
-26
lines changed

2 files changed

+29
-26
lines changed

config/app-routes.php

+12-9
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@
8484
'/vendor/{slug}/#page#' => ['module' => 'product/vendor/index'],
8585
'/vendor' => ['module' => 'product/vendor/index'],
8686
'/vendor/#page#' => ['module' => 'product/vendor/index'],
87-
//'/product/{slug}' => ['module' => 'product/product/index', 'edit'=>'?module=product/product&slug={slug}'],
88-
'/product/{slug}-#product_id#' => ['module' => 'product/product/index', 'edit'=>'?module=product/product&product_id={product_id}'],
87+
'/product/{slug}' => ['module' => 'product/product/index', 'edit'=>'?module=product/product&slug={slug}'],
88+
//'/product/{slug}-#product_id#' => ['module' => 'product/product/index', 'edit'=>'?module=product/product&product_id={product_id}'],
8989

9090
//compare
9191
'/cart/compare' => ['module' => 'cart/compare/index'],
@@ -101,7 +101,8 @@
101101
'/{language{2,5}}/manufacturer/{slug}' => ['module' => 'product/manufacturer/index'],
102102
'/{language{2,5}}/vendor/{slug}' => ['module' => 'product/vendor/index'],
103103
'/{language{2,5}}/vendor/{slug}/#page#' => ['module' => 'product/vendor/index'],
104-
'/{language{2,5}}/product/{slug}-#product_id#' => ['module' => 'product/product/index', 'edit'=>'?module=product/product&product_id={product_id}'],
104+
//'/{language{2,5}}/product/{slug}-#product_id#' => ['module' => 'product/product/index', 'edit'=>'?module=product/product&product_id={product_id}'],
105+
'/{language{2,5}}/product/{slug}' => ['module' => 'product/product/index', 'edit'=>'?module=product/product&product_id={slug}'],
105106

106107
//checkout
107108
'/cart' => ['module' => 'cart/cart/index'],
@@ -141,12 +142,12 @@
141142

142143
//post
143144
//'/#year{4,4}#-#month{1,2}#-#day#/{slug}' => ['module' => 'content/post/index', 'edit'=>'?module=content/post&slug={slug}'],
144-
//'/{slug}' => ['module' => 'content/post/index', 'edit'=>'?module=content/post&slug={slug}&type=post'],
145-
'/{slug}-#post_id#' => ['module' => 'content/post/index', 'edit'=>'?module=content/post&post_id={post_id}&type=post'],
145+
'/{slug}' => ['module' => 'content/post/index', 'edit'=>'?module=content/post&slug={slug}&type=post'],
146+
//'/{slug}-#post_id#' => ['module' => 'content/post/index', 'edit'=>'?module=content/post&post_id={post_id}&type=post'],
146147
//page
147148
//'/{slug}' => ['module' => 'content/page/index', 'edit'=>'?module=content/post&slug={slug}'],
148-
//'/page/{slug}' => ['module' => 'content/page/index', 'edit'=>'?module=content/post&slug={slug}&type=page'],
149-
'/page/{slug}-#post_id#' => ['module' => 'content/page/index', 'edit'=>'?module=content/post&post_id={post_id}&type=page'],
149+
'/page/{slug}' => ['module' => 'content/page/index', 'edit'=>'?module=content/post&slug={slug}&type=page'],
150+
//'/page/{slug}-#post_id#' => ['module' => 'content/page/index', 'edit'=>'?module=content/post&post_id={post_id}&type=page'],
150151

151152
//multi language content - language code must be at least 2 characters
152153
'/{language{2,5}}/' => ['module' => 'index/index'],
@@ -156,8 +157,10 @@
156157
'/{language{2,5}}/blog' => ['module' => 'content'],
157158
'/{language{2,5}}/cat/{slug}' => ['module' => 'content/category/language'],
158159
'/{language{2,5}}/tag/{slug}' => ['module' => 'content/tag/index'],
159-
'/{language{2,5}}/{slug}-#post_id#' => ['module' => 'content/post/index', 'edit'=>'?module=content/post&post_id={post_id}'],
160-
'/{language{2,5}}/page/{slug}-#post_id#' => ['module' => 'content/page/index', 'edit'=>'?module=content/post&post_id={post_id}'],
160+
//'/{language{2,5}}/{slug}-#post_id#' => ['module' => 'content/post/index', 'edit'=>'?module=content/post&post_id={post_id}'],
161+
'/{language{2,5}}/{slug}' => ['module' => 'content/post/index', 'edit'=>'?module=content/post&post_id={slug}'],
162+
//'/{language{2,5}}/page/{slug}-#post_id#' => ['module' => 'content/page/index', 'edit'=>'?module=content/post&post_id={post_id}'],
163+
'/{language{2,5}}/page/{slug}' => ['module' => 'content/page/index', 'edit'=>'?module=content/post&slug={slug}'],
161164

162165
'/{language{2,5}}/tag/{slug}' => ['module' => 'content/tag/index'],
163166
'/{language{2,5}}/tag/{slug}/#page#' => ['module' => 'content/tag/index'],

install/sql/insert/menu/menu_item.sql

+17-17
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,17 @@ INSERT INTO `menu_item` (`menu_item_id`, `menu_id`, `type`, `url`, `parent_id`,
5050
-- (47,1,'link','//github.com/givanz/Vvveb/discussions',44,null,0,1),
5151
-- (48,1,'link','//dev.*.*',44,null,3,1),
5252

53-
(49,1,'page','/page/contact-7',0,7,6,1),
54-
(59,1,'page','/page/about-11',0,11,1,1),
55-
-- (60,1,'link','/page/contact-7',59,null,0,1),
56-
-- (61,1,'link','/page/contact-7',59,null,3,1),
57-
-- (62,1,'link','/page/contact-7',59,null,2,1),
53+
(49,1,'page','/page/contact',0,7,6,1),
54+
(59,1,'page','/page/about',0,11,1,1),
55+
-- (60,1,'link','/page/contact',59,null,0,1),
56+
-- (61,1,'link','/page/contact',59,null,3,1),
57+
-- (62,1,'link','/page/contact',59,null,2,1),
5858

59-
(63,1,'page','/page/services-12',0,12,4,1),
60-
(64,1,'page','/page/pricing-13',63,13,0,1),
61-
(65,1,'page','/page/services-12',63,12,0,1),
62-
(80,5,'page','/page/marketplace-15',63,15,0,1),
63-
(66,1,'page','/page/portfolio-14',63,14,0,1),
59+
(63,1,'page','/page/services',0,12,4,1),
60+
(64,1,'page','/page/pricing',63,13,0,1),
61+
(65,1,'page','/page/services',63,12,0,1),
62+
(80,5,'page','/page/marketplace',63,15,0,1),
63+
(66,1,'page','/page/portfolio',63,14,0,1),
6464
(67,1,'text','#',0,14,3,0),
6565
(68,1,'text','#',67,11,0,0),
6666

@@ -69,11 +69,11 @@ INSERT INTO `menu_item` (`menu_item_id`, `menu_id`, `type`, `url`, `parent_id`,
6969
(51,5,'link','/',50,null,0,1),
7070
(52,5,'link','/shop',50,null,0,1),
7171
(53,5,'link','/',0,null,0,1),
72-
(54,5,'page','/page/shipping-delivery-8',8,8,0,1),
73-
(55,5,'page','/page/terms-conditions-9',9,9,0,1),
74-
(56,5,'page','/page/contact-7',0,7,0,1),
75-
(57,5,'page','/page/contact-7',56,7,0,1),
76-
(58,5,'page','/page/portfolio-14',56,14,0,1),
72+
(54,5,'page','/page/shipping-delivery',8,8,0,1),
73+
(55,5,'page','/page/terms-conditions',9,9,0,1),
74+
(56,5,'page','/page/contact',0,7,0,1),
75+
(57,5,'page','/page/contact',56,7,0,1),
76+
(58,5,'page','/page/portfolio',56,14,0,1),
7777
(73,5,'link','/user/return-form',56,null,0,1),
7878

7979

@@ -86,7 +86,7 @@ INSERT INTO `menu_item` (`menu_item_id`, `menu_id`, `type`, `url`, `parent_id`,
8686

8787

8888
(74,5,'link','/blog',50,null,0,1),
89-
(75,5,'page','/page/services-12',50,12,0,1),
90-
(76,5,'page','/page/about-11',56,11,0,1),
89+
(75,5,'page','/page/services',50,12,0,1),
90+
(76,5,'page','/page/about',56,11,0,1),
9191
(77,5,'link','/brand',53,null,0,1),
9292
(78,5,'link','/vendor',53,null,0,1);

0 commit comments

Comments
 (0)