[Typo3] menulink as anchor

Peter Klein peter at umloud.dk
Wed Jun 29 17:03:01 CEST 2005


Hi List. In my TMENU I need to change the URL of all pages that have 
subpages. (for a foldout menu)

For that I created a small itemArrayProcFunc function to replace the URL 
with a "#"


-- cut --
class user_itemArrayProcFunc {

 function ifSubNoLink($I,$conf) {
  // Changes URL to # if page got subpages
  // Usage: In your TMENU/GMENU object insert this line:
  //        IProcFunc = user_itemArrayProcFunc->ifSubNoLink
  $key = $I["key"];
  $isSub = 0;
  $teststates=explode(',','IFSUB,CURIFSUB,ACTIFSUB');
  while (list(, $value) = each ($teststates)) {
   $isSub = $isSub || $conf["parentObj"]->isItemState($value,$key);
  }

  if ($isSub) {
   // Set the URL to # in the A-Tag
   $I["linkHREF"]["HREF"]="#";

   // Write data back to array
   $conf["parentObj"]->I = $I;
   $conf["parentObj"]->setATagParts();
   $I = $conf["parentObj"]->I;
   $I["parts"]["ATag_begin"]=$I["A1"];
  }
  // Returns:
  return $I;
 }
}
-- cut --

It used to work fine, but after installing RealUrl, instead of returning "#" 
it now returns the complete RealUrl link to the current page.

Does anyone have a solution to the above problem, which works on RealUrl 
too?

---
Peter Klein / Umloud Untd





More information about the TYPO3-english mailing list