Linking to anchors in Joomla 1.0.12

creating a small component for Joomla myself, I got into the problem to link to an anchor while having SEF (search engine friendly Urls) enabled.

Searching the Joomla forum got me to some helpful topics: Anchors in templates with SEF and this one.

So you have to use

<a href="<?php echo sefRelToAbs( 'index.php?'. $_SERVER['QUERY_STRING'] . '#blabla' ); ?>">Content</a>

to get to an anchor on the current page!

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.