Custom URL structure


(Tbaatar) #1

Hi,

I kind of know the answer to this but Matrix might (hoping) it will prove me wrong.

Does Matrix support custom URL structure like modern CMS?
For example Wordpress allows you to place custom keywords in the URL/slug structure like below and it is fully crawlable and good with SEO.

If this is not possible out of the box, is this something that can be done by hacking around with Apache/Nginx or can we expect something like this in future release of Matrix?

Thanks.


(Asharpe) #3

Hi @tbaatar,

I believe the short answer to your question is “yes”.

In the example provided, “category” is a concept that is specified somewhere, as is “postname”. There’s also some context required to know when to use these things, and what they mean in that context.

The URL to your Matrix assets is driven primarily by your information architecture, so if you can structure that simply, then you’ll get simple URLs. Matrix also has keywords to get at all sorts of information for the current request, and while you probably won’t be able to use something quite as short as “%category%”, I’m sure you could get the same effect with metadata and other keywords (and modifiers).

The real question is: what are you trying to achieve?

To help you out with keywords and their modifiers, check out the keyword helper: https://matrix.squiz.net/resources/matrix-keyword-helper

Hope that helps,

Andrew


(Tbaatar) #4

Hi Andrew,

Thanks for getting back.

This was a question raised by one of our new developers. Basically currently we have hundreds of products and each of these products are a Standard page with metadata schedma and paint layout.

Example directory looks like this:

/trips
     /product 1
     /product 2
     /product 3
     /and so on

Essentially what we want to achieve is

/trips
       /%product%

%products% URL will need to be a dynamic slug and serve all products without having to create traditional Assets, and also indexible. So essentially getting rid of Matrix assets in favour of pulling from the database.

The 2nd reason for this approach is that we’re migrating over blog from Wordpress into Matrix and we’d want to have this flexibility of categorising / tagging and creating the SEO friendly slugs automatically without having to create holding urls.

Thanks.


(Asharpe) #5

Hi @tbaatar,

It sounds like you already have a product database which exists outside Matrix? Matrix has a wide variety of assets designed for ingesting external data (which automatically creates and updates corresponding Assets inside Matrix), and perhaps the “DB Connector” asset is what you’re after: https://matrix.squiz.net/manuals/data

I couldn’t find a tutorial for the DB Connector however I did find this.
A lot of the data source assets behave similarly, so bits of this will still apply: https://matrix.squiz.net/tutorials/2016/how-to-create-an-rss-data-source-listing

Fundamentally, Matrix is designed around assets and the URL structure mimics your IA. Even externally sourced data become assets in Matrix which allow them to get a URL and become part of your IA.

Regarding content migration, Squiz have proprietary tools designed for just this purpose and if you’ve got a current contract I’d recommend getting in contact with your Service Delivery Manager or Account Manager to discuss options.

Hope that helps, Andrew