[TYPO3] question on external links

David Banning david at skytracker.ca
Tue Feb 27 01:45:24 CET 2007


> > I am wondering if there is a way to insert an external link page without
> > having the reference in the menu first point to the page.
> >
> > When I hover over the link I get a typo3 page like
> > http://firstsite.686.0.html rather than the exact web address, say
> > http://www.newsite.com - it bounces to the newsite, so it works,
> > but I would like it better if there was a way to make it a direct
> > link.
> 
> 
> I believe this will do what you're looking for:
> http://www.typo3wizard.com/en/snippets/menus/externe-links-und-shortcuts-direkt-im-menue.html

Thanks for that Christopher. It works with the exception that it
does not take out the original link for the menu items that link 
to external pages. So I end up with two <a href=></a> tags.

It seems the ineffective sections are these clips, I believe 3 = TEXT
is the one which should be pulling the old link out. The page
in question is at http://www.theaterseatingcompany.com 


      4 = TEXT
      4 {
        field = title
        typolink.parameter.field = shortcut
                                        #remove the link here because its generated by the above typoscript
        doNotLinkIt = 1
      }
                        # 3 = external url
      3 = TEXT
      3 {
        field = title
        typolink.parameter.field = url
        typolink.extTarget.field = target
                                        #remove the link here because its generated by the above typoscript                             doNotLinkIt = 1
      }


Here is my entire menu section showing where I have inserted 
your suggested code. I only require this code to be effect
on the first level of the menu.

# Configuring the Auto-Parser for main template:
plugin.tx_automaketemplate_pi1 {
    # Read the template file:
  content = FILE
  content.file = fileadmin/template/main/template_a.htm

    # Here we define which elements in the HTML that
    # should be wrapped in subpart-comments:
  elements {
    BODY.all = 1
    BODY.all.subpartMarker = DOCUMENT_BODY

    HEAD.all = 1
    HEAD.all.subpartMarker = DOCUMENT_HEADER
    HEAD.rmTagSections = title

    TD.all = 1
  }

    # Prefix all relative paths with this value:
  relPathPrefix = fileadmin/template/main/
}

#Menu 1 cObject
temp.tmenu= HMENU 
temp.tmenu.wrap = <div class="example">|</div>
temp.tmenu{
    # erstes level
  1 = TMENU
  1.wrap = <ul class="adxm menu">|</ul>
  1{
   	  # no state: normale Formatierung
    expAll = 1
    NO{
      wrapItemAndSub = <li>|</li>
##################################################
# start of mods for direct link
##################################################
doNotLinkIt = 1
stdWrap.cObject = CASE
    stdWrap.cObject {
      key.field = doktype
      default = TEXT
      default {
        field = title
        stdWrap.htmlSpecialChars = 1
      }
      			# 4 = shortcut
      4 = TEXT
      4 {
        field = title
        typolink.parameter.field = shortcut
        				#remove the link here because its generated by the above typoscript
        doNotLinkIt = 1
      }
      			# 3 = external url
      3 = TEXT
      3 {
        field = title
        typolink.parameter.field = url
        typolink.extTarget.field = target
        				#remove the link here because its generated by the above typoscript				doNotLinkIt = 1
      }
       
    }

######################################################
# end of mods for direct link
######################################################


      }
     		# act state: gültig von der rootseite bis zur aktuellen Seite
    ACT=1
    ACT{
      wrapItemAndSub = <li class="menu-level1-active">|</li>
    }
     		# cur state: gültig für die aktuelle Seite
    CUR=1
    CUR{
      wrapItemAndSub = <li class="menu-level1-current-active">|</li>
    }
     		# ifsub state: gültig für seiten die unterseiten haben
    IFSUB=1
    IFSUB{
      wrapItemAndSub = <li class="menu-level1-with-subpage">|</li>
    }
  }
  	# zweites level 	
  2 = TMENU
  2.wrap = <ul class="menu-level2">|</ul>
  2{
    NO{
      wrapItemAndSub = <li>|</li>
    }
    ACT=1
    ACT{
      wrapItemAndSub = <li class="menu-level2-active">|</li>
    }
    CUR=1
    CUR{
      wrapItemAndSub = <li class="menu-level2-current-active">|</li>
    }
    IFSUB=1
    IFSUB{
      wrapItemAndSub = <li class="menu-level2-with-subpage">|</li>
    }
  }
  	# drittes level 	
  3 = TMENU
  3.wrap = <ul class="menu-level3">|</ul>
  3{
    NO{
      wrapItemAndSub = <li>|</li>
    }
    ACT=1
    ACT{
      wrapItemAndSub = <li class="menu-level3-active">|</li>
    }
    CUR=1
    CUR{
      wrapItemAndSub = <li class="menu-level3-current-active">|</li>
    }
    IFSUB=1
    IFSUB{
      wrapItemAndSub = <li class="menu-level3-with-subpage">|</li>
    }
  }
}




More information about the TYPO3-english mailing list