Link to home
Avatar of Eternal_Student
Eternal_StudentFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Joomla component question


I am relatively new to Joomla and I am trying to skin the beez template to match my design.

The 1st problem I have encountered is that index.php outputs the content in a component with the line <jdoc:include type="component" />. Now, inside here you have the article headings and content that has been added in the CMS. I need to style the headings in a way that they are separate from the content. So I need more control over the mark up of the headings before the content comes in. This isn't something I can do with just CSS ... I need to make HTML changes.

Is there a way to separate the headings from the content into 2 different components and output them where I need in index.php? Or is there another approach I should be taking?


Avatar of Rowby Goren
Rowby Goren
Flag of United States of America image

Try this link:

Also I've  used sh404sef to handle H1 and h2 issues, but it may be overkill for what you want.


Avatar of Eternal_Student


Do I really need to install an extension for this problem I am facing? Is there no way to manipulate what is already there? I'm not sure if those extension are really what I am looking for.
Let's see if anyone else has suggestions.

Avatar of Member_5340450

Can I ask why?
Actually ... I have discovered that each article/section etc has its' own template - default.php where those headings can be styled as desired.

My problem at the minute is that I have some sub menus (modules) in index.php page but I need to move them to \html\com_content\article\default.php where they need to appear in some mark up. How do I go about doing this?
This is a bit long

But I'm sure it'll put you in the right direction.

You can see examples of output overrides in your basic installation in any of the "views" directories.

Sometimes it's confusing which has precedence because the same content can be overridden at the template level.


If you put a debug statement in each of these and run the contact page you'll know who's in charge.
The good thing about content overrides is they don't touch the core joomla files.

That way if there is a joomla update there is no worry about your core files being overwritten -- and your modifications being lost.

I will read that link you have provided, thanks.

But to answer my questions, is it possible to add a module to a default.php page?

I don't understand that question.
Generically speaking, you can add a module to any module position that has been set up in the template.

And to a certain extent you can have different templates assigned to different module positions.

BTW any other Joomla experts are welcome to join in on this discussion.

My question is ...

Currently I am trying to re-skin the beez template and when ever I create a module it is put inside index.php. But due to how the site is structured and designed I really need those modules to be elsewhere in the code, in this case - \html\com_content\article\default.php. How can I achieve this?

A module is a chunk of code that is placed somewhere on the page. It's a small unit of behavior such as a menu.

When you publish a module, Joomla places it in a placeholder area. The template defines that placeholder.

So for instance if your template (index.php) says:

<?php mosLoadModules('banner', -1); ?>

Then at that spot in the HTML, Joomla spits out the HTML for all banners assigned to position "banner."

If you want to override the module's HTML, and that module is properly written for MVC architecture (many aren't), then you would modify the modules tmpl/default.php file.
Not for all banners assigned to position "banner."
... to all MODULES assigned to position "banner."
I've just found out you can add modules to content in an article ... this could be handy.

Ideally though I just want to add the module to a different php file.
To a different php file? I don't know what that means.
In Joomla 1.5 you can assign completely different templates to any Menu item.  I don't know if that would solve your issue.

Also (I don't think I mentioned it in this suggestion)  You might want to consider the new version of Joomla 1.6  -- which has  more control over layout and templates (as I understand).

Perhaps other Joomla experts can make suggestions for this question -- taking advantage of Joomla 1.6??????
I found this to be a solution for what I was looking for:

Can you see any reasons why this would be a bad idea?
If you like that solution, you might want to look at this

Importantly, the reviews look pretty good.

I did have a look at that extension Rowby but couldnt figure it out!
Avatar of Rowby Goren
Rowby Goren
Flag of United States of America image

Blurred text
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
I see, that wasn't actually the one I was looking at.

So, do you put the code in the article or the php file? I would rather it was in the php code to be honest.
Like many plugins of this type, you simply type in the code...

{module [112]}

....right in the article  at the position where you want the specific module to appear.  (Make sure the code is clean with just the {module [112]} code and no hidden markup -- which can happen with some editors.

In fact you might want to double check your HTML source to make sure the source also says...

{module [112]}

Also I suppose you can use divs to further position the module in the article.

I also suggest you check the forum that supports this specific plugin.