1

I have a component view being mapped to an alias:

/view1 is being redirected to ?option=com_mycomponent&view=view1

When I hit www.mysite.com/view1, I can see that the execution path is hitting the default.php of view1 by putting some debugging and and exit in there. The issue is when the page continues to load, the html that is added inside the default.php is removed.

I don't have this issue when I use an alias for the default view in the component and specify the task in the url. For example:

/mycomponent?view=view1 will load properly, where the alias mycomponent maps to the com_mycomponent's default view.

I'd like to alias the view directly using /view1 and have it behave the same way as if i had specified the view in the url. Is there a way to do that?

  • Are you the author of the component or just the administrator of the site? There is a "global" answer as well as a "per site" answer :) – Toni Marie Dec 4 '14 at 20:08
  • I'm both the author and the administrator :D – ContextSwitch Dec 4 '14 at 20:17
1

I'm sorry I'm not a programmer that writes this part but there are two approaches.

The first is to formulate your router to specifically direct that view. There's the Joomla default router, but you can also craft the router to be more accurate.

The other answer would be the per-site choice which is to use an external SEF manager like sh404SEF that would ensure the view is fully attributed each time the alias is used. You actually get to see the URL there in the cache and make sure it includes the "view" aspect in the nonSEF url.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.