1

I am making a site with Joomla mainly because of the user levels. Now hands on into development enough that I cannot back out, I've realized that Joomla's theming is not as awesome as WordPress'.

When I started making the Joomla theme I realized there is no single.php like separate template for displaying article pages. But I want that when I click on an article link the page layout is wider so that the full article is more readable, basically I wanna hide the sidebar and make the article column wider when viewing a single article.

The biggest problem is that I have finished the HTML & CSS pre Joomla or any CMS jump with all the HTML5 tags and what not. I figured there would be template tags like WordPress or something similar that would give me complete control of my HTML but with Joomla everything just gets rendered as complete components with HTML and CSS all set in. It was such a pain when the pagination just rendered as a list when all I wanted was 2 links of previous page and next page. Am I doing something wrong or is Joomla just built this way.

If I start changing the components and modules the way I want, will they be changed back to defaults when I update the core. I read somewhere from 1.7 Joomla has integrated 1 click upgrades.

I sincerely hope I'm just wrong.

Sorry for jamming three questions in one but I think my title is quite explanatory so anyone looking for similar things would understand.

Thanks! I appreciate all the help.

Aayush
  • 3,079
  • 10
  • 49
  • 71

2 Answers2

1

and welcome to Joomla. Because your question(s) are long so will your answer so hold still...

First of all just to clear it up, the Joomla templating is a proper templating engine where as Wordpress is not (it's not even a CMS - check their website), this is often construed as poor coding rather than best practice as it's more of a steep learning curve.

1) I wanna hide the sidebar and make the article column wider when viewing a single article.

This can be done through conditional assignment within your template, if around your RH column in your template you can place this if statement:

if (JRequest::getString('option') != 'com_content' && JRequest::getString('view') != 'article') { echo '<div id="myRightHandColumn"><jdoc:include type="modules" name="right" style="xhtml" /></div>'; }

You will also need to apply this code to add a class to your wrapper around your main content to tell your CSS to make it wide.

2) give me complete control of my HTML but with Joomla everything just gets rendered as complete components with HTML and CSS all set in

That's not entirely true, all WELL made extensions have a views folder containing overridable html output. For example if you wished different HTML to be outputted for the article view from com_content you would copy this file:

/components/com_content/views/article/tmpl/default.php

and place it in your template like so:

/templates/your_template_name/html/com_content/article/default.php

3) If I start changing the components and modules the way I want, will they be changed back to defaults when I update the core.

Assuming you follow my instructions and use overrides rather than core-hacks then you will not lose changes when upgrading the core. Naturally you should never upgrade in a production environment.

If any parts are unclear just drop a comment and I will help as best I can.

udjamaflip
  • 682
  • 1
  • 8
  • 24
  • Thanks a lot. All this worked out perfectly. I have converted all the core changes that I made into overrides. Although I couldn't find the one for blog pagination. That would be really helpful, coz right now I'm hiding a lot of pagination stuff with CSS. It's a mess. Anyway thanks for taking the time. I really appreciate it. – Aayush Sep 08 '11 at 18:09
  • (I'm writing this without checking so sorry if it's wrong) - Check the Beez_20 template I think inside /html/ there is a pagination.php. Try copying that and editting that. – udjamaflip Sep 08 '11 at 20:25
  • I just checked and also check all the other templates. There isn't a pagination.php anywhere. Thanks anyway. – Aayush Sep 09 '11 at 09:04
1

You are definitely doing it wrong, Joomla's templating system is far more advanced and flexible than WP. You need to read up on the template override system and how to use collapsible module positions. The official documentation is still 1.5 focused, but it's pretty much the same thing as far as overrides and modules are concerned.

Overrides - http://docs.joomla.org/Understanding_Output_Overrides

Collapsing columns - http://docs.joomla.org/Collapsing_columns

All template docs - http://docs.joomla.org/Template_Development

You should also look in to the new template style options.

Brent Friar
  • 10,588
  • 2
  • 20
  • 31