TYPO3Jack.net - Das TYPO3 Mailinglist Forum Archiv

Die TYPO3 Mailingliste - nicht fragen: lesen!

[TYPO3] external link in menu, typoscript and typolink.

This is a discussion on [TYPO3] external link in menu, typoscript and typolink. within the typo3-english@lists.netfielders.de forums, part of the TYPO3-Mailinglists: ENGLISH category; Hi Typolink/TS experts! On my site, I have a list of pages, one of which is of type "...


Zurück   TYPO3Jack.net - Das TYPO3 Mailinglist Forum Archiv > TYPO3-Mailinglists: ENGLISH > typo3-english@lists.netfielders.de

Registrieren Hilfe Benutzerliste Kalender Suchen Heutige Beiträge Alle Foren als gelesen markieren
  #1  
Alt 26.06.2008, 11:52
Andrew Plank
Gast
 
Beiträge: n/a
Standard [TYPO3] external link in menu, typoscript and typolink.

Hi Typolink/TS experts!

On my site, I have a list of pages, one of which is of type "Link to an
external URL", which points to a subdomain of my site.

The typoscript that creates the menu looks like this:

lib.menu_main = COA
lib.menu_main = HMENU
lib.menu_main.entryLevel = 0
lib.menu_main.1 = TMENU
lib.menu_main.1 {

noBlur=1
wrap = <ul>|</ul>

NO = 1
NO {

allWrap = <li>|</li>
stdWrap.case = lower
stdWrap.cObject = CASE
stdWrap.cObject {
key.field = doktype
default = TEXT
default.field = title
default.typolink.ATagBeforeWrap=1
default.typolink.wrap=|
3 < .default
3.typolink.ATagBeforeWrap=1
3.stdWrap.htmlSpecialChars = 1
3.typolink.parameter.dataWrap = http://{field:url}
}

ACT = 1
ACT.allWrap = <li class="main_selected">|</li>
ACT.stdWrap.case = lower
ACT.doNotLinkIt = 1

}

Which almost works... In the output, the link that points to the
subdomain is correct, however, this link is wrapped in another link, so
I end up with this:

<a href="subdomain/"><a href="http://subdomain.example.com"
target="_top">subdomain</a></a>

Which is obviously not valid HTML. How can I modify the above TS so that
the correct link isn't wrapped like that? Also, is it possible to
configure it so that target="_top" is removed?

Here's hoping!

//Plankmeister
_______________________________________________
TYPO3-english mailing list
TYPO3-english (AT) lists (DOT) netfielders.de
http://lists.netfielders.de/cgi-bin/.../typo3-english
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
  #2  
Alt 26.06.2008, 12:34
Dmitry Dulepov [typo3]
Gast
 
Beiträge: n/a
Standard Re: [TYPO3] external link in menu, typoscript and typolink.

Hi!

Andrew Plank wrote:
> 3.typolink.ATagBeforeWrap=1
> 3.stdWrap.htmlSpecialChars = 1
> 3.typolink.parameter.dataWrap = http://{field:url}
> }


....

> Which almost works... In the output, the link that points to the
> subdomain is correct, however, this link is wrapped in another link, so
> I end up with this:
>
> <a href="subdomain/"><a href="http://subdomain.example.com"
> target="_top">subdomain</a></a>
>
> Which is obviously not valid HTML. How can I modify the above TS so that
> the correct link isn't wrapped like that? Also, is it possible to
> configure it so that target="_top" is removed?


3.typolink.returnLast = url

TSRef is your friend

--
Dmitry Dulepov
http://typo3bloke.net/
_______________________________________________
TYPO3-english mailing list
TYPO3-english (AT) lists (DOT) netfielders.de
http://lists.netfielders.de/cgi-bin/.../typo3-english
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
  #3  
Alt 26.06.2008, 14:03
Andrew Plank
Gast
 
Beiträge: n/a
Standard Re: [TYPO3] external link in menu, typoscript and typolink.

Dmitry Dulepov [typo3] wrote:

> 3.typolink.returnLast = url


Hi Dmitry,

Thanks for your fast reply! I tried your suggestion, but this was the
result:

<li><a href="subdomain/">http://subdomain.example.com</a></li>

Which is the wrong way around... How can I make it look like this:

<li><a href="http://subdomain.example.com/">subdomain</a></li>

Or is that even possible?

I just studied TSRef and I have a much better idea of what's going on,
and I've used about an hour trying all sorts of optimistic typolink
statements, none of which give the desired result.

Any ideas or pointers?

//Plankmeister
_______________________________________________
TYPO3-english mailing list
TYPO3-english (AT) lists (DOT) netfielders.de
http://lists.netfielders.de/cgi-bin/.../typo3-english
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
  #4  
Alt 26.06.2008, 14:14
Christopher Torgalson
Gast
 
Beiträge: n/a
Standard Re: [TYPO3] external link in menu, typoscript and typolink.

Hi,

On Thu, Jun 26, 2008 at 2:03 PM, Andrew Plank
<plankmeister_NO (AT) spam_hotmail (DOT) com> wrote:
> Dmitry Dulepov [typo3] wrote:
>
>> 3.typolink.returnLast = url

>
> Hi Dmitry,
>
> Thanks for your fast reply! I tried your suggestion, but this was the
> result:
>
> <li><a href="subdomain/">http://subdomain.example.com</a></li>
>
> Which is the wrong way around... How can I make it look like this:
>
> <li><a href="http://subdomain.example.com/">subdomain</a></li>
>
> Or is that even possible?
>
> I just studied TSRef and I have a much better idea of what's going on,
> and I've used about an hour trying all sorts of optimistic typolink
> statements, none of which give the desired result.
>
> Any ideas or pointers?



Well, just for the purpose of eliminating the simple errors, is your
actual code missing a closing brace after the line "
3.typolink.parameter.dataWrap = http://{field:url}" like the code in
your first message?


--
Christopher Torgalson
http://www.typo3apprentice.com/
_______________________________________________
TYPO3-english mailing list
TYPO3-english (AT) lists (DOT) netfielders.de
http://lists.netfielders.de/cgi-bin/.../typo3-english
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
  #5  
Alt 26.06.2008, 15:50
Andrew Plank
Gast
 
Beiträge: n/a
Standard Re: [TYPO3] external link in menu, typoscript and typolink.

Christopher Torgalson wrote:

> Well, just for the purpose of eliminating the simple errors, is your
> actual code missing a closing brace after the line "
> 3.typolink.parameter.dataWrap = http://{field:url}" like the code in
> your first message?


Hi Christopher,

When I was studying the TSref I modified it from the original posting,
and what follows is a direct copy paste:

lib.menu_main = HMENU
lib.menu_main.entryLevel = 0
lib.menu_main.1 = TMENU
lib.menu_main.1 {

noBlur=1
wrap = <ul>|</ul>

NO = 1
NO {

allWrap = <li>|</li>
stdWrap.case = lower
stdWrap.cObject = CASE
stdWrap.cObject {
key.field = doktype
default = TEXT
default.field = title

3 < .default
3.stdWrap.htmlSpecialChars = 1
3.typolink.parameter.dataWrap= http://{field:url}
}
}

ACT = 1
ACT.allWrap = <li class="main_selected">|</li>
ACT.stdWrap.case = lower
ACT.doNotLinkIt = 1

}

Any ideas? Can anyone explain why it's wrapping a link in another link?
If I could figure that out, I might be able to figure out how to prevent
it doing it.
_______________________________________________
TYPO3-english mailing list
TYPO3-english (AT) lists (DOT) netfielders.de
http://lists.netfielders.de/cgi-bin/.../typo3-english
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
  #6  
Alt 26.06.2008, 16:03
Christopher Torgalson
Gast
 
Beiträge: n/a
Standard Re: [TYPO3] external link in menu, typoscript and typolink.

On Thu, Jun 26, 2008 at 3:50 PM, Andrew Plank
<plankmeister_NO (AT) spam_hotmail (DOT) com> wrote:
> Christopher Torgalson wrote:
>
>> Well, just for the purpose of eliminating the simple errors, is your
>> actual code missing a closing brace after the line "
>> 3.typolink.parameter.dataWrap = http://{field:url}" like the code in
>> your first message?

>
> Hi Christopher,
>
> When I was studying the TSref I modified it from the original posting,
> and what follows is a direct copy paste:
>
> lib.menu_main = HMENU
> lib.menu_main.entryLevel = 0
> lib.menu_main.1 = TMENU
> lib.menu_main.1 {
>
> noBlur=1
> wrap = <ul>|</ul>
>
> NO = 1
> NO {
>
> allWrap = <li>|</li>
> stdWrap.case = lower
> stdWrap.cObject = CASE
> stdWrap.cObject {
> key.field = doktype
> default = TEXT
> default.field = title
>
> 3 < .default
> 3.stdWrap.htmlSpecialChars = 1
> 3.typolink.parameter.dataWrap= http://{field:url}
> }
> }
>
> ACT = 1
> ACT.allWrap = <li class="main_selected">|</li>
> ACT.stdWrap.case = lower
> ACT.doNotLinkIt = 1
>
> }
>
> Any ideas? Can anyone explain why it's wrapping a link in another link?
> If I could figure that out, I might be able to figure out how to prevent
> it doing it.



Yes, it looks as though you've built a link with stdWrap without first
'turning off' the auto-generated TMENU link. Try adding
"NO.doNotLinkIt = 1" (it's also in the original ML post that I guess
you're working from [1]).

[1] http://lists.netfielders.de/pipermai...er/015843.html

But it looks like you're totally rebuilding the link, including the
link text. Any reason why you need to do that (i.e. since you only
need to change the href attribute of the link)?



--
Christopher Torgalson
http://www.typo3apprentice.com/
_______________________________________________
TYPO3-english mailing list
TYPO3-english (AT) lists (DOT) netfielders.de
http://lists.netfielders.de/cgi-bin/.../typo3-english
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
  #7  
Alt 26.06.2008, 16:04
Christopher Torgalson
Gast
 
Beiträge: n/a
Standard Re: [TYPO3] external link in menu, typoscript and typolink.

On Thu, Jun 26, 2008 at 4:03 PM, Christopher Torgalson
<bedlamhotel (AT) gmail (DOT) com> wrote:

<snip>

Sorry, ignore the lines below in my last message--I wrote them before
I completely grasped what the TS in your sample does, and forgot to
delete them--excepting the doNotLinkIt bit, your TS looks perfectly
sensible

>
> But it looks like you're totally rebuilding the link, including the
> link text. Any reason why you need to do that (i.e. since you only
> need to change the href attribute of the link)?





--
Christopher Torgalson
http://www.typo3apprentice.com/
_______________________________________________
TYPO3-english mailing list
TYPO3-english (AT) lists (DOT) netfielders.de
http://lists.netfielders.de/cgi-bin/.../typo3-english
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
  #8  
Alt 26.06.2008, 16:23
Andrew Plank
Gast
 
Beiträge: n/a
Standard Re: [TYPO3] external link in menu, typoscript and typolink.

Christopher Torgalson wrote:
> On Thu, Jun 26, 2008 at 4:03 PM, Christopher Torgalson
> <bedlamhotel (AT) gmail (DOT) com> wrote:
>
> <snip>
>
> Sorry, ignore the lines below in my last message--I wrote them before
> I completely grasped what the TS in your sample does, and forgot to
> delete them--excepting the doNotLinkIt bit, your TS looks perfectly
> sensible
>
>> But it looks like you're totally rebuilding the link, including the
>> link text. Any reason why you need to do that (i.e. since you only
>> need to change the href attribute of the link)?

>
>
>
>


Hi Christopher,

I tried doing this:

3 < .default
3.field = url # <-Changed this from title
3.stdWrap.htmlSpecialChars = 1
3.typolink.parameter.dataWrap = {field:title} # <- changed this from url
3.typolink.returnLast = url

In the hope that it would simply swap the fields... But no dice. That's
all I need to be able to do... get typolink to swap the parameters. It
doesn't work (read: I can't get it to work) even if I do something like

3.typolink.parameter = http://subdomain.example.com

It feels like I'm SO close to a solution. Looks like I might have to
investigate the userFunc option of typolink....

//Plankmeister
_______________________________________________
TYPO3-english mailing list
TYPO3-english (AT) lists (DOT) netfielders.de
http://lists.netfielders.de/cgi-bin/.../typo3-english
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
  #9  
Alt 26.06.2008, 17:21
Christopher Torgalson
Gast
 
Beiträge: n/a
Standard Re: [TYPO3] external link in menu, typoscript and typolink.

Hi,

On Thu, Jun 26, 2008 at 4:23 PM, Andrew Plank
<plankmeister_NO (AT) spam_hotmail (DOT) com> wrote:

<snip>

> Hi Christopher,
>
> I tried doing this:
>
> 3 < .default
> 3.field = url # <-Changed this from title
> 3.stdWrap.htmlSpecialChars = 1
> 3.typolink.parameter.dataWrap = {field:title} # <- changed this from url
> 3.typolink.returnLast = url
>
> In the hope that it would simply swap the fields... But no dice. That's
> all I need to be able to do... get typolink to swap the parameters. It
> doesn't work (read: I can't get it to work) even if I do something like
>
> 3.typolink.parameter = http://subdomain.example.com
>
> It feels like I'm SO close to a solution. Looks like I might have to
> investigate the userFunc option of typolink....




What is the problem? You were working from an already fully worked-out
solution. From that mailing list post, you should have needed to
change almost nothing at all…

As for the changes above, sorry but they're nonsensical (how could
providing the contents of the title field ever be the appropriate
value for typolink.parameter?!). In TS you will make yourself insane
if you just randomly switch properties around. The following code
works--I've stripped out anything extraneous, indented the code and
used braces etc (it's much easier to understand if you don't repeat
the same object name over and over


lib.extUrl = HMENU
lib.extUrl {
1 = TMENU
1 {
expAll = 1
noBlur = 1
wrap = <ul>|</ul>

NO {
stdWrap.cObject = CASE
stdWrap.cObject {
key.field = doktype
default = TEXT
default {
field = title
typolink {
parameter.data = field:uid
}
}

3 < .default
3 {
stdWrap.htmlSpecialChars = 1
typolink {
parameter {
data >
dataWrap = http://{field:url}
}
}
}
}
doNotLinkIt = 1
wrapItemAndSub = <li>|</li>
}
}
}


--
Christopher Torgalson
http://www.typo3apprentice.com/
_______________________________________________
TYPO3-english mailing list
TYPO3-english (AT) lists (DOT) netfielders.de
http://lists.netfielders.de/cgi-bin/.../typo3-english
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
  #10  
Alt 26.06.2008, 21:24
Andrew Plank
Gast
 
Beiträge: n/a
Standard Re: [TYPO3] external link in menu, typoscript and typolink.

Christopher Torgalson wrote:

> lib.extUrl = HMENU
> lib.extUrl {
> 1 = TMENU
> 1 {
> expAll = 1
> noBlur = 1
> wrap = <ul>|</ul>
>
> NO {
> stdWrap.cObject = CASE
> stdWrap.cObject {
> key.field = doktype
> default = TEXT
> default {
> field = title
> typolink {
> parameter.data = field:uid
> }
> }
>
> 3 < .default
> 3 {
> stdWrap.htmlSpecialChars = 1
> typolink {
> parameter {
> data >
> dataWrap = http://{field:url}
> }
> }
> }
> }
> doNotLinkIt = 1
> wrapItemAndSub = <li>|</li>
> }
> }
> }
>
>


When I grow up, I want to be a TS expert just like you

Thanks, Christopher. You are a genius! It worked 100% perfectly

//Plankmeister
_______________________________________________
TYPO3-english mailing list
TYPO3-english (AT) lists (DOT) netfielders.de
http://lists.netfielders.de/cgi-bin/.../typo3-english
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
 

Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht Thema bewerten
Thema bewerten:

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are an


Ähnliche Themen

Thema Autor Forum Antworten Letzter Beitrag
[TYPO3] External Url in menu Dmitry Martynenko typo3-english@lists.netfielders.de 1 24.04.2008 18:13
[TYPO3] FW: Link checker for external links Haines, William J typo3-english@lists.netfielders.de 6 13.10.2007 17:06
[TYPO3] localized external link Stano Paška typo3-english@lists.netfielders.de 0 14.09.2007 11:08
[TYPO3] typolink in typoscript Rob Kamp typo3-english@lists.netfielders.de 2 20.04.2007 16:07
[TYPO3] External URL page type link Benjamin Todd typo3-english@lists.netfielders.de 0 06.03.2007 16:41


Alle Zeitangaben in WEZ +1. Es ist jetzt 00:12 Uhr.


Powered by vBulletin® Version 3.7.2 (Deutsch)
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74