[TYPO3] anchor tags

JoH asenau info at cybercraft.de
Sat Dec 15 01:25:40 CET 2007


>> I just tested the TS I sent you to double-check, and it works just as
>> intended. The *only* thing that could make that TS fail is if somehow
>> there is no value for the 'field:uid' bit--but even then, the thing
>> is an ordinary HTML cObject, so you should still see the text--which
>> is what it sounds like you're describing.
>
> Isn't that weird. I wonder if I could have something set somewhere
> that is interfering with it? I also found that with
>
>>> lib.skipnavigation = CONTENT
>>> lib.skipnavigation{
>>> ... SNIP
>>> }
>
> As soon as I disable the additionalParams lines, the whole thing
> doesn't work. I get the link text, but no link. So back to what you
> gave me, with some tweaking...

And this is where some logic comes in handy ;-)
Typolink will only create a link IF there is at least some information about
the link you want to create.
Usually this is done by setting "parameter" to something that could be

# An ID which will generate an internal link
# to a page with that uid
typolink.parameter = 123

or

# Some URL that willl generate external links
# to an email adress or another webpage
typolink.parameter = http://whatever.tld

Additionally you can link internal sites to an anchor (section) using two
different ways:

# Will link to page 123 and anchor "mysection"
typolink.parameter = 123#mysection


# Will link to section "mysection" on the current page too
typolink {
    parameter = #mysection
}

# Will link to page 123 and anchor "mysection" too
# but only if there is any link generated at all
typolink {
    parameter = 123
    section = mysection
}

# Will link to section "mysection" on the current page
# but only if there is any link generated at all
typolink {
    section = mysection
}

You can add URL parameters by using additionalParams like this:

typolink.additionalParams = &myParam=2&mysecondParam=4

Now if you already found out that there is no link generated at all after
removing the additionalParams lines, this simply means that the rest is
generating no link at all because there is no information to generate a link
from.
Since the rest will only be

typolink {
    # Links to the page that the wiki keyword is found on
    parameter.data = field:pid

    #add the anchor
    section = Content
}

and you now know that "section" will only work with some link generated at
all, the bad guy must be this line:
parameter.data = field:pid

So to find out if the rest is working you should switch it to something like
parameter = 123
where 123 should be the id of an existing and non restricted page just to
test if there is something generated at all.

If this is generating a link and it is still working after reenabling the
additionalParams line, you can try to find out if there is any value in
field:pid by changing the content of the Linktext like this:

#value = Skiplink to content
data = field:pid

If there is any text at all, it should of course be something like a number.
If there is nothing at all, this will be the reason why you don't get any
links.

Now we can try to find out, if there is anything else available by changing
the above lines to:

#value = Skiplink to content
data = field:keywords

since the field "keywords" has been in your selectFields list.

Do you read any keywords now?
If not, the whole select part doesn't seem to work properly.
If yes, the problem might be a missing pid field.

But on the other hand there is one question:
Why do you need the pid of the items selected at all?
The select part of your CONTENT element only uses "this" as a pidInList, so
the items can't have any other pid than the current page.
Since the id of the current page is always available when rendering records
for this page, you don't need to take it from your CONTENT element.

So what exactly do you want to do?
As far as I understood you want to generate some links to enable people to
jump to different sections of the same page.
If this is what you want to do, the bug seems to be in the whole approach.

So could you please clarify som things?

HTH

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your gob sometimes!)
Dieter Nuhr, German comedian
openBC/Xing: http://www.cybercraft.de
T3 cookbook: http://www.typo3experts.com
Jobs: http://www.professionals-only.com




More information about the TYPO3-english mailing list