Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Module Url
ginolandi
#1 Posted : Thursday, May 05, 2011 10:27:04 AM(UTC)
Rank: Member
Groups: Registered

Joined: 4/8/2011(UTC)
Posts: 20
Hi,

i'd like to know how to avoid the following url, when programming modules
http://localhost/KoobooTest/Articles/?ModuleUrl=%28RZVWZ%29%2FHome%2FBrowse~~genre%3DDisco%2F%28HP4ZV%29%2FStoreManager

In the previous example i have added two modules (same module but two entry point) in the same page and kooboo encode all the variables in the same querystring key named "ModuleUrl".
This url is not so loveble for search engine.

Can you tell me wich is the best way for bypass this problem?

Than you,
Gino
jifeng
#2 Posted : Friday, May 06, 2011 2:55:33 AM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,555
Location: Xiamen China
HI

To set the module url as friendly, please change the page route setting:

URL Path: {*ModuleUrl}

NOTE: {*ModuleUrl} only allow at the end of URL path section, for example:

"{id}/{*ModuleUrl}" is correct.

"{*ModuleUrl}/{id}" is incorrect.
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
ginolandi
#3 Posted : Friday, May 06, 2011 7:58:44 AM(UTC)
Rank: Member
Groups: Registered

Joined: 4/8/2011(UTC)
Posts: 20
jifeng;3686 wrote:
HI
"{id}/{*ModuleUrl}" is correct.
"{*ModuleUrl}/{id}" is incorrect.


Thanks for your reply.

I already tried that, but the original url
http://localhost/KoobooTest/Articles/?ModuleUrl=%28RZVWZ%29%2FHome%2FBrowse~~genre%3DMetal
became the following
http://localhost/KoobooTest/Articles/(ZRB37)/Home/Browse~~genre%3dMetal

For SEO reason my url could be similar to:
http://localhost/KoobooTest/Articles/(ZRB37)/Home/Browse/genre/Metal
or best
http://localhost/KoobooTest/Browse/genre/Metal

I was wondering that could be possibile to create a kooboo page with each module entry point, but looking the reply of the other forum post, this is difficult because is not possibile to pass parameter (classic id), to the module.

Is there a trick to solve this issue?

Thank you,
Gino
jifeng
#4 Posted : Friday, May 06, 2011 8:37:03 AM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,555
Location: Xiamen China
The module url format defined in module, you can define the mvc route as normal mvc site in the routes.config.
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
ginolandi
#5 Posted : Friday, May 06, 2011 4:35:38 PM(UTC)
Rank: Member
Groups: Registered

Joined: 4/8/2011(UTC)
Posts: 20
jifeng;3689 wrote:
The module url format defined in module, you can define the mvc route as normal mvc site in the routes.config.

Yes i have tried but i don't understand what i must to write into routes.config to transform the url in:

http://localhost/KoobooTest/Browse/genre/?Metal
Home is the controller, Browse the Action e genre is the parameter for the action.
Maybe the problem are in the values that i set in both routeType and dataTokens.

My last change was the following:

<add name="ModuleRoute" url="{controller}/{action}" routeType="Kooboo.CMS.Sites.Extension.Module.ModuleRoute,Kooboo.CMS.Sites">
<defaults controller = "Home" action = "Browse"></defaults>
<dataTokens Namespaces="CmsModule.Controllers"/>
</add>

Could you tell me how i can add the route?
Thanks
jifeng
#6 Posted : Saturday, May 07, 2011 12:00:42 AM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,555
Location: Xiamen China
Try to insert new route setting at the first:


<add name="ModuleRoute" url="{controller}/{action}/{genre}" routeType="Kooboo.CMS.Sites.Extension.Module.ModuleRoute,Kooboo.CMS.Sites">
<defaults controller = "Home" action = "Browse" genre=""></defaults>
<dataTokens Namespaces="CmsModule.Controllers"/>
</add>
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
ginolandi
#7 Posted : Monday, May 09, 2011 9:57:45 AM(UTC)
Rank: Member
Groups: Registered

Joined: 4/8/2011(UTC)
Posts: 20
jifeng;3691 wrote:
Try to insert new route setting at the first:
<add name="ModuleRoute" url="{controller}/{action}/{genre}" routeType="Kooboo.CMS.Sites.Extension.Module.ModuleRoute,Kooboo.CMS.Sites">
<defaults controller = "Home" action = "Browse" genre=""></defaults>
<dataTokens Namespaces="CmsModule.Controllers"/>
</add>


Hi Jifeng,
thank for your reply, but the route does not work for me.

These are my routes:
<routes>
<add name="ModuleRoute" url="{controller}/{action}/{genre}" routeType="Kooboo.CMS.Sites.Extension.Module.ModuleRoute,Kooboo.CMS.Sites">
<defaults controller = "Home" action = "Browse" genre=""></defaults>
<!--<constraints genre="\d+"></constraints>-->
<dataTokens Namespaces="MyKoobooModule.Controllers"/>
</add>
<add name="Default" url="{controller}/{action}" routeType="Kooboo.CMS.Sites.Extension.Module.ModuleRoute,Kooboo.CMS.Sites">
<defaults controller = "Home" action = "Index"></defaults>
<dataTokens Namespaces="MyKoobooModule.Controllers"/>
</add>
</routes>

and this is the generated url when I try create an ActionLink for the specific route
http://localhost:6592/Index/index/?ModuleUrl=%28List%29%2FHome%2FBrowse%2FJazz

Could you teel me what is the problem?

Again thanks,
Gino
jifeng
#8 Posted : Tuesday, May 10, 2011 1:39:48 AM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,555
Location: Xiamen China
"Home/Browse/Jazz" is what we expect. It does't work?
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
ginolandi
#9 Posted : Tuesday, May 10, 2011 8:52:14 AM(UTC)
Rank: Member
Groups: Registered

Joined: 4/8/2011(UTC)
Posts: 20
jifeng;3705 wrote:
"Home/Browse/Jazz" is what we expect. It does't work?

Hi,
No, it is not what I expect.. the url that kooboo create is the following

http://localhost:53543/Kooboo/dev~Kooboo/TestPage/?ModuleUrl=(3TNPH)%2FHome%2FDetail%2F3

The above url is created using your News Controller/Views avilable in visual studio template.
Even if the routes.xml contains my new route:
<add name="ModuleRoute" url="{controller}/{action}/{id}" routeType="Kooboo.CMS.Sites.Extension.Module.ModuleRoute,Kooboo.CMS.Sites">
<defaults controller = "Home" action = "Detail" id=""></defaults>
<dataTokens Namespaces="TestModule.Controllers"/>
</add>

..the Url contains additional info, as the module url, and the module controller/view names are encoded.
I have added the module into a new page using your entry point Home/Categories.
The firts page (that shows the categories) is showed with the correct page url, when i click over a specific news (so moving to Detail View), the url became:
http://localhost:53543/Kooboo/dev~Kooboo/TestPage/?ModuleUrl=(3TNPH)%2FHome%2FDetail%2F3

I think that for many reason the url should sound like:
http://localhost:53543/Kooboo/dev~Kooboo/TestPage/Home/Detail/3

Is it possible?
I hope that i have explained correctly my needs.

Thanks,
Gino
jifeng
#10 Posted : Tuesday, May 10, 2011 9:03:32 AM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,555
Location: Xiamen China
If you add {*ModuleUrl} in the route path, the url will be became:

http://localhost:53543/Kooboo/dev~Kooboo/TestPage/(3TNPH)/Home/Detail/3

It is possible to change the value "3TNPH" to a friendly string, but it is very hard to remove the section of "(3TNPH)", because we need to know the following module url apply to which module on the page. The page can be contains more than one modules, so we need to identify the url for which module.
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
ginolandi
#11 Posted : Tuesday, May 10, 2011 9:19:29 AM(UTC)
Rank: Member
Groups: Registered

Joined: 4/8/2011(UTC)
Posts: 20
jifeng;3708 wrote:

It is possible to change the value "3TNPH" to a friendly string, but it is very hard to remove the section of "(3TNPH)"


Ok I understand the problem... now my url is http://localhost:53543/Kooboo/dev~Kooboo/TestPage/(3TNPH)/Home/Detail/3

Now my last question.. where can i set a friendly name for 3TNPH?

Thanks,
Gino
jifeng
#12 Posted : Tuesday, May 10, 2011 10:01:45 AM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,555
Location: Xiamen China
Yes, it possible, but it can not be changed from the CMS ui right now, will add it later.

You can change it from the page setting file for now.
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF 1.9.5.5 | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.087 seconds.