Can you place links in the showhide macro?

I’m trying to add a link, and it’s rendered as a “new page” link, setting the parent to the current page.

Hi @drewkime!
I use xwiki version 11.10.2, showhide macro 2.0. And got the same error.
For example, I put this text in Sandbox page:

{{showhide showmessage="test" hidemessage="test" effectduration="1"}}
[[link>>doc:]] to current page
{{/showhide}}
[[link>>doc:]] to current page

Link outside showhide macro rendered to https://ip:8443/xwiki/bin/view/Sandbox/# but link inside sandbox macro rendered as https://ip:8443/xwiki/bin/create/Sandbox/doc%3A/WebHome?parent=Sandbox.WebHome as non existing page.

The same link rendering bug in spoiler macro.

So I think it is sandbox and spoiler macro (ar maybe all?) rendering bug. It cant correct render link inside the macro.

Thanks for the better bug report. Yes, that’s the same behavior I’m seeing.

Also ran into this issue today.

Did you report this as a bug in Xwiki Jira, I could not find any report?

No I didn’t. I wasn’t aware there was a Jira.

Ok, I added a new Jira issue for this problem then.

Links work if omitting the doc: prefix.
The cause of the problem is that the macro page is using xwiki/2.0 syntax, not xwiki/2.1. I cannot remember out of hand when xwiki/2.1 syntax was introduced, but I guess it cannot harm to raise the XWiki platform baseline from 6.x to a slightly newer version to fix this.

In the mean time you should be able to convert the macro page in .../Macros/ShowHideMacro to xwiki/2.1 syntax yourself by editing it in the Wiki-Editor and use the “PageSyntax” drop down in the right side column. (Fixed the issue for me.)

I just released 2.0.2 which should fix the issue.

If it does not, please feel free to reopen the corresponding issue

[SHMACRO-4] Links In ShowHide Macro Do Not Work - XWiki.org JIRA

I plan to release a 2.1 version soon needing a somewhat more recent XWiki version than 6.4 to make the macro work better with the WYSIWYG editor. In that case you might need to pick the 2.0.2 version from the “List of stable versions” in the “details” tab of that extension in the extension manager to install it instead of 2.1 for older XWiki versions.

1 Like