Foros de discusión

Change asset publisher to display friendly URLs that are ONLY the title?

thumbnail
Brian Scott Schupbach, modificado hace 11 años.

Change asset publisher to display friendly URLs that are ONLY the title?

Expert Mensajes: 329 Fecha de incorporación: 23/10/08 Mensajes recientes
I need the asset publisher to only display titles instead of something like this before the title "/-/asset_publisher/NqaVobJd3810/content/" . Is this possible?

So, for example, if I have a web content title of "Here is my title", then I would like the URL to be http://mysite.com/here-is-my-title instead of http://mysite.com/-/asset_publisher/NqaVobJd3810/content/here-is-my-title

Any help on how to get started on this would be greatly appreciated.

Thank you,

Brian
thumbnail
Brian Scott Schupbach, modificado hace 11 años.

RE: Change asset publisher to display friendly URLs that are ONLY the title (Respuesta)

Expert Mensajes: 329 Fecha de incorporación: 23/10/08 Mensajes recientes
Looks like this is already existing..

First you'll need to create a page and add the asset publisher to it. In the configuration options you'll need to check the box next to the option that sets the asset publisher as the default publisher for the page. Then when creating your piece of web content click on the "display page" option and select the page you just created. After the content has been published it can be added to any other asset publishers on the site and it will open up with a friendly URL on the page you specified.

Brian
Peter Kowski, modificado hace 11 años.

RE: Change asset publisher to display friendly URLs that are ONLY the title

Junior Member Mensajes: 26 Fecha de incorporación: 1/08/12 Mensajes recientes
Hi Brian. This is really neat functionality and something I am trying to make more use of as well. However what I am trying to do is to further enrich my friendly URL's by adding some more depth to them. e.g. Using the example you have, we now know that these 2 URL's are the same:
http://mysite.com/-/here-is-my-title
http://mysite.com/-/asset_publisher/NqaVobJd3810/content/here-is-my-title

What I would ideally like are friendly URL's of the form http://mysite.com/news/-/here-is-my-title and http://mysite.com/sports/-/here-is-another-title

Do you (or anybody else) know how this could be achieved? I presume I would have to make use of some sort of a hook or find some other way of modifying the asset publesher friendly URLs.
thumbnail
Brian Scott Schupbach, modificado hace 11 años.

RE: Change asset publisher to display friendly URLs that are ONLY the title

Expert Mensajes: 329 Fecha de incorporación: 23/10/08 Mensajes recientes
Hello,

Checkout the urlrewrite.xml file. From this file you can find the asset publisher where it name spaces the URL by using the '-'. You could then change that to 'sports'. So, then your URL's would look something like mysite.com/sports/here-is-another-title. I haven't done this myself but I believe it is possible. Good luck and let me know how it goes.

Brian
Peter Kowski, modificado hace 11 años.

RE: Change asset publisher to display friendly URLs that are ONLY the title

Junior Member Mensajes: 26 Fecha de incorporación: 1/08/12 Mensajes recientes
Hi Brian, Thanks for the tip. I still haven't managed to do what you suggested, but I think this looks like a global change. (i.e. the word "sports" would apply to all web contents). In any case, I will let you know how it goes.

I have another question related to these friendly URL's for web contents. Do you have any idea on how I can force a 404 if a web content is not found. At the moment, by default, a petiton to www.site.com/-/a-web-content-that-does-not-exist gets redirected to the home page. This effectively gives the site an infinite number of URLs for the home page (which is not very SEO friendly).
thumbnail
Brian Scott Schupbach, modificado hace 11 años.

RE: Change asset publisher to display friendly URLs that are ONLY the title

Expert Mensajes: 329 Fecha de incorporación: 23/10/08 Mensajes recientes
What version are you using? I'm not having this issue with 6.1 GA1

Thanks,

Brian
Jan Hapunkt, modificado hace 11 años.

RE: Change asset publisher to display friendly URLs that are ONLY the title

New Member Mensaje: 1 Fecha de incorporación: 17/12/12 Mensajes recientes
Hi! I installed a new liferay from scratch, created a site "test" und put an assetpublisher on it.. I went to configuration and set the "default" option als mentioned. I also tagged related the "what-we-do" article to this site.

If I open the "what-we-do" article, I got this url:

localhost:8080/web/guest/test/-/asset_publisher/2synJuNhurC3/content/what-we-do?redirect=http%3A%2F%2Fwww.iftportal.de%3A8080%2Fweb%2Fguest%2Ftest%3Fp_p_id%3D101_INSTANCE_2synJuNhurC3%26p_p_lifecycle%3D0%26p_p_state%3Dnormal%26p_p_mode%3Dview%26p_p_col_id%3Dcolumn-2%26p_p_col_count%3D1

In your post, you told I could now use this url instead:

http://www.iftportal.de:8080/web/guest/test/-/what-we-do

but this doesnt work...

what am I doing wrong?
thumbnail
Brian Scott Schupbach, modificado hace 11 años.

RE: Change asset publisher to display friendly URLs that are ONLY the title

Expert Mensajes: 329 Fecha de incorporación: 23/10/08 Mensajes recientes
Hi Jan,

You'll need to add an asset publisher to a page and then in the configuration select that it is the default asset publisher for the page. Then when you're editing your web content choose the "display page" link on the right-hand menu and select the page you created with the asset publisher on it. Now when you click on the article from another asset publisher it will display with the friendly URL on the new page.
RAVI RAJAMANI, modificado hace 7 años.

RE: Change asset publisher to display friendly URLs that are ONLY the title

Regular Member Mensajes: 123 Fecha de incorporación: 7/12/14 Mensajes recientes
Hi Brian Scott Schupbach,

This approach will work finely for web-content linked to asset publisher page.

How to achieve for the Blog type in the Asset publisher portlet ?
any customization was required ?
is by a) configuration
b) customization (hook or ext).

Kindly reply.

Regards,
Ravi R