Share » Forums » Setup & design » nice URLs

nice URLs

nice URLs

Wednesday 26 March 2003 9:06:07 pm - 13 replies

Author Message

Bård Farstad

Thursday 27 March 2003 12:22:19 am

The nice url's is a built in automatic feature of eZ publish 3. When building urls in the template you just need to as for url_alias from the node. E.g. <a href={$node.url_alias|ezurl}>link</a>.

the ezurl operator will fix any prepending needed to the url.

--bård

Documentation: http://ez.no/doc

Milan Gabor

Thursday 27 March 2003 3:19:12 am

Where do you fill this url_alias field?
Where is defined?

Bård Farstad

Thursday 27 March 2003 3:30:31 am

When you change the templates for eZ publish you get access to the node. So in e.g. line.tpl you can change the link to the node to use the automatic url conversion. In the template you can access this by:
{$node.url_alias}

The url alias is automatically generated from the object names of the parent object, i.e. the "path". It will convert the name to lower case 0-9 a-z and _ characters.

--bård

Documentation: http://ez.no/doc

Bruce Morrison

Thursday 27 March 2003 4:26:49 pm

Ok I have the system generating the URLs but I suspect there is a little more to it.

In site.ini there is this section

[URLTranslator]
# Use either enabled or disabled
Translation=enabled
# Enable this if you want to percieve the url as a path element
# for the node tree. By entering the path in the url and ending it
# with a .html you will get the correct node.
NodeTranslator=enabled

I've cleared the ini cache but I'm still getting

Module not found

* The requested module 'frontpage20' could not be found.

and the URL
http://dit.dev-linux-1/user/frontpage20/articles/new_article
(internal site)

What am I missing?

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Tony Wood

Friday 28 March 2003 12:19:41 am

Bruce,

I have been testing this and have not been able to get 'nice' urls... You are right there has to be something more to it.

Tony Wood : twitter.com/tonywood
Vision with Technology
Experts in eZ Publish consulting & development

Power to the Editor!

Free eZ Training : http://www.VisionWT.com/training
eZ Future Podcast : http://www.VisionWT.com/eZ-Future

Bård Farstad

Friday 28 March 2003 1:28:52 am

I just downloaded the 3.0 dist to see why you didn't get this to work. And the solution is simple, put this in site.ini

[URLTranslator]
Translation=enabled
NodeTranslation=enabled

NOTE: 3.0 has a typo in the released site.ini NodeTranslation is spelled wrong. It says NodeTranslator as default, this is wrong.

Hopefully now, you can enjoy human readable URLs.

--bård

Documentation: http://ez.no/doc

Tony Wood

Friday 28 March 2003 1:48:54 am

Yep that works... Thanks

any idea when we can implement URL mapping like in 2.x

i.e. '/about' = '/content/view/full/99/'

Tony Wood : twitter.com/tonywood
Vision with Technology
Experts in eZ Publish consulting & development

Power to the Editor!

Free eZ Training : http://www.VisionWT.com/training
eZ Future Podcast : http://www.VisionWT.com/eZ-Future

Bård Farstad

Friday 28 March 2003 2:11:51 am

URL translation is on our todo, but we haven't decided when to do this. Actually we've found that the built in URL translations is better to use since the URLs will map directly to the site structure.

We will have an announcement about what we will focus on for 3.1 soon. This will of course be open for discussion.

--bård

Documentation: http://ez.no/doc

Bruce Morrison

Sunday 30 March 2003 8:16:30 pm

I did find and ran update/common/scripts/updateniceurls.php to get this working.

Is this due to the site bening updated from RC2 ?

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

John Hoskins

Wednesday 02 April 2003 12:35:07 pm

So I followed your note above about enabling URLTranslation. So where should it appear on what admin page? I look through all the admin temlpate files and nothing about URL Translation appears. Where do these mappings go?

And not to get lost in translation, I want to make /aboutus go to the right page /content/view/....

Thanks

Scot Wilcoxon

Monday 21 April 2003 4:32:03 am

I think you want http://www.example.com/aboutus to be directed to a certain page. It sounds like eZp3 does not have that "url translation" feature which was in eZp2. You'll have to use web server Rewrite rules (or something like aboutus.html with a redirect) to do the translation.

I'll also point out that a previous comment mentioned that URLs are created based on node names, but the phrasing was a little obtuse. A name "Archive of Old News Articles" appears as "archive_of_old_news_articles". It would be nice to be able to define a "label" for items, so with a label of "newsarchive", a URL like "news/newsarchive" would appear instead of "public_relations_announcements/archive_of_old_news_articles" (obviously, with the "Public Relations Announcements" page having a label of "news").

Alessandro Ranellucci

Tuesday 22 April 2003 1:12:18 am

What about configuring mod_rewrite to map /about to /content/view/... ?

Sergey Burakovsky

Tuesday 03 June 2003 1:17:50 pm

I used the solution above, I tried "ezurl" and "ezroot".
All urls in my project becomes like "http://www.ez.no/developer/ez_publish_3/forum/setup_design/all_about_ezurl" or like "http://www.ez.no/index.pph/developer/ez_publish_3/forum/setup_design/all_about_ezurl".
But I still see "Module not found".
When I create articles in Russian language, url becomes like "index.php/news/frontpage/__1"? Why?

Can anyone give me step-by-step solution?

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu