<![CDATA[ Displaying resources from another context - My Forums]]> https://forums.modx.com/thread/?thread=83605 <![CDATA[Displaying resources from another context]]> https://forums.modx.com/thread/83605/displaying-resources-from-another-context?page=2#dis-post-461251
I've been trying for over 2 hours now to get it straight, but I can't seem to get it to work.

The problem is amazingly simple: I want to use the default Wayfinder technique to list a list of resources from "web" in "dashboard", both of which are fully working contexts. The ACLs are fine and everything is configured the way it's meant to, but I'm not getting ANY output out of Wayfinder.

Currently using this setup:

[[WayFinder?
	&startId=`71`
	&startIdContext=`web`
	&contexts=`web`
	&limit=`4`
	&level=`1`
	&sortBy=`publishedon`
	&sortOrder=`DESC`
	&ignoreHidden=`1`
	&cacheResults=`1`
	&rowTpl=`@INLINE:<li><a href="[[+wf.link]]">[[+wf.linktext]]</a>[[+wf.wrapper]]</li>`
]]


Resource #71 is in Context "web", wheras this piece of code is in the template assigned to the Home (site_start) resource from "dashboard".
I've tried both `context` and `startIdContext`, toggled them both (once without context, then once without startIdContext) and still nothing.
Sometimes `cacheResults` seems to work but then again it doesn't, which is FRAKKING annoying and also VERY strange.

See, I can simply build this code in my own snippet, but that seems far fetched as Wayfinder offers the functionality.

Help? smiley]]>
ReSpawN Apr 02, 2013, 08:18 AM https://forums.modx.com/thread/83605/displaying-resources-from-another-context?page=2#dis-post-461251
<![CDATA[Re: Displaying resources from another context]]> https://forums.modx.com/thread/83605/displaying-resources-from-another-context?page=2#dis-post-461444
$sp =& $scriptProperties;

$activeContext = $modx->context->get('key');
$context = $modx->getOption('wfStartIdContext', $sp, $modx->context->get('key'));

$modx->switchContext($context);
$menu = $modx->runSnippet('Wayfinder', $sp);
$modx->switchContext($activeContext);

return $menu;


Again, it returns the menu, but I have to force &scheme=`full` which also solved a lot of problems, but still, the native func. doesn't do me any good at this time...]]>
ReSpawN Apr 03, 2013, 08:42 AM https://forums.modx.com/thread/83605/displaying-resources-from-another-context?page=2#dis-post-461444
<![CDATA[Re: Displaying resources from another context]]> https://forums.modx.com/thread/83605/displaying-resources-from-another-context?page=2#dis-post-461441 My startIds are 42 and 71. smiley]]> ReSpawN Apr 03, 2013, 08:22 AM https://forums.modx.com/thread/83605/displaying-resources-from-another-context?page=2#dis-post-461441 <![CDATA[Re: Displaying resources from another context]]> https://forums.modx.com/thread/83605/displaying-resources-from-another-context?page=2#dis-post-461440
Is the problem with this property?
startIdContext=`othercontext`

Since your startId is 0, it should not be specified as from a specific Context...]]>
opengeek Apr 03, 2013, 08:11 AM https://forums.modx.com/thread/83605/displaying-resources-from-another-context?page=2#dis-post-461440
<![CDATA[Re: Displaying resources from another context]]> https://forums.modx.com/thread/83605/displaying-resources-from-another-context?page=2#dis-post-461439
Unfortunately your solution is already in place here, and isn't working. sad]]>
ReSpawN Apr 03, 2013, 08:01 AM https://forums.modx.com/thread/83605/displaying-resources-from-another-context?page=2#dis-post-461439
<![CDATA[Re: Displaying resources from another context]]> https://forums.modx.com/thread/83605/displaying-resources-from-another-context?page=2#dis-post-461431
					[[Wayfinder?
						&startId=`0`
						&level=`2`
                                                &contexts=`backoffice,web`
                                                &scheme=`full` 
						&outerTpl=`tpl.Wayfinder.outer`
						&parentRowTpl=`tpl.Wayfinder.row.parent`
						&innerRowTpl=`tpl.Wayfinder.row.inner`
						&rowTpl=`tpl.Wayfinder.row`                    
					]]


This works ONLY if you have done the following:

Added a site_url setting in the default system systems pointed to the "web" context domain name : http://www.domain.tld/ (don't forget the slash)
Added a site_start setting in each context pointing the context's home page.
Added a site_url setting in each context with the domain for that context: http://subdomain.domain.tld/ (don't forget the slash)

The scheme will build a full url for each link based on the context setting site_url, in this way you can have multiple contexts in one menu.

As far as the Manager is concerned, I see no real point in running Wayfinder, as how are you going to attach styling etc? It is much easier to simply create a Dashboard Widget, as show here: http://www.shawnwilkerson.com/modx-revolution/2012/11/26/site-summary-widget-/-snippet/]]>
wshawn Apr 03, 2013, 07:04 AM https://forums.modx.com/thread/83605/displaying-resources-from-another-context?page=2#dis-post-461431
<![CDATA[Re: Displaying resources from another context]]> https://forums.modx.com/thread/83605/displaying-resources-from-another-context?page=2#dis-post-461418
I remember trying this for my book, and found an issue with it, but that has been some time ago. I would think Shaun to have fixed it by now. Give me a couple of minutes to test it on one of multi-context sites.]]>
wshawn Apr 03, 2013, 06:18 AM https://forums.modx.com/thread/83605/displaying-resources-from-another-context?page=2#dis-post-461418
<![CDATA[Re: Displaying resources from another context]]> https://forums.modx.com/thread/83605/displaying-resources-from-another-context?page=2#dis-post-461408 See, while Wayfinder advertises it has "context abilities", it just doesn't work as it should... smiley I think there is a bug somewhere inside switching back to the original context, which messes things up on my end.

Try it for yourself. Create 2 contexts with 2 resources, call it: &startId=`0`&startIdContext=`othercontext`&contexts=`web,othercontext`
And after the Wayfinder call, place a link to a resource inside the other (note: not "othercontext") context.


  • web
    [ul]
    [li]Resource (1)
  • Resource 2 (2)
[/li]
[li]other

  • Resource 3 (3)
  • Resource 4 (4)
[/li]
[/ul]

Thus, when your Wayfinder is in (1), place a link next to it like so: [[~3]]. smiley That messes things up BIGTIME on my end.
Oh, also don't forget to create a modContextSetting named "site_url" inside your othercontexts defining a unique URL. Doesn't really have to work I guess.

/edit
WOW, this forum has sucky nested UL/LI support. tongue I guess you get my drift.]]>
ReSpawN Apr 03, 2013, 05:25 AM https://forums.modx.com/thread/83605/displaying-resources-from-another-context?page=2#dis-post-461408
<![CDATA[Re: Displaying resources from another context]]> https://forums.modx.com/thread/83605/displaying-resources-from-another-context#dis-post-461402 http://forums.modx.com/thread/79645/sorting-tv-resourcelist-by-title-instead-by-id#dis-post-442125

Just did not return anything when in the backend. Seems like Wayfinder refues to run in mgr context for whatever reason...I ended up using getResources instead of it^^]]>
exside Apr 03, 2013, 03:54 AM https://forums.modx.com/thread/83605/displaying-resources-from-another-context#dis-post-461402
<![CDATA[Re: Displaying resources from another context]]> https://forums.modx.com/thread/83605/displaying-resources-from-another-context#dis-post-461394
[[~42]] generates a perfect link to the contact page, but on the other context, using the exact same technique, it's just EMPTY. When I then, in turn, call the chunk UNCACHED, it ALL works fine.

Wtf?!]]>
ReSpawN Apr 03, 2013, 03:05 AM https://forums.modx.com/thread/83605/displaying-resources-from-another-context#dis-post-461394