[TYPO3] how to test for condition of URL link

David Banning david at skytracker.ca
Sat Mar 10 17:25:50 CET 2007


> What /exactly/ do you want to do? You can use the value of 'doktype'
> to figure out what kind of page the menu item points to (in, for
> example, a Typoscript CASE object...)

All I want to do is replace a URL page link with a real URL.

Normally a URL pagetype points to a reference page which inturn 
sends the vistor to the URL location. So I have a routine which
replaces the reference page link with the real URL.  The 
"doNotLinkIt = 1" stops the link and replaces it with the real
URL.

Here is the problem - the link is being replace whether it is
a URL page type or not. So I need to first test what page type
the link is referencing.

if [page is a URL type]
   doNotLinkIt = 1 
   - replace the page type with a real URL
else
   - leave the link alone
fi


#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 class="menu-level1-active>"|</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



More information about the TYPO3-english mailing list