Joomla – Modules not Loading

Well, I drew the short straw on this one, and have been goaded into writing this one up by my cohort. Both of us have developed several sites with Joomla, and so we know a little about Joomla, which is why this bug surprised us.  It took both of us working together, and for a good part independently, about three hours to find the answer to this bug.

What I thought I'd do is walk you through the process, like a mystery, and see if we can save, at least, one of our readers a couple of hours in the future, and while were doing that we'll talk about the operation of some of Joomla's internals.

Let's set the scene, one of the sites we maintain is a Joomla site with a Section Blog Layout front page.  The center of the page has three article snippets, each with a "read more" link to the full article on another page.

Normal operation: when you click on a "read more" link in each one of the three article snippets, a new page comes up with the full article in the center and a picture in the right sidebar.

The problem: When you click the "read more" link on one of the articles, the new page comes up with the entire article, however there is no picture in the right sidebar.  What made the problem more interesting was of the three articles, only one article did not bring up the picture, the other two articles operated normally, and brought up the picture in the right sidebar.

There you have it, pause number one. What's your first guess of what could cause this problem?

Answer: something is different in the one article without the picture, than the articles with the pictures in the right sidebar.

Looking at each article in the editor, the html was identical, except for the actual article content, in each or the articles, no, not the problem. And when you think of it, it didn't matter if the article html structure was different or not.

Let's go over how the screen populates.  You click on the "read more." This is a hidden menu with a link to the template page and article number of the full "read more" page.  When the template loads it goes to the database with the article number, retrieves the page, and inserts it into the center component section of the page.  The template then loads the module for the right sidebar, which goes to the media library, gets the correct picture, and places the picture in the module in the right sidebar, that's the normal flow.  The module controls the picture load, not the component which loads the article.  The article load has nothing to do with the right picture problem.

Let's move on. Pause number two, your next guess of what could be the cause of the problem?

Well, something in the module. The module's job is to place the picture in the right sidebar, true, but, two of the articles work properly, so the module is working properly.

Next guess, the menu link is not hooked up properly, or is bringing up the wrong template. We checked. No not the problem, the menu hook ups were identical to those of the two good articles, as were the section and category.  As a matter of fact, all the parameters you can configure by clicking on menus, the media library, modules, templates, and the articles were identical in all three articles, hmmm.

We started going through the modules and plug ins and wondering if there wasn't a conflict, yes, we were starting to pull at straws. Each time we're shot down, by the fact, that two articles are working properly.

Then we came to the "AceSEF" component.  For those not familiar with this component, it has the same functionality as "sh404SEF," and "JoomSEF."  Let's talk about what an SEF component does and how it works.

SEF stands for Search Engine Friendly. An SEF component's job is to make easy URL's for pages on your web site.  Instead of having a long URL with numbers and strange long cryptic text, you can call a page something like, "/the_cat_page," which will show up in the top of the browser in the address window.  The easy URL is easy to remember, and makes it easy for Google to list your site higher up in their ratings.

How does AceSEF or any SEF component work?  When you create a menu item to bring up an article, Joomla assigns it a Joomla URL with the article id number, category id number, and section id number.  This is the sites "Real URL".  The "Real URL" is usually cryptic, and hard to type.

In the case of a Section Blog Layout, actually three Real URL's are created for each article.  One for the Section Blog page with the article snippet and the "read more," one for the full length article page after you click "read more," and one for the edit page you use when you bring the page up in the article editor.

AceSEF automatically picks up these three menu items and allows you to give each a SEF friendly URL.  SEF programs, including sh404SEF, will allow you to designate one of these three pages as the main page to load, at the exclusion of the other two pages.

The answer to our riddle was in the SEF component.  The "Real URL" of the page with the module to load,  has a picture id included in the Real URL,  which identifies the picture to load into the module.  If the wrong "SEF URL" is assigned to the wrong "Real URL," then the wrong page loads.  The article will still load in it entirety as it is stored as a blob in the database, but the module will not be able to load the picture, since no picture is identified, so no module will load.  You'll end up with a blank space, while the other two articles will have the correct SEF link with the picture module and load correctly.

Bottom line, if you find a page where the module is not loading, while other pages with the same module work correctly.  Check your SEF component, and save yourself a lot of the time, we wasted, tracking this one down.


Joomla – Modules not Loading — 3 Comments

  1. Just want to thank you! Just spent hours on this. And yes, it was exactly the ItemID solution you provide here. You have to manually pick the main URL from your SEF component.

  2. thank you so much, but i went through it all and it does not seem i got new useful info from this blog except emphasizing the idea that i am right….could someone help me with the SEF component and how to fix it to make modules/images load in all articles???

    • Usually this occurs because your SEF component has multiple ‘real’ URLs for the same SEF url. The real URL ends with something like this: “option=com_content&view=article&id=53&Itemid=280” The problem comes about when your SEF package is using a URL without the ‘Itemid’ GET parameter. The id is a parameter that identifies the article in this case, Itemid identifies the menu item. Since your modules are positioned based on menu item constraints, a missing “Itemid=280” results in modules not loading.

      The correction technique varies depending on your SEF component, but they often have an area where administrators can choose a default real URL for a given SEF URL, make sure the default real URL includes the Itemid parameter, and your modules should load correctly.