Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: RE: Possibility to reserve an url following a regex
Hello,
I am trying to configure a route in my angular
customElement, but if I change the url, Liferay think I am in an other
page.
Example, we have a page /contracts where we can see a list
of all the contracts and we want to see the detail of a contract 12 in
the page /contracts/12, Liferay try to find this page but we want to
stay on the page /contracts with the url /contracts/12 and our angular
app will show the detail of the contract 12.
Is it possible to
ignore the end of an url ?
For a site we can redirect or create
alias but we want to do this for all our sites (we have a site
template)
It would be great if a customElement can
"reserve" an url matching a regex like we can do with a
standard portlet (friendlyurl route)
Eric.
Hello Eric,
When you register a custom element, you can set a friendly URL mapping.
Suppose you pur "foo" in that field, then you will be allowed to implement a router supporting this kind of URLs:
http://localhost:8080/web/guest/home/-/foo/contracts/12
/-/ is the friendly URL separator which makes it possible for Liferay to identify where the layout part of the URL ends.
When you register such friendly URL mapping for custom elements, the page will not reload when you follow links with that pattern.
Kind regards,
Fabian
Yes, it is exactly what we want.
It now works for us.
Thanks Fabian.