0

I need to create a custom module with his own menu, when I click on that menu I want to display an article. For adding the menu I don't have any problem. The thing is when I click on the second menu I'm redirected to the article and I want to show it inside the page. How do I do that?

menu

Thanks in advance!

joomla version: 3.8.1

1 Answer 1

1

You have a few options.

One would to load all the sub pages on the initial page load but have only the active one showing. When one of the menu items is clicked the content is switched out via javascript (ie, hide the current page, show the new page).

Another option would be to have javascript make an AJAX call to grab the data for the selected menu item and then switch out the current article for the selected one.

The first option would increase page load time slightly but loading each article afterwards would be instant. The second option wouldn't increase the initial load time but when the menu items are clicked there will be a slight delay as the browser waits for the selected article's data to return from the server.

Another completely different option would be to have an iframe and load the articles in the iframe (you can use the tmpl=component query variable to only load the article in the iframe, without the rest of the template). I don't recommend this route for a number of reasons (SEO, usability, mobile-friendliness, etc).

1
  • Thanks ! I did the 1th option, I don't have that much text so it was the easiest solution. Commented Oct 16, 2017 at 7:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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