[TYPO3] RealURL bug?
Christopher Torgalson
bedlamhotel at gmail.com
Thu Dec 14 18:25:55 CET 2006
Hi,
On 12/14/06, Xander Damen <xander at roquin.nl> wrote:
> Hi,
>
> Today I encountered the following problem/bug:
>
> To add some specific javascripts to all of my templates (and I don't
> want it to link to the location of the templates as TV does for me ;-))
> I use the following code:
>
> lib.stylesheetswitcher = TEXT
> lib.stylesheetswitcher.value (
> <span class="hide"><strong>CHOOSE FONTSIZE:</strong></span>
> <a href="#" onclick="setActiveStyleSheet('standaard'); return false;"
> class="standaard" id="imgKlein" title="Deze website in standaard
> tekstgrootte">A</a>
> <a href="#" onclick="setActiveStyleSheet('middel'); return false;"
> class="middel" id="imgGroot" title="Deze website in middelgrote
> letters">A</a>
> <a href="#" onclick="setActiveStyleSheet('groot'); return false;"
> class="groot" id="imgGroter" title="Deze website in grote letters">A</a>
> )
>
> (yeah yeah it's dutch ;-p)
>
>
> It works fine on all pages except on the page called 404 (which has the
> realURL path 404).
> The output is as follows:
> <span class="hide"><strong>CHOOSE FONTSIZE: </strong></span>
> 04.html#" onclick="setActiveStyleSheet('standaard'); return false;"
> class="standaard" id="imgKlein" title="Deze website in standaard
> tekstgrootte">A</a>
> 04.html#" onclick="setActiveStyleSheet('middel'); return false;"
> class="middel" id="imgGroot" title="Deze website in middelgrote
> letters">A</a>
> 04.html#" onclick="setActiveStyleSheet('groot'); return false;"
> class="groot" id="imgGroter" title="Deze website in grote letters">A</a>
>
> So the <a href="4 is removed. Changing the realURL path to error404
> fixed this bug.
> Every path that begins with a number gets the <a href="X removed. It
> only occurs for the links inserted by the typoscript object, links
> generated from content elements by typo3 itself are not affected.
>
> I've fixed the problem for the site by changing the path, but it does
> seem a bug :) Before reporting the bug, I have a question: is this a
> realURL or a typo3 core bug? I know Dmitry Dulepov comes around here a
> lot, guess he knows ;)
Nothing to do with whether it's a bug or not, but you should be able
to fix the problem by building that code with slightly more
sophisticated TS I think--it's usually best to make any links in a
TYPO3 site using typolink or menu objects in any case:
lib.fontSizeSwitcher = COA
lib.fontSizeSwitcher {
wrap = <span class="hide"><strong>CHOOSE FONTSIZE:</strong></span>|
5 = HTML
5 {
value = A
value {
typolink {
# The value of the link's href attribute is unimportant, but we
# can just link it to the current page and the style-switcher if
# we want...
#
# If we're on the page with realurl path 'foo/bar.html', this
# should make a link like
#
# <a href="foo/bar.html#imgKlein" ... >
#
parameter.data = field:uid
section = imgKlein
ATagParams = onclick="setActiveStyleSheet('standaard');return
false;"class="standaard" id="imgKlein" title="Deze website in
standaard
tekstgrootte"
}
}
}
10 < .5
10.value.typolink.ATagParams =
onclick="setActiveStyleSheet('middel'); return false;" class="middel"
id="imgGroot" title="Deze website in middelgrote letters"
15 < .5
15.value.typolink.ATagParams =
onclick="setActiveStyleSheet('groot'); return false;" class="groot"
id="imgGroter" title="Deze website in grote letters"
}
Not tested, but should work.
On a side note, if you'd like to make your code a little leaner,
there's probably no good reason for having an id /and/ a class on each
link--you can just move whatever styles are in the class to the id or
vice-versa.
--
Christopher Torgalson
More information about the TYPO3-english
mailing list