[TYPO3] Showstopper for IE: RealURL and Named Anchors within the same page

Joerg Wagner jwagner at digilog.de
Tue Nov 21 20:12:58 CET 2006


Hello Ben,

thanks for your answer.
I was using the "config.prefixLocalAnchors = all" directive all the time 
(found it when searching for a solution for my problem), but couldn't see 
any effect.
Turns out now, that I was chasing ghosts all the time. Incredible!!! It just 
works.
Somehow in all my tests I always called the wrong files or didn't clear the 
cache or whatever. Damn - I should have slept some hours inbetween...

THANKS A LOT FOR YOUR HELP. You made me recheck everything and so I found my 
errors.

For all who will drop onto a similar situation, here are the details how I 
solved it (on a system using TemplaVoila):

1.
Add an anchor that links to your named anchor somewhere in the page and give 
it a unique id:
<a id="linkTop1" href="#pagetop">

2.
In TV add a new Data Element to the TV page template you are using:
    Mapping Type:  Attribute
    Editing Type:  TypoScript Object Path
    Object Path:  lib.linkTop1
    Mapping Rules:  a:attr:href

3.
In TV map the new Data Element to the anchor tag

4.
Add this code to your TS-Setup:
    lib.linkTop1 = TEXT
    lib.linkTop1{
      typolink.parameter = #pagetop
      typolink.returnLast = url
    }


THX again, Ben!
--
Jörg Wagner



"ben van 't ende [netcreators]" <ben at netcreators.com> schrieb im Newsbeitrag 
news:mailman.1.1164125359.32022.typo3-english at lists.netfielders.de...
> Joerg Wagner wrote:
>> Sorry, the text got garbled, so here I go again:
>> ---------------
>>
>> Hello world,
>> I am really stuck and hope for your help.
>>
>> I have seen quite some people requesting help on this problem, but they
>> often did not describe the exact circumstances of the problem, and so
>> failed to get a solution. I try to describe the problem in detail. 
>> Hopefully
>> you
>> are able to read all this stuff.
>>
>> Here we go:
>>
>>
>> Situation:
>> *   Typo3 4.0.2 installed
>> *   RealURL installed
>> *   config.baseURL set to http://www.mydomain.com/
>> *   This generates a base tag in the header of the page:
>>    <base href=http://www.mydomain.com />
>>
>>
>> Needed:
>> *   A link at the bottom of each page that jumps back to the
>>     top of the page.
>> *   To do this, there is a named anchor
>>     <a name="pagetop"></a>
>>     at the top of each page
>> *   and a link at the bottom of the page of the form:
>>     <a href="#pagetop">To Top!</a>
>>
>>
>> Problem:
>> * The link works fine in FireFox, but Internet Explorer fails to
>>     jump to the top of the page.
>>
>>
>> Reason:
>> Some tests show that IE uses the url given in <base href=""> to resolve 
>> any
>> links that contain ONLY a named anchor in href, e.g. <a href="#pagetop"> 
>> .
>> In combination with RealURL and the config.baseURL setting this leads IE 
>> to
>> jump to:
>> http://www.mydomain.com#pagetop
>> while it should jump to
>> http://www.mydomain.com/REALURL/ALIAS/PATH/#pagetop
>> This __could__ be circumvented by prepending the links href with the 
>> fully
>> qualified URL of the current page, or at least with the RealURL alias 
>> path
>> of the address in the form of
>> <a href="/REALURL/ALIAS/PATH/#pagetop">To Top!</a>
>>
>> But whatever I try to get that path in front of #pagetop, it is filtered 
>> out
>> by Typo3, as long as I refer to the url of the current page.
>> For example I tried:
>>     # NO GO...
>>     page.10 = TEXT
>>     page.10.typolink.parameter.data = field:uid
>>     page.10.typolink.section = pagetop
>>     page.10.typolink.returnLast = url
>> But the result is just "#pagetop". The RealURL alias path only appears as
>> soon as I try to address a page different from the current page, e.g.:
>>     # THIS WORK...
>>     page.10 = TEXT
>>     page.10.typolink.parameter = 123    <--some existing page uid!
>>     page.10.typolink.section = pagetop
>>     page.10.typolink.returnLast = url
>> In this case the result is  REALURL/ALIAS/PATH/#pagetop
>>
>>
>>
>> Whatever I try - as long as I address the current page, Typo3 filters out
>> the alias path from my links href and the jump to the named anchor fails
>> in IE.
>>
>> I would GREATLY appreciate some help on this one!
>
> Hi Joerg,
>
> You must be looking for "config.prefixLocalAnchors = all" in TS setup.
>
> gRTz
>
> ben
> -- 
> netcreators :: creation and innovation
> www.netcreators.com -  www.typo3.nl 





More information about the TYPO3-english mailing list