We're using Confluence 3.0.1.
I want to display an entire page within another page - so I'm using the INCLUDE macro to do this.
The page that I want displayed has a TOC macro.
Problem: Even through the Table of Contents is correctly displayed on my main page, the hyperlinks don't work.
Any suggestions?
This is really a hassle. It would be nice to have a setting -- "url=local|absolute". Please.
I cant explain it, but have you tried using the import macro from the adaptavist theme builder plugin ? Just be aware it might create additional sideeffects since the evaluation-context of the wikimarkup changes. (See image from : http://jodiem.com.au/2011/08/13/the-one-thing-in-one-place-once-rule-using-confluence/ )
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This may not be the case in this instance - but we had troubles with this and realized the include pages had Wiki Markup inside a heading. For example:
h1.{color:#000000}{*}This is the Heading{*}{color}
We found out the mark up within the heading was disabling the table of contents and the reason our Include macros were not generating a table of contents with working hyperlinks.
This may not be the answer in your case but I thought I'd throw it out there. :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
what the toc macro does is read the headlines from a page and create toc entries with anchor hyperlinks to these headlines.
As a result the hyperlinks of a toc entry on a PageA look like this:
.../display/~Username/PageA#PageA-Anchorname
=> These hyperlinks will work!
But: If PageA is included in PageB the hyperlinks of the toc entries in -now- PageB will look a little different:
.../display/~Username/PageB#PageA-Anchorname
=> These hyperlinks will not work!
I think there is no way to "repair" this directly.
As a workaround one could use the toc macro and adapt the hyperlinks afterwards:
I actually do this a lot ;-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Manny, I've found a workaround. It's not a very good one, but it does work.
I've been adding a manual high-level table of contents, using headings like this on the original page.
| [#First heading] | [#Second heading] | h2. First heading Some text h2. Second heading More text
That renders like this
When you include the original page somewhere else, the manual links will work.
What I don't understand is why that kind of relative link DOES work, but the one inside the toc macro doesn't.
Crumbs, I hate wysiwyg editors. You can't see where the code block starts and ends. This ISN'T part of the code block. Grr. And there SHOULD NOT be <br> character in the first example.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OK, I've calmed down after my wysiwyg editing experience. I also want to add some 'gotchas' you need to look out for if you create a manual toc like that. My instructions assume you're using wiki markup, not rich text.
So the code would look like this (it will still render exactly the same as the example in my first post)
===============================================
| [First heading#anchortext1] | [Second heading|#anchortext2] |
{anchor:anchortext1}
h2. First heading
Some text
{anchor:anchortext2}
h2. Second heading
More text
===============================================
Edit: Obviously, this is a p.i.t.a. that shouldn't be necessary if the {include} macro didn't break things. Like I said, it's not a GOOD solution, but it does work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you tried relocating the Toc macro to the page that uses the Include macro?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.