XF 1.1 Anchor links to mainpage

Sukrams

Member
Hello,

I edited the terms and rules phase and uses some anchors in the text. But the link doesn't jump to the anchor, but to the mainpage of the forum. Has someone a solution for that?

Regards,
Markus
 
The terms_rules_text-phrase. I have a table of content first, like

HTML:
<ul>
  <li style="list-style-type:none;"><a href="#kap0">Vorwort</a></li>
</ul>

and in the text i define the anchor:

HTML:
<h3><a name="kap0">Vorwort</a></h3>
<p>
 
OK, i've played a little bit with this and found the problem:)

It's because of xenforos base

e.g. on this site:
<base href="http://xenforo.com/community/" />


so if you have only an link with an anchor tag "href="#foo" it will link to http://xenforo.com/community/#foo"

and that's why it's always redirecting to the index page:)


You could change

<a href="#kap0">Vorwort</a></li>

to
<a href="{$requestPaths.requestUri}#kap0">Vorwort</a></li>
 
{$requestPaths.requestUri} works in the templates but not in the phrases unless you pass in the value:

Admin CP -> Appearance -> Templates -> help_terms

Add the red code:

Rich (BB code):
<xen:title>{xen:phrase terms_of_service_and_rules}</xen:title>

<div class="baseHtml">

{xen:phrase terms_rules_text, 'requestUri={$requestPaths.requestUri}'}

</div>

Now you can use {requestUri} when you edit the phrase.
 
{$requestPaths.requestUri} works in the templates but not in the phrases unless you pass in the value:

Admin CP -> Appearance -> Templates -> help_terms

Add the red code:

Rich (BB code):
<xen:title>{xen:phrase terms_of_service_and_rules}</xen:title>
 
<div class="baseHtml">
 
{xen:phrase terms_rules_text, 'requestUri={$requestPaths.requestUri}'}
 
</div>

Now you can use {requestUri} when you edit the phrase.
That works, thanks for your help!
 
Top Bottom