Hi Modx people,
I'm developing site with 4 subdomains (subsites). And for all of them I have different contexts. So, I have main context for main site and 4 another contexts for each subdomain (subsite). When I'm on subsite's page, I want to renders its own (subsite's) menu and a main menu from main site. I do this with two Wayfinder's calls:
[[!Wayfinder?
&startId=`0`
&contexts=`web`
&fullLink=`TRUE`
&categoryFoldersTpl=`wf_notalink`
&level=`2`
]] - this for main menu
and
[[!Wayfinder?
&startId=`0`
&fullLink=`TRUE`
&categoryFoldersTpl=`wf_notalink`
&level=`3`
]] - this for subsite's own menu.
And it worked.
But it's not the end of the story.
Then I started to develop my site further.
And later in one moment I realized that something bad had happend to Wayfinder calls.
[[!Wayfinder?
&startId=`0`
&fullLink=`TRUE`
&categoryFoldersTpl=`wf_notalink`
&level=`3`
]] this call stopped to render subsite's menu, from that moment it started to render main site menu.
Next obvious thing that I did was to add $contexts=`<subsite's context>` to Wayfinder call.
And it started to work but weird: first time when I load the page I don't see anything from that Wayfinder call, but after
reloading the page I started to see subsite's menu again. And was for every page from subsite: first time I see nothing and after reloading I see my menu. I tried to clear chache (even deleting /core/cache/) but that didn't help.
Then I started to do backoffs (not sure about that word). I started to remove new things that I added to my site step by step to see what caused the problem (as everything way ok at the begining). Any I found it. Before the second Wayfinder's call there was a chunk with content:
[[~55]] // - link to main page of 1st subsite
[[~56]] // - link to main page of 2nd subsite
[[~58]] // - link to main page of 3rd subsite
[[~57]] // - link to main page of 4th subsite
When I cleared this chunk, everything worked againg. So the problem was with processing this links.
Then I tried another test: I edited chunk's content and made like that:
[[~55]] // - link to main page of 1st subsite
[[~57]] // - link to main page of 4th subsite
And got the following:
when I'm on the first subsite, I get main menu instead of subsite's own menu
when I'm on the second subsite, I get subsite's own menu (what I need)
when I'm on the third subsite, I get subsite's own menu (what I need)
when I'm on the forth subsite, I get main menu instead of subsite's own menu
Well, I got rid of that problem. But I'd like to make that problem clear for me and for other people.
Why does this happen?
Thanks for advance. Sorry for english.