[[~[~[image:icon:house~]~] Main Wiki>>doc:Main.WebHome]]
I have one main wiki, and one sub wiki.
I got the destination by clicking the CKEditor link icon and opening the page picker, then choosing the main page of the main wiki.
This appears to be a bug, as with it set up like so, if I click it from a sub wiki, it goes to the main page of the sub wiki.
The GUI doesn’t seem to understand that it needs to set the link to wiki:Main.WebHome to go to the correct site when it’s on anything other than the main wiki.
The WYSIWYG editor cannot know that the link you’re adding to a page in the current wiki is going to be used from another wiki (and thus would need to have the wiki specified). Actually, it could also happen that you’d want the same link used in all wikis, all leading to a local page.
Two solutions come to mind:
Always add the current wiki as prefix to all links (even when not necessary). Not very nice but would solve the problem in the simplest way probably.
Add a feature (checkbox) in the link dialog to force specifying the wiki (for example the checkbox would say something like “This link will be used from another wiki and needs to be absolute” or something like this).
The WYSIWYG editor outputs relative references as link targets whenever possible. This means the wiki part of the reference is omitted if the target page is from the same wiki as the edited page. This is done on purpose for multiple reasons, including:
portability: being able to export and import the content in another wiki while preserving working links
refactoring: fewer pages have to be updated when content is moved to a different location (wiki)
-1 for this on my side. This basically means always generating absolute references as link targets. This makes it hard to maintain those links when moving / refactoring content.
I’m fine with this, but I’m wondering how often / common is this use case. If it’s just an edge case then maybe it’s enough to switch to Source and modify the generated target reference (which will stay as long as you don’t edit the link again).
I’m not fully convinced about this argument. It’s only true when refactoring across wikis and that’s not a main use case. And it’ll still work.
While this is true, it’s also an edge case (exporting the content from one wiki to import it in another wiki).
Now the case mentioned above is also an edge case…
I don’t have the answer either. Switching to source seems a bit too technical and is transient as you mentioned so not a very good option.
What’s sure is that I don’t like making the UI more complex. Could be displayed only for advanced users (but the problem might remain for simple users, OTOH creating a menu is more for advanced users).
The thing is, the GUI already allows you to choose between different wikis. That’s why it seems weird that it doesn’t respect your choice.
I think you should put a check box under Options to allow the link to be absolute.
Yes, but if the target (selected) page is from the same wiki as the edited page then it outputs a relative reference (relative to the current wiki). If the target page is from a different wiki it outputs an absolute reference.
The same happens inside a single wiki. Even if you can see the entire page tree, if you select a page that is a descendant of the edited page then you get something like:
[[child>>doc:.Child.WebHome]]
which is a relative reference. So that when you move the parent page along with the child page the link doesn’t have to be updated.
No, it’s not limited to cross wiki refactoring. Once you specify the wiki you have to specify the full reference. The reference becomes absolute. You can’t have a reference with the wiki specified but the space missing or partially specified. So it’s either full reference (with all component specified, including wiki) or relative reference. Using absolute references means that those links will have to be updated every time the hierarchy is refactored, even if the link source and target are inside a subtree that is moved as a whole.
Actually it seems you can, because each reference component is resolved separately, so each can be specified or not, relative or absolute (there’s only a single level of wiki currently, so you either have the wiki specified or not, but if there were a hierarchy of wikis, the wiki component could be relative). In any case, I’m still convinced that outputting relative references (by default) is the right thing. I’m not opposing adding an option to the WYSIWYG editor, but we need to weight the cost vs. benefit.
I created a menu that only has 2 links. The menu was created on the main wiki.
One is a link to the main wiki’s homepage, and the other is a link to the sub wiki’s homepage.
The sub wiki is only available to registered users as it’s internal company documents.
It’s only function is to make it easy for users to switch back and forth between the 2 wikis.
The menu is made available to both wikis, but there’s not a way to add the link to the main wiki FROM the sub wiki. That’s why the absolute button would be useful to me.