is it possible to browse by node id ?

Author Message

kracker (the)

Thursday 18 January 2007 5:22:38 am

I would be happy to test your patch and provide feedback / notes.

<i>//kracker
12 oz. Mouse ... a mad show to watch on repeat for hours at a time ...</i>

Member since: 2001.07.13 || http://ezpedia.se7enx.com/

Kristof Coomans

Thursday 18 January 2007 7:07:03 am

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 :-)

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Xavier Dutoit

Wednesday 24 January 2007 12: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 ;)

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+

http://www.sydesy.com

Kristof Coomans

Wednesday 24 January 2007 11:11:24 pm

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

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Marvix Marx

Wednesday 07 February 2007 3:23:25 am

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 :)

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 ;)

Thanks alot.

Softriva .com

Friday 09 March 2007 9:30:07 pm

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

Softriva .com

Saturday 10 March 2007 3:14:45 am

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

Softriva .com

Tuesday 13 March 2007 7:36:51 am

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.

Kristof Coomans

Tuesday 13 March 2007 9:24:32 am

Hi OOzy

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

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Softriva .com

Saturday 31 March 2007 7:19:41 am

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 = ""

Softriva .com

Saturday 31 March 2007 12: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?

*- pike

Monday 04 February 2008 5:49:02 pm

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> :-)

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

---------------
The class eZContentObjectTreeNode does.

*- pike

Sunday 09 March 2008 6:28:59 am

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/html/eznamepatternresolver_8php-source.html .

Is it new ?

*-pike

---------------
The class eZContentObjectTreeNode does.

Heath

Sunday 09 March 2008 1:38:32 pm

Well,

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

http://pubsvn.ez.no/nextgen/stable/3.10/kernel/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

Brookins Consulting | http://brookinsconsulting.com/
Certified | http://auth.ez.no/certification/verify/380350
Solutions | http://projects.ez.no/users/community/brookins_consulting
eZpedia community documentation project | http://ezpedia.org

*- pike

Thursday 26 February 2009 4:12:41 pm

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/html/classeZNamePatternResolver.html#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/install_configuration/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

---------------
The class eZContentObjectTreeNode does.

Heath

Friday 17 July 2009 7:57:47 am

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 :)

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

Cheers,
Heath

Brookins Consulting | http://brookinsconsulting.com/
Certified | http://auth.ez.no/certification/verify/380350
Solutions | http://projects.ez.no/users/community/brookins_consulting
eZpedia community documentation project | http://ezpedia.org

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.