eZ Community » Forums » Install & configuration » is it possible to browse by node id ?
expandshrink

is it possible to browse by node id ?

is it possible to browse by node id ?

Friday 05 January 2007 5:51:13 pm - 35 replies

Hi ...

Is there are any way to remove the /node_45/node_55/ to /45/55 when the site charset is utf8 ?

Thx in advanced

Thursday 18 January 2007 4:07:03 pm

There seem to exist ways to influence which characters are stripped or converted for the url alias: http://ez.no/community/forum/developer/how_to_make_unicode_url_s

For the url alias, the group urlalias is used in transform.ini. I didn't play with it yet, but as you see there is always something new to discover in the kernel happy.gif Emoticon

Wednesday 24 January 2007 9:36:17 pm

Hi K,

I was looking for a way to shorten the urls if needed (because_some_of_my_clients_dont_have_any_sense_of_keeping_title_at_a_resonnable_size blunk.gif Emoticon

Could you put your patch on the svn so I can try to hack it more and try adding some kind of limits of the length ?

X+

Thursday 25 January 2007 8:11:24 am

OK here you go: http://ezpedia.org/wiki/en/ez/url_alias_name_pattern

Wednesday 07 February 2007 12:23:25 pm

Hi ,,,

Sorry Kristof for this delay, we got busy with new year promotion items for one of our client ^^

Thanks alot for your patch, but in the read file "patched files against 3.9 stable branch rev. 17879" ... NICE happy.gif Emoticon

I had patched the kernel file as above, and changed the "_node", now its look like this:
site.com/45/585/45 <-- just node id if utf8, and its work fine, this was done befor your patch, so didn`t test your patch yet, but if it the new revision will be great .. to remove the "_node" if charset is utf will good also, no need to fill extra field for the url pattern always blunk.gif Emoticon

Thanks alot.

Saturday 10 March 2007 6:30:07 am

The patch did not work for me. I am running 3.9 svn 17706. Any help?

Will this patch be implemented in 3.9.1. What is ez system proposed solution to this issue?

Where can I find (patched files against 3.9 stable branch rev. 17879)

Thank you

Saturday 10 March 2007 12:14:45 pm

Kristof,

Ok, the patch works ok for me after finding out that I copied the .php to /class rather than /classes in the kernel dir.

My concerne is what would happen in future releaes? Do we have to do the patch every time we upgrade?

Thank you,

OOzy

Tuesday 13 March 2007 3:36:51 pm

Kristof,

Do you have any idea if this patch will be part of future releases of ezp? Do eZ System have an alternative solution to this issue?

Please answer me as I am on hold for this issue to be solved before I processed.

Thank you.

Modified on Tuesday 13 March 2007 3:37:35 pm by Softriva .com

Tuesday 13 March 2007 5:24:32 pm

Hi OOzy

I have no idea. I'll post an enhancement request: http://issues.ez.no/10439

Saturday 31 March 2007 4:19:41 pm

Dears

I have tried the out-of-the-box feature for url-translation using the transform.ini. Everything worked ok except of diacritical letters.

The site I am developing is in English and Arabic. Any idea how to get ez to transform the diacritical letters?

Here is the settings in transform.ini

# The arabic group
Charsets[]=cp864;arabic
Charsets[]=iso-8859-6;arabic
Charsets[]=windows-1256;arabic
Charsets[]=cp1256;arabic
Charsets[]=utf-8;arabic

[arabic]
Files[]=arabic.tr
Extensions[]

Here is the actual arabic.tr which should go inside the ez/share/transformations directory

# Rules related to arabic
#
# The following charsets uses characters from hebrew:
# cp864, iso-8859-6, windows-1256
#
# See basic.tr for formatting options

# Transliteration of arabic, is used in URLs and identifiers

arabic_transliterate_ascii:

U+0621 = "aa"
U+0622 = "aa"
U+0623 = "a"
U+0624 = "uw"
U+0625 = "e"
U+0626 = ""
U+0627 = "a"
U+0628 = "b"
U+0629 = "ah"
U+062A = "t"
U+062B = "th"
U+062C = "j"
U+062D = "h"
U+062E = "kh"
U+062F = "d"
U+0630 = "th"
U+0631 = "r"
U+0632 = "z"
U+0633 = "s"
U+0634 = "sh"
U+0635 = "ss"
U+0636 = "dh"
U+0637 = "tt"
U+0638 = "za"
U+0639 = "a"
U+063A = "gh"
U+0640 = ""
U+0641 = "f"
U+0642 = "q"
U+0643 = "k"
U+0644 = "l"
U+0645 = "m"
U+0646 = "n"
U+0647 = "h"
U+0648 = "w"
U+0649 = "ae"
U+064A = "y"
U+0661 = "1"
U+0662 = "2"
U+0663 = "3"
U+0664 = "4"
U+0665 = "5"
U+0666 = "6"
U+0667 = "7"
U+0668 = "8"
U+0669 = "9"

arabic_diacritical:
U+064B = "n"
U+064C = "uu"
U+064D = "ii"
U+064E = "a"
U+064F = "u"
U+0650 = "i"
U+0651 = ""
U+0652 = ""

I also tried

# Rules related to arabic
#
# The following charsets uses characters from hebrew:
# cp864, iso-8859-6, windows-1256
#
# See basic.tr for formatting options

# Transliteration of arabic, is used in URLs and identifiers

arabic_transliterate_ascii:

U+0621 = "aa"
U+0622 = "aa"
U+0623 = "a"
U+0624 = "uw"
U+0625 = "e"
U+0626 = ""
U+0627 = "a"
U+0628 = "b"
U+0629 = "ah"
U+062A = "t"
U+062B = "th"
U+062C = "j"
U+062D = "h"
U+062E = "kh"
U+062F = "d"
U+0630 = "th"
U+0631 = "r"
U+0632 = "z"
U+0633 = "s"
U+0634 = "sh"
U+0635 = "ss"
U+0636 = "dh"
U+0637 = "tt"
U+0638 = "za"
U+0639 = "a"
U+063A = "gh"
U+0640 = ""
U+0641 = "f"
U+0642 = "q"
U+0643 = "k"
U+0644 = "l"
U+0645 = "m"
U+0646 = "n"
U+0647 = "h"
U+0648 = "w"
U+0649 = "ae"
U+064A = "y"
U+0661 = "1"
U+0662 = "2"
U+0663 = "3"
U+0664 = "4"
U+0665 = "5"
U+0666 = "6"
U+0667 = "7"
U+0668 = "8"
U+0669 = "9"
U+064B = "n"
U+064C = "uu"
U+064D = "ii"
U+064E = "a"
U+064F = "u"
U+0650 = "i"
U+0651 = ""
U+0652 = ""

Saturday 31 March 2007 9:26:50 pm

Hello Guys/Gals,

I got this thing to work. I had to change the font. I don't know why. I had to choose a font for the admin site that does not support diacritical so ezp will do the transformation one-to-one.

I know it is not the right way.

Anyhow, does ezp actually support diacritical?

Tuesday 05 February 2008 2:49:02 am

Unlike the original poster, I actually *like* the /node_xx/node_yy shape of urls. I can currently (3.10) get it by putting in a broken url alias pattern, like <doh> happy.gif Emoticon

But then, i'd like the /xx/yy form even better. And the Url alias pattern still doesn't allow that - you can only use attributes (things from the data_map) in a name pattern.

So I'm still wondering where to hack the "node_" out of the name pattern, or make the urlalias pattern smart enough to recognize <node_id> and a few friends. Would ezContentObject::rename be a nice place ?

thanks,
*-pike

Modified on Sunday 09 March 2008 1:45:47 pm by *- pike

Sunday 09 March 2008 2:28:59 pm

or (still looking at it), probably its better to hack eznamepatternresolver (in 3.10).

to support a pattern like <#class_identifier>:<#node_id>, these two 'tokens' should be recognized by eznamepatternresolver::resolveToken( $token )

perhaps they need to be added to $this->attributeArray in eZNamePatternResolver::fetchContentAttributes. also, method tokenParts() will have some trouble with the # sign. The \W perl regexp does recognize _, so maybe use "_node_id" instead ...

The annoying thing is, I cant find eznamepatternresolver in "my" version of 3.10.
It is in doxygen: http://pubsvn.ez.no/doxygen/3.10/...namepatternresolver_8php-source.html .

Is it new ?

*-pike

Modified on Sunday 09 March 2008 2:46:41 pm by *- pike

Sunday 09 March 2008 9:38:32 pm

Well,

The class file you mention is available in the latest stable branch of subversion.

http://pubsvn.ez.no/nextgen/stabl...el/classes/eznamepatternresolver.php

I'm not certain about the official packaged history with regard to this file offhand. Yet the svn log history does share a bit detail which may be helpful.

http://pastebin.ca/935661

Cheers,
Heath

Friday 27 February 2009 1:12:41 am

Sorry, you're right, it is there now.

And my hack seems to work sofar. In 3.10, I've added a few lines to kernel/classes/eznamepatternresolver.php: at the end of fetchContentAttributes
http://pubsvn.ez.no/doxygen/3.10/...tml#2e5fd3231124f9a79c3cdeb35a8b47c9

I added


        /*
        	====== START PIKE HACK  =======
        	*-pike  2009/02/27 support for pseudo attributes 
        	
        */
        
        $this->attributeArray["_main_node_id_"] = $this->contentObject->mainNodeID();
        $this->attributeArray["_class_identifier_"] = $this->contentObject->contentClassIdentifier();
        $this->attributeArray["_class_name_"] = $this->contentObject->className();
        
        /*
        	====== END PIKE HACK   =======
        	
        */

Now if I set the "URL alias name pattern": of the "article" class to

<_class_name_> <_main_node_id_>

And create a new article in Testing/Testing, I get a url like
http://my.site/Testing/Testing/Page-33082

.. regardless of the title of the node.

The benefit is not getting these crazy urls from verbose titles
take the url from this forumtopic:
http://ez.no/developer/forum/inst.../is_it_possible_to_browse_by_node_id
that could become
http://ez.no/developer/forum/forum14/topic27
which is imho much better.

That's pretty exciting. I wonder just how scary that hack is, and what would break ? Can anyone tell me ? I want to actually start using this on an active live site...

thanks,
*-pike

Modified on Friday 27 February 2009 11:59:20 am by *- pike

Friday 17 July 2009 4:57:47 pm

I heard of kracker has helped some folks in #ezpublish today
to be able to create objects without using the name / short
name attribute (which was what was requested at the time) using eZ publish 4.0.1

Say like a class with only a file attribute with no attributes required in the class.

And nothing defined in, the class definition's "Object name pattern"
and "URL alias name pattern". Save these changes.

Created a content object using this image only attribute
content class 'file-only'. Enter a file only for upload and
do not specify the alternate text.

The content object will be created and the original filename uploaded will be used as the name patterns happy.gif Emoticon

Sorry if this is only loosely related or not at all.

Cheers,
Heath

expandshrink

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

36 542 Users on board!

Forums menu