Solved

Joomla component question

Posted on 2011-02-13
22
307 Views
Last Modified: 2013-11-19
Hi,

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?

Thanks,

0
Comment
Question by:Eternal_Student
  • 8
  • 8
  • 6
22 Comments
 
LVL 9

Expert Comment

by:Rowby Goren
ID: 34882688
Try this link:

http://extensions.joomla.org/search?q=h1

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

Rowby

0
 
LVL 18

Author Comment

by:Eternal_Student
ID: 34882953
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.
0
 
LVL 9

Expert Comment

by:Rowby Goren
ID: 34882960
Let's see if anyone else has suggestions.

Rowby
0
 
LVL 13

Expert Comment

by:joomla_php
ID: 34883297
Can I ask why?
0
 
LVL 18

Author Comment

by:Eternal_Student
ID: 34883392
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?
0
 
LVL 13

Expert Comment

by:joomla_php
ID: 34883464
This is a bit long
http://docs.joomla.org/Understanding_Output_Overrides

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.

e.g.
components/com_contact/views/category/
template/beez/html/com_contact/category

If you put a debug statement in each of these and run the contact page you'll know who's in charge.
0
 
LVL 9

Expert Comment

by:Rowby Goren
ID: 34883717
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.

0
 
LVL 18

Author Comment

by:Eternal_Student
ID: 34884276
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?

0
 
LVL 13

Expert Comment

by:joomla_php
ID: 34884340
I don't understand that question.
0
 
LVL 9

Expert Comment

by:Rowby Goren
ID: 34884360
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.

Rowby
0
 
LVL 18

Author Comment

by:Eternal_Student
ID: 34886090
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?
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 13

Expert Comment

by:joomla_php
ID: 34886115

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.
0
 
LVL 13

Expert Comment

by:joomla_php
ID: 34886119
Not for all banners assigned to position "banner."
... to all MODULES assigned to position "banner."
0
 
LVL 18

Author Comment

by:Eternal_Student
ID: 34886880
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.
0
 
LVL 13

Expert Comment

by:joomla_php
ID: 34888494
To a different php file? I don't know what that means.
0
 
LVL 9

Expert Comment

by:Rowby Goren
ID: 34888675
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??????
Rowby
0
 
LVL 18

Author Comment

by:Eternal_Student
ID: 34888743
I found this to be a solution for what I was looking for:

http://netingredient.com/blog/joomla-15-add-new-module-position-inside-article

Can you see any reasons why this would be a bad idea?
0
 
LVL 9

Expert Comment

by:Rowby Goren
ID: 34888865
If you like that solution, you might want to look at this

http://extensions.joomla.org/extensions/core-enhancements/embed-a-include/6958

Importantly, the reviews look pretty good.


Rowby
0
 
LVL 18

Author Comment

by:Eternal_Student
ID: 34888994
I did have a look at that extension Rowby but couldnt figure it out!
0
 
LVL 9

Accepted Solution

by:
Rowby Goren earned 500 total points
ID: 34889357
I think it would do what you want --- without you having to hack any core files.

Check out the documentation.

Every module in your site has an unique ID, different from ANY module on your site.  You would reference that module ID.  For example you might have a contact form module with an ID of 112.  And a custom module with an ID of 418.  You would just use the following simple code right in your article.

Examples

such as
{module [112]}  (for the contact form module
{module [418]}  (for the custom module

If you use this plugin make sure you go into Joomla's plugin manager and publish it (in case it's not published).

NOTE:  I have not tried this module, but the instructions seem pretty basic, and it has some excellent reviews.

I am going to download it an use it myself the next time I need something like this.

Rowby
0
 
LVL 18

Author Comment

by:Eternal_Student
ID: 34889897
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.
0
 
LVL 9

Expert Comment

by:Rowby Goren
ID: 34889968
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.

http://www.pages-and-items.com/forum/

Rowby



Rowby

0

Featured Post

A Knowledge Base That Stays Up-to-Date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
This video teaches users how to migrate an existing Wordpress website to a new domain.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now