0
Welcome Guest! Login
0 items Join Now

SOLVED Gantry Defaulting to Home, Not Default Template

  • SOLVED Gantry Defaulting to Home, Not Default Template

    Posted 12 years 7 months ago
    • I tried searching for this issue but couldn't find anything. The website is beckysberries.com . The home page has a custom template including a background image. The default template is much simpler and really does need to be the default.

      Unfortunately, pages that are difficult to control such as Login forms, Search forms, Lost Password, etc. are showing up on the home page template instead of the default one. The easiest example is to search for 'berry' in the Search box. The results are not very legible so I need to fix this. Any help would be appreciated.
    • Last Edit: 11 years 11 months ago by Cari Adamek.
  • Re: SOLVED Gantry Defaulting to Home, Not Default Template

    Posted 12 years 7 months ago
    • Ok, maybe I wasn't very clear about my problem. Certainly I am not the only one struggling with this.

      I have defined my Default template to be a simpler layout for all pages except the home page. It is my understanding that any menu item that isn't specifically targeted to a specific template, is supposed to use the Default template. Upon further review, it seems to be doing this as far as module positions go.

      However, in a non-default template for the home page, I assigned a different CSS Style in the Style tab of Gantry. This CSS stylesheet for the home page is being assigned to Login forms, Search forms, Lost Password, etc. I don't understand why the module positions are being assigned appropriately but not the CSS style. Anyone have any ideas?
    • Andy Miller's Avatar
    • Andy Miller
    • Preeminent Rocketeer
    • Posts: 9919
    • Thanks: 96
    • Web Kahuna

    Re: SOLVED Gantry Defaulting to Home, Not Default Template

    Posted 12 years 7 months ago
    • Are you using the latest Gantry? 4.0.2 was released today, please try that.
  • Re: SOLVED Gantry Defaulting to Home, Not Default Template

    Posted 12 years 7 months ago
    • I finally found the solution. It was just difficult knowing what to search for. I do not know if this works in other Joomla templates but with Gantry, it's quite easy once you know how. For the record, this solution should work for people searching for solutions to:

      • joomla different background for each page
      • joomla different templates for different pages
      • joomla different home page

      I am being very detailed hoping that someone else doesn't have to spend weeks trying to figure this out like I did. Now that I know what's going on, I will explain it better than I did before.

      I have 2 separate template styles for my site: a Home template for just the home page; and a Default template for all other pages. When a page not assigned to a template via a menu item loads, such as the Lost Password page, it displays the Default template module positions correctly, but not the Default styles. It displays the Home template's styles instead which looks really bad because I have some heavy graphics on the home page background. I attached 3 screenshots of my site: Home, About with the default template, and the Lost Password page before it was fixed for reference. (I didn't include the Lost Password page after it was fixed but it does have the same header and background as the About page now that it's fixed.)

      I don't understand why having the appropriate styles in the home-styles.css and the default-styles.css doesn't work. Gantry specifically says, "If a particular template style is set to "Default" in the Template Manager: Styles, you will see that style throughout the site." My Default template style is set to default for 'all' pages. All I can say is that it doesn't work and searching for 'default template' issues didn't help me find a solution.

      However, my last search targeting 'different backgrounds' brought this post to my attention: www.rockettheme.com/forum/index.php?f=39..._v=viewtopic#p545638

      One of the first things I tried for this issue was to add a 'home' page suffix to my home page. It didn't work though because it only added the suffix to the content area, not the page body. However, Henning points out in his post that for the page suffix to be assigned to the page 'body' tag, we have to turn on the 'Page Suffix' feature in Gantry. The procedure has changed since his post so this is how to do if for Joomla 2.5, Gantry 3.2.22:

      1. Go to Extensions > Template Manager.
      2. Click on your Master template.
      3. Click the Advanced tab.
      4. Turn 'Page Suffix' on.

      After doing this, my 'home' page suffix now shows up as a class style for 'body'. For anyone reading this that doesn't know how to do this, here are some instructions. You can do this for any page you have a menu item for but my example is for the Home page.

      1. Go to Menus > MenuName. (example: 'Main Menu')
      2. Click on the menu item of the page you want to add a page suffix to. (example: 'Home')
      3. In the right column, click on 'Page Display Options'.
      4. In the 'Page Class' field, enter your page suffix. (example: 'home')

      Previously I had tried several ways of defining my home page styles and which stylesheet I placed them in. Each method only worked in some circumstances, not all. This is what worked for me to get my default template to include default styles for problematic pages like Lost Password.

      In template.css, add whatever styles you need for your special page but make sure to precede them with the body tag and your page suffix class. Mine, for example, one of mine looks like this:

      body.home #rt-main {background: transparent url(../images/body/bg-home-body.jpg) no-repeat center top;}

      This is how I would have done it in the first place if I had known what the Page Suffix feature was for. I'm still learning and love Gantry!

Time to create page: 0.078 seconds