Welcome, Guest
Username: Password: Remember me

TOPIC: Router with slug

Router with slug 13 Mar 2017 14:58 #15037

  • admin
  • admin's Avatar
  • Online
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
This monday, we propose you to automatically re-use the item aliases for building nice URLs.

The router has been rewritten, and it is fully customizable, even for using the filters.
You gonna love it !

www.j-cook.pro/index.php/docs/versions/291-3-1-3-router-slug
Coding is now a piece of cake
The administrator has disabled public write access.
The following user(s) said Thank You: Romkabouter

Router with slug 18 May 2017 09:19 #15140

  • liubov
  • liubov's Avatar
  • Offline
  • Elite Member
  • (=) 10 mn and it's ready!
  • Posts: 278
  • Thank you received: 35
  • Karma: 22
Do you think it's possible to use the router to rewrite the URL (using SEF).

Actual URL : component/jbreeding/portee/porteeactuelle.html?cid=366
Would like : component/jbreeding/portee/366-porteeactuelle.html ( as content )

I do not have Alias in the table 'Portees', how can I proceed ? an idea ?
Last Edit: 18 May 2017 09:21 by liubov.
The administrator has disabled public write access.

Router with slug 19 May 2017 12:32 #15145

  • admin
  • admin's Avatar
  • Online
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
Router is designed for SEO, so yes you can do that.

Then, it is customizable in
FRONT/router.php
Function : XxxxRouteConfig()

(Available since 3.1.3)

I see, you do do have even title is this table, so you might hit a foreign table.
Router is using ORM, so in the 'aliasKey', just define the namespace you want.
Here an example :
'city' => array(
    array(
        'type' => 'layout'
    ),
    array(
        'type' => 'slug',
        'aliasKey' => 'country.alias' // HERE the namespace for the slug
    )
),

I didn't tested, but it should work. Tell me, and share your result...
Note that this will take the FIRST result only, so it might work only for 1:1. In case only the first result will be used.
Coding is now a piece of cake
The administrator has disabled public write access.

Router with slug 19 May 2017 16:59 #15146

  • liubov
  • liubov's Avatar
  • Offline
  • Elite Member
  • (=) 10 mn and it's ready!
  • Posts: 278
  • Thank you received: 35
  • Karma: 22
In some other Breeding Application, I saw sometime an Alias Name to describe a litter (une portée en fr).
Breeder gives a Specific and Unic name to the litter. ie: "Orchidée17", "Magnolia12", etc ...
Now, with this SEO problem, I anderstand why !

I played a lot with the router, but do not have a lot of solution.
So not really sexy for the moment:

component/jbreeding/portee/porteeactuelle/365.html
or Through the menu
elevage/portees-actuelles/portee/porteeactuelle/365.html
Last Edit: 19 May 2017 17:02 by liubov.
The administrator has disabled public write access.
Time to create page: 0.107 seconds

Get Started