1

I would like to be able to enter relative URLs (relative to the current page URL). I've tried the menu type URL (nested within System Links) but when I enter e.g. first it becomes /first and when I enter ./first it yields the same result.

Maybe I've overlooked some functionality?

To give some context and the workaround I've been using:

I have one main menu which resides at / (Joomla installation root, frontend part).

But I also have a menu with 'special' links (navigational links) which appears at a template position only available when displaying a certain component.

So when displaying the other menu, the navigational menu, instead of the main menu, the URL changes to refer to the thing the component needs to display (e.g. /custom-component-prefix/my-very-special-item).

I would like then to have a few relative URL's, so I can then route these relative links (via a HTTP redirect) to display proper follow-up items (and previous items, etc.): e.g. links resulting in: /custom-component-prefix/my-very-special-item/previous (which redirects to previous item) (or /custom-component-prefix/my-very-special-item/next).

Currently I have this workaround: I use placeholders within the navigational menus which I replace with the proper URLs (by means of an override of mod_menu within my template).

Though I would prefer to directly use relative URLs (relative to currently displayed item) which then redirect to proper URL (previous item / next item).

Of course, I could also integrate a custom menu within the component. But then I would have to copy some functionality of the Joomla menu system to that component (Joomla menu system has great support for ordering menu items, changing images and text for menus; so I was thinking about the DRY principle).

  • Is your /my-very-special-item a record or item from a table in your Component like we would think of an Article with a Title and Alias is as part of Com-Content ? The way I read your post is you are wanting to present 'featured' items from your component and be able to traverse back and forth between them using menu items. Unless your Items are called next and previous I don't see how you can call them with my-very-special-item/next as the lowest level is normally the item to be displayed. – Irata Sep 14 at 23:33
  • @Irata Thanks for responding. 'next' and 'previous' are things that are checked within the script which controls the (custom) routing. It's just a title of an item which is stored in a record but it's a record stored in a table of a custom component. – Wieger Sep 16 at 7:36
  • I've edited my post to add a 'custom-component-prefix' which marks the URL as to be handled by the custom component instead of com_content (to clarify things). – Wieger Sep 19 at 5:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.