[xwiki-users] Anchors in 2.0
Hi, On a page I have a html document attached and I link to that document: [[Some HTML Document>>attach:MySpace.MyPage@myattachedfile.html]] This is working fine. But the attached html document is very large and contains a lot of anchors for easier navigation inside the document. So I'd like to improve the xwiki link to point directly to one of these anchors in the html attachment. I modified the link: [[Some HTML Document>>attach:MySpace.MyPage@myattachedfile.html#someAnchor]] But unfortunately this is not working. The hash is always escaped. Is there a way to link directly to an anchor in an attached html document? Importing the html document in the wiki page is not an option, it has to be attached. We're using 1.8.3. Thanks. Reto
Hi Reto, On Jun 2, 2009, at 10:40 AM, Reto Hotz wrote:
Hi,
On a page I have a html document attached and I link to that document: [[Some HTML Document>>attach:MySpace.MyPage@myattachedfile.html]]
This is working fine.
But the attached html document is very large and contains a lot of anchors for easier navigation inside the document. So I'd like to improve the xwiki link to point directly to one of these anchors in the html attachment. I modified the link: [[Some HTML Document>>attach:MySpace.MyPage@myattachedfile.html#someAnchor]]
But unfortunately this is not working. The hash is always escaped.
Is there a way to link directly to an anchor in an attached html document?
No. Looking at the XWikiDocument API (and more specifically the XWikiServletURLFactory API) it's currently not possible to do this. It's possible to pass a query string but not an anchor. I guess this could be added. Could you create a jira issue for this improvement request? Thus right now you'd need to use scripting to call $xwiki.getDocument("...").getAttachmentURL(...) and append the anchor to the URL. Thanks -Vincent
Importing the html document in the wiki page is not an option, it has to be attached.
We're using 1.8.3.
Thanks. Reto
Vincent Massol wrote:
I guess this could be added. Could you create a jira issue for this improvement request?
Done: http://jira.xwiki.org/jira/browse/XWIKI-3931 Thanks. Greetings Reto
Hi Once I had to do redirect with anchor and used JavaScript ##could not redirect with anchor using $response.sendRedirect <script lang="JavaScript"> window.location = "$xwiki.getURL($doc.fullName,"save")"+"#tagsAn" </script> I think you could write a js function and call it with OnClick embedded in you're "a" tag. In your function you could have window.location = "$xwiki.getURL($doc.fullName,"view")"+"#anchorName" Ajdin -----Original Message----- From: users-bounces@xwiki.org [mailto:users-bounces@xwiki.org] On Behalf Of Reto Hotz Sent: 02 June 2009 10:32 To: XWiki Users Subject: Re: [xwiki-users] Anchors in 2.0 Vincent Massol wrote:
I guess this could be added. Could you create a jira issue for this improvement request?
Done: http://jira.xwiki.org/jira/browse/XWIKI-3931 Thanks. Greetings Reto _______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users -------------------------------------------------------- NOTICE This message and any files transmitted with it is intended for the addressee only and may contain information that is confidential or privileged. Unauthorised use is strictly prohibited. If you are not the addressee, you should not read, copy, disclose or otherwise use this message, except for the purpose of delivery to the addressee. Any views or opinions expressed within this e-mail are those of the author and do not necessarily represent those of Coventry University.
participants (3)
-
Ajdin Brandic -
Reto Hotz -
Vincent Massol