0

I'm using typo3 and realurl.

In my extension I generate some ID's (next and previous page) and everything works fine up to this point. An example link looks like:

/index.php?id=12

The link takes the visitor to the specific page, but this link is in the url as well. Of course I generate this linke exactly like this:

$GLOBALS['TSFE']->baseURL . "index.php?id=" . $banner->getPrevious();

So, it is exactly what i expected. But how can i turn this url into a seo-friendly URL? Is there something like $realUrl->createUrlFromId()? :P

I checked the manual, looked in some forums, but 99% of the time it is something related to TypoScript, which I don't need (from my point of view) in this case.

Edit:

Here is the .htaccess: http://pastebin.com/DBXjLYjp

Thank you in advance

DasSaffe
  • 2,080
  • 1
  • 28
  • 67
  • look into mod_rewrite in apache and .htaccess – raam86 Aug 22 '14 at 09:42
  • I edited the post and added the htaccess-file. Usually the rewrite works. My menu for example links to the correct way as well. But i guess this is due to the HMENU – DasSaffe Aug 22 '14 at 09:47

1 Answers1

1

RealURL hooks into several core methods to generate links, and manipulates the result to be a speaking URL. So, no, it does not offer an own method, but extends existing ones. You don't use a link generation, but build it by yourself. RealURL therefore can not access your link.

The htaccess only converts speaking urls back into GET-params.

Use a method like pi_linkToPage, a link viewhelper, or a TypoScript typolink to generate a link.

$myLink1 = $this->pi_linkToPage('example', 42);
$myLink2 = $this->cObj->typolink('example', array(
    'parameter' => 42,
));
pixelbrackets
  • 1,958
  • 19
  • 28
  • Thanks for the attempt, but still not working as excepted. I have no access to $this->pi_linkToPage (or similiar) in my extensions (classes/controller/myfile). The 2nd attempt is the same. Call to a member function() typolink on a non-object – DasSaffe Aug 22 '14 at 12:11
  • aah, i'm getting there. Using $GLOBALS did the trick. Now i have to figure out how to wrap the link in a image all is good. thank you! – DasSaffe Aug 22 '14 at 12:20