A different Custom Component Router Issue

For Joomla! 4.x Coding related discussions, you could also use: http://groups.google.com/group/joomla-dev-general

Moderators: ooffick, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
neo314
Joomla! Apprentice
Joomla! Apprentice
Posts: 36
Joined: Sat Mar 13, 2010 4:22 am

A different Custom Component Router Issue

Post by neo314 » Mon Feb 19, 2024 6:57 pm

Hi All,

I wish I had an issue to krzys1985b's problem, but I have a different problem.

I have a series of steps that do not follow the categories to items model.

The the whole process is to register people for an upcoming event, and the first step is to collect their email address and determine if they already have an account (new system and they've never logged in before). The next step is to either go to the new user event registration form if they are a new user or to a login form if they are returning, and once logged in, go to the returning user event registration form.

The first URL is fine https://myhost.../2024-event-registration, but I am looking for the next link to be either

https://myhost.../2024-event-registration/returning instead of https://myhost.../2024-event-registrati ... =returning
or
https://myhost.../2024-event-registration/request instead of https://myhost.../2024-event-registration?view=request

In other words, /menu/view

I've tried extending RouterView and RouterBase, but I seem to have no impact on the URL.

I resolved the issue another way, by making hidden menu items, but it seems I should be able to create these throught a router. Am I just wrong on that?

Any tips or reference recommendations would be greatly appreciated.

MarkRS
Joomla! Explorer
Joomla! Explorer
Posts: 345
Joined: Thu Oct 29, 2009 8:28 am
Location: UK

Re: A different Custom Component Router Issue

Post by MarkRS » Thu Feb 22, 2024 10:02 am

Generally pages only really "exist" when there's a menu item pointing to them. As you've found, the normal strategy is to create menu items on menus that are never displayed themselves.

As you've also found, you can access pages that don't have menu items with their "ugly" URL, but you want the friendly one, so I think you have to use the hidden menu strategy. :eek:
It's a community, the more we all contribute, the better it will be.

neo314
Joomla! Apprentice
Joomla! Apprentice
Posts: 36
Joined: Sat Mar 13, 2010 4:22 am

Re: A different Custom Component Router Issue

Post by neo314 » Thu Feb 22, 2024 6:18 pm

I was hoping I could use the router method rather than the old hidden menu strategy, which still has value, or htaccess. It seems there should be a way to define static routes for views through router. I just needed to distinguish a "newly recorded request" from someone who logged back in but already submitted a request so the message on the page would read differently. I used a URL parameter isNew, but it would be nice easily to have my-request/new/


Post Reply

Return to “Joomla! 4.x Coding”