Quote from: mattcdavis1 at Sep 20, 2009, 02:03 PM
I’m trying to use a symlink but so far unsuccesfully. Can someone checkout my attempt and see if I’m doing something wrong? My understanding is that if url_id_80 points to url_id_15 then when I got to url_id_80 it should be the exact same as going to url_id_15. However, it’s not working that way for me.
UPDATE: I figured out what I was doing wrong. I was clicking-and-dragging to fill in the Symlink field which put a link tag around the resource. Instead, I just needed to put the resource number and nothing else.
It should put the number there.
Would you put that on Jira (the link at the top of this page) so it doesn’t fall through the cracks?
Quote from: BobRay at Sep 20, 2009, 06:05 PM
Would you put that on Jira (the link at the top of this page) so it doesn’t fall through the cracks?
Done.
God does not save those who are only imaginary sinners. Be a sinner, and let your sins be strong, but let your trust in Christ be stronger, and rejoice in Christ who is the victor over sin, death, and the world.
Quote from: mattcdavis1 at Sep 20, 2009, 07:44 PM
Quote from: BobRay at Sep 20, 2009, 06:05 PM
Would you put that on Jira (the link at the top of this page) so it doesn’t fall through the cracks?
Done.
Thanks!
Quote from: BobRay at Feb 24, 2009, 11:37 PM
Am I correct in assuming that they are only for use as pseudo-documents that Wayfinder and other menu snippets can use to produce menu items?
Bob -- have you had any luck using symlinks in this way (for menus)? I’m trying to use a symlink for menu purposes but when I use modx->getParentIds on the symlink page it gets the parent ids of the target document as opposed to the symlink itself. Is this expected behavior? Is there a way to access attributes of the symlink itself rather than the document it targets?
-matt
God does not save those who are only imaginary sinners. Be a sinner, and let your sins be strong, but let your trust in Christ be stronger, and rejoice in Christ who is the victor over sin, death, and the world.
Quote from: mattcdavis1 at Sep 20, 2009, 10:06 PM
Quote from: BobRay at Feb 24, 2009, 11:37 PM
Am I correct in assuming that they are only for use as pseudo-documents that Wayfinder and other menu snippets can use to produce menu items?
Bob -- have you had any luck using symlinks in this way (for menus)? I’m trying to use a symlink for menu purposes but when I use modx->getParentIds on the symlink page it gets the parent ids of the target document as opposed to the symlink itself. Is this expected behavior? Is there a way to access attributes of the symlink itself rather than the document it targets?
-matt
I tested them briefly, but haven’t had any real use for them so, no.
Are you using Wayfinder to produce the menu? I think it’s smart enough to get the correct parent for you.
I’m not clear on where you’re putting $modx->getParentIds(). If it’s in a snippet whose tag is on the page referred to by the symlink, it would be expected that the parentIds would be of that page. The resulting page from a symlink will also use the template of the page referred to by the symlink, rather than that of the symlink itself.
Hope this makes sense.
Quote from: BobRay at Sep 20, 2009, 10:26 PM
Are you using Wayfinder to produce the menu? I think it’s smart enough to get the correct parent for you.
I’m actually trying to construct a breadcrumbs menu - not sure that wayfinder is the best best since breadcrumbs need to go the opposite direction on the tree.
Quote from: BobRay at Sep 20, 2009, 10:26 PM
I’m not clear on where you’re putting $modx->getParentIds(). If it’s in a snippet whose tag is on the page referred to by the symlink, it would be expected that the parentIds would be of that page. The resulting page from a symlink will also use the template of the page referred to by the symlink, rather than that of the symlink itself.
The snippet call originates from the template used by the symlink target. The symlink is id 84 and it’s parent is 82. However, when I got to page 84 the parent shows as 0 since that is the parent of the symlink target. I’m trying to avoid duplicating a long list of categories in duplicate sections by keeping all the categories in one folders. So, instead of Audio/Video > category 1, category 2, etc. and then Articles > (repeat all the same category documents again) I can use the same list of categories for multiple different media types.
If I were to duplicate the categories under each media type then populating the menu would be simple, but since I’m trying to keep from duplicating the categories (and the resources they hold) the menu structure doesn’t exist naturally in the tree. I was hoping to circumvent this with symlinks but I’m not sure if that’s going to work.
God does not save those who are only imaginary sinners. Be a sinner, and let your sins be strong, but let your trust in Christ be stronger, and rejoice in Christ who is the victor over sin, death, and the world.
Quote from: OpenGeek at Sep 20, 2009, 11:35 PM
I think you are going to need to author a custom snippet to do this; it will need to read the original symlink data, though you will have to get this by using the originally requested Symlink Resource id (HINT: you can get this from $_GET[’q’] or $_GET[$modx->getOption(’request_param_alias’)] if using friendly_urls and friendly_alias_urls, then looking up the original Resource id from $modx->aliasMap, e.g. $origId = $modx->aliasMap[$_GET[’q’]]) and querying that data in the db. You can also use $modx->getParentIds() to get the reverse tree structure for the breadcrumbs.
Thanks for the input - I decided to just go ahead and use $_GET variables to track the referring page because even if I figure out how to dynamically get the symlink ID (as opposed to symlink target id), if I end up needing to go another level deep in the structure (i.e. symlink_target > subdirectory) there’ll be no way to trace back the path.
So I just used "media=mediatype" in the url and then some conditional logic to replace the top of the nav tree with the path that I want.
if(toplevel_folder == media_folder) {replace id and pagetitle with predefined chunk based on referring page) so media > Bible gets changed to Audio-Video > Categories > Bible (assuming $_GET[’media=audiovideo&tab=categories]).
It’s not an ideal solution because I don’t like cluttering up my url’s, but I think I’m just going to have to live with it. It’s definitely better than duplicating a whole bunch of resources.
God does not save those who are only imaginary sinners. Be a sinner, and let your sins be strong, but let your trust in Christ be stronger, and rejoice in Christ who is the victor over sin, death, and the world.
-
MODX Staff
- 10,725 Posts
Sounds to me like you need tag-based navigation to be honest. You can use TV’s to select tags for individual documents and build navigation using that data.
Quote from: OpenGeek at Sep 21, 2009, 11:39 AM
Sounds to me like you need tag-based navigation to be honest. You can use TV’s to select tags for individual documents and build navigation using that data.
That sounds like a great idea - I’ll look into that.
God does not save those who are only imaginary sinners. Be a sinner, and let your sins be strong, but let your trust in Christ be stronger, and rejoice in Christ who is the victor over sin, death, and the world.