Forums / General / Linking to objects using their alias in ezoe GUI

Linking to objects using their alias in ezoe GUI

Author Message

Russell Michell

Tuesday 14 September 2010 3:34:35 pm

Hi all,

When using ezoe's link-create/edit GUI, I'd like to be able to have a link created that uses an object's custom URL alias.

Currently in ezoe, you can link to a node_id, object_id, http, https etc but there's no way to choose which virtual URL will be used for the link.

Here's an example of what I mean:

Say I have an article content-object: node_id = 7116, short_title = 'my page'. It normally exists at: 2/183/7116 (Main/Folder1/my-page).

I then add an additional location to the object: eZ generates a new node_id and the clone's location is at: 2/184/7117 (Main/Folder2/my-page).

Now I create a custom alias for Main/Folder2/my-page: Main/Folder2/your-page, and would like to link to this object but using the alias as the url.

At the moment when I save/preview the article, the link has actually been created using the original object's short_title not the clone's alias.

Is there a way for ezoe to check if an alias exists for an object being linked-to in the popup dialogue, and prompt the user for which URL they would like to be used?

I hope this makes sense, or there might be an alternative solution that I haven't seen yet. At the moment, the only use for additional aliases is when linking in template overrides, but not for standard linking from ezoe, without needing to write any code.

Thanks a lot.
Russ

Russell Michell, Wellington, New Zealand.
We're building! http://www.theruss.com/blog/
I'm on Twitter: http://twitter.com/therussdotcom

Believe nothing, consider everything.

Gabriel Finkelstein

Tuesday 14 September 2010 4:32:39 pm

Why not just use Main/Folder2/your-page as the link?

I havent tried this, but maybe you could edit templates/content/datatype/view/ezxmltags/link.tpl and do:

$node = fetch(content, node, hash( node_path, $href ));

If a node matches, then find a way of getting its url aliases and use one that was created manually. If no node matches, just leave $href as the link. To find a node's url aliases you can make a template operator that searches the ezurlalias table.

Russell Michell

Tuesday 14 September 2010 6:54:06 pm

>Why not just use Main/Folder2/your-page as the link?

That's exactly it - you can't. You can link to the node_id or object_id etc but the generated path is the original auto-generated alias, not one of the custom aliases - hence my wondering how one might modify ezoe to ask the user which custom alias she would like to use (if one exists).

Thanks for taking the time to reply Gabriel but I was wondering wether this was do-able from the ezoe GUI without writing code - it seems to me otherwise that the custom URL alias's are only of limited use if they cannot be utilised at the GUI level.

I thought of the template override method as well, but cannot seem to retrieve a node using this kind of fetch (no error message) - thanks a lot regardless

Russ

Russell Michell, Wellington, New Zealand.
We're building! http://www.theruss.com/blog/
I'm on Twitter: http://twitter.com/therussdotcom

Believe nothing, consider everything.

Russell Michell

Tuesday 14 September 2010 7:09:44 pm

I have added this as enhancement 17284.

Cheers all,
Russ

Russell Michell, Wellington, New Zealand.
We're building! http://www.theruss.com/blog/
I'm on Twitter: http://twitter.com/therussdotcom

Believe nothing, consider everything.

Gabriel Finkelstein

Wednesday 15 September 2010 9:47:42 am

"

Why not just use Main/Folder2/your-page as the link?

"

What I mean is, why not just put "/Main/Folder2/your-page" as a regular link instead of an eznode link? Letting you choose which url alias you want to use is almost the same as typing the url yourself in the href input.

Russell Michell

Wednesday 15 September 2010 2:01:58 pm

"
"

Why not just use Main/Folder2/your-page as the link?

"

What I mean is, why not just put "/Main/Folder2/your-page" as a regular link instead of an eznode link? Letting you choose which url alias you want to use is almost the same as typing the url yourself in the href input.

"

Ah I see. I trued the full path (inc hostname) but that didn't work in my scenario (Static deployment) but using the URI (the pathname) did! I'd never bothered to look at using the 'other' field - but that works.

I maintain that some functionality in ezoe that prompts for an existing alias selection would be idea, but this will do me for now.

Thank you so much for your perseverance Gabriel! :-)

Have a good one!
Russ

Russell Michell, Wellington, New Zealand.
We're building! http://www.theruss.com/blog/
I'm on Twitter: http://twitter.com/therussdotcom

Believe nothing, consider everything.

eZ debug

Timing: Jan 18 2025 02:06:17
Script start
Timing: Jan 18 2025 02:06:17
Module start 'content'
Timing: Jan 18 2025 02:06:18
Module end 'content'
Timing: Jan 18 2025 02:06:18
Script end

Main resources:

Total runtime0.8878 sec
Peak memory usage4,096.0000 KB
Database Queries204

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0064 588.9688180.8203
Module start 'content' 0.00640.7347 769.7891598.5625
Module end 'content' 0.74110.1466 1,368.3516341.3750
Script end 0.8877  1,709.7266 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00400.4473210.0002
Check MTime0.00150.1688210.0001
Mysql Total
Database connection0.00090.102710.0009
Mysqli_queries0.800290.13342040.0039
Looping result0.00230.26162020.0000
Template Total0.852696.020.4263
Template load0.00190.216520.0010
Template processing0.850795.821820.4253
Template load and register function0.00010.010210.0001
states
state_id_array0.00170.196210.0017
state_identifier_array0.00140.153620.0007
Override
Cache load0.00170.1951560.0000
Sytem overhead
Fetch class attribute can translate value0.00120.137030.0004
Fetch class attribute name0.00110.129080.0001
XML
Image XML parsing0.00110.128730.0004
class_abstraction
Instantiating content class attribute0.00000.0027120.0000
General
dbfile0.00430.4871330.0001
String conversion0.00000.000730.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
6content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
16content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/strong.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/strong.tplEdit templateOverride template
2content/datatype/view/ezxmltags/emphasize.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/emphasize.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
3content/datatype/view/ezxmltags/quote.tpldatatype/ezxmltext/quote.tplextension/ezwebin/design/ezwebin/override/templates/datatype/ezxmltext/quote.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 41
 Number of unique templates used: 11

Time used to render debug report: 0.0002 secs