[Question] Custom Alias with hidden parameters v7 or v8

Victor Hugo Garcia asked on April 14, 2014 13:53

Hello friends,

I'm dealing with an issue in how to make something to work correctly in Kentico, here is what I have:

I'm consuming a Web Service that retrieves external products and each product, so we would like to generate a template where we can access those products using an alias like this: /products/name_of_product

Since the web service is external, we can only filter by Product ID, so I was wondering what is the best approach you suggest to display those products from external service and make them using pretty URLs like the one mentioned above.

Note: we are not storing anything in Kentico.

I was thinking if possible to create 1 content and 1 alias assigned to it like this: /products/{name} and then setup somehow a hidden parameter where I can refer and retrieve the product ID in the template, to display the details of the product.

Any help or suggestion is always welcome.

Thanks

Recent Answers


John Flores answered on April 14, 2014 13:59

I am also having the same problem. any suggestions are welcome

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on April 15, 2014 06:44

The key would be to have that mapping of ID and unique URL key already setup on your external service. For instance: the-fancy-name-of-your-product = productID 876109234

OR

You could have 2 parameters in your URL for instance /products/the-fancy-name-of-your-product/876109234. This will allow you to get some SEO as well as still get the ID as needed

1 votesVote for this answer Mark as a Correct answer

Victor Hugo Garcia answered on April 15, 2014 11:17

Well, then seems there is no other way.. I'll see if I can match that by using the Alias as unique ID.

Thank you!

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on April 15, 2014 16:39

Personally I like the second option better as it gives you both items although not the most clean URL. I think both will work, the first option will involve more work though.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.