English 中文(简体)
TYPO3: getTypoLink_URL alternative (generating url aliases)
原标题:
  • 时间:2009-11-19 11:20:09
  •  标签:
  • typo3

Is there an alternative way of getting the URL to a page (by id) apart from using cObj->getTypoLink_URL?

I m trying to create URL aliases, so a page can have multiple URLs (for example "/about" could actually point to "/corporate/home/about").

I m currently hooking into realurl s hook decodeSpURL_preProc, but TSFE and cObj are not initialised at that point therefore calling cObj->getTypoLink_URL doesn t work.

I should add that the url alias should not redirect to the original url.

最佳回答

If you create RealURL aliases("Redirects"), you can create a database query that fetchs the url aliases, you have created.

Have a look in the realurl redirects table.

问题回答

just use the folowing code to generate the link.

You might want to load localconf.php.

class Devlib {

    static function _link($id,$urlParameters=  ,$target=  ) {
        $cObj = t3lib_div::makeInstance( tslib_cObj );
        return $cObj->getTypoLink_URL($id,$urlParameters,$target);      
    }      
}




相关问题
TYPO3 extensions and symlinks

Can I create a symlink to the local extension from aonther project folder? I have a common local-server and i need to implement same extension on all local project-installations. I tried to put the ...

TYPO3: Use TCA.php to build Frontend Forms?

I m searching for a solution, to build a frontend form from the TCA.php of my TYPO3 extension. Is there any way, to select TCA.php values, from my extension Class? I want to build a select-element ...

How to automatically reload TYPO3 calendar from external ics

Hi I m using the calendar base extension (cal) for displaying my calendar in a TYPO3 website. I configured an external calendar and it imports all events correctly. How can I automatically reload the ...

Does a svn frontend for git exist

We are planing to migrate our repositories from svn to git. However there are some people using np_subversion which integrates SVN into the TYPO3-Backend. np_subversion calls the svn client to make ...

wurfl2 integration in TYPO3

everytime i try to install the wurfl2 extension in TYPO3 i get the following error message: Fatal error: require_once() [function.require]: Failed opening required (include_path= .:/usr/local/php/...

TYPO3: getTypoLink_URL alternative (generating url aliases)

Is there an alternative way of getting the URL to a page (by id) apart from using cObj->getTypoLink_URL? I m trying to create URL aliases, so a page can have multiple URLs (for example "/about" ...

热门标签