Die TYPO3 Mailingliste - nicht fragen: lesen!
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 "...
|
|||||||
| Registrieren | Hilfe | Benutzerliste | Kalender | Suchen | Heutige Beiträge | Alle Foren als gelesen markieren |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
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 |
|
#4
|
|||
|
|||
|
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 |
|
#5
|
|||
|
|||
|
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 |
|
#6
|
|||
|
|||
|
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 |
|
#7
|
|||
|
|||
|
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 |
|
#8
|
|||
|
|||
|
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 |
|
#9
|
|||
|
|||
|
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 |
|
#10
|
|||
|
|||
|
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 |
| Themen-Optionen | Thema durchsuchen |
| Ansicht | Thema bewerten |
|
|
|
||||
| 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 |