0
Welcome Guest! Login
0 items Join Now

Adding Module Positions for Joomla 1.7, Gantry 3.2.12

    • Duane Mitchell's Avatar
    • Duane Mitchell
    • Hero Rocketeer
    • Posts: 296
    • Thanks: 5
    • Technology consultant

    Adding Module Positions for Joomla 1.7, Gantry 3.2.12

    Posted 13 years 1 week ago
    • I want to add a module row to the very top of the rt_gantry template. It going to be a "margin" with a graphic image in it. I found the tutorial "Adding Module Positions" but that is for Joomla 1.5 and it's apparently obsolete. I've been trying to pick my way through the files and come up with a solution. I've done pretty good but my new module is getting produced twice. Once where I want at the very top row of the template and then once outside the container at the very top left corner of the browser window.

      Another issue is that it is not clearing the next module row to fall underneath. As an example, I have my new module row "top_margin" and then there is "top". I want them to display as:

      top_margin
      top

      but the <div class="clear"></div> is not doing it's job and clearing after top_margin. However, if I remove that then it does! I don't understand that?

      I'd appreciate some help on adding a module position row to this system. Thanks!

      Duane Mitchell
    • Next Generation Solutions | www.nxgnsol.com | 617-539-6050
    • Cliff Pfeifer's Avatar
    • Cliff Pfeifer
    • Preeminent Rocketeer
    • Posts: 8444
    • Thanks: 20
    • Website Developer

    Re: Adding Module Positions for Joomla 1.7, Gantry 3.2.12

    Posted 13 years 1 week ago
    • Do you have this site on a server where I can see it? Let me know. If I can see your code I can probably fix it for you.
    • The difficult we do immediately, the impossible takes a little longer.
    • Duane Mitchell's Avatar
    • Duane Mitchell
    • Hero Rocketeer
    • Posts: 296
    • Thanks: 5
    • Technology consultant

    Re: Adding Module Positions for Joomla 1.7, Gantry 3.2.12

    Posted 13 years 1 week ago
    • Hi Cliff, thanks and sorry for the delay in returning back here. I do have this on a server you could get to. I didn't do anything fancy. I tried to follow the Gantry demo for adding module positions as closely as possible. The demo is obsolete. I was able to find what I think is the correct place for all the code except this one line:

      <param name="layouts" type="gspacer" default="" description="" label=" " glabel="LAYOUTS" />

      Here's the problem in a nutshell. I created a module named "top_margin". I want it at the very top of the template. The code is getting generated as:

      <div id="rt-top_margin">
      <div id="rt-top_margin">

      While it should be:

      <div id="rt-top_margin">
      <div class="rt-container">
      <div class="rt-grid-12 rt-alpha rt-omega"> (or something like this one)

      The rt-container is not getting generated.

      Maybe we could do a screen share on this? Would that work?

      I'll write this up as a solution if we can figure it out.

      Thanks.
    • Next Generation Solutions | www.nxgnsol.com | 617-539-6050
    • Cliff Pfeifer's Avatar
    • Cliff Pfeifer
    • Preeminent Rocketeer
    • Posts: 8444
    • Thanks: 20
    • Website Developer

    Re: Adding Module Positions for Joomla 1.7, Gantry 3.2.12

    Posted 13 years 1 week ago
    • Like I said, I need to see the code. What do you have in your index.php? That's what will affect the output of the HTML.
    • The difficult we do immediately, the impossible takes a little longer.
    • Duane Mitchell's Avatar
    • Duane Mitchell
    • Hero Rocketeer
    • Posts: 296
    • Thanks: 5
    • Technology consultant

    Re: Adding Module Positions for Joomla 1.7, Gantry 3.2.12

    Posted 13 years 1 week ago
    • OK, well, do you want to do a screen share with join.me or you want me to send you the login?

      I see what you say about the index.php and fixed some of that but I'm still getting the module coming out twice.
    • Next Generation Solutions | www.nxgnsol.com | 617-539-6050
    • Cliff Pfeifer's Avatar
    • Cliff Pfeifer
    • Preeminent Rocketeer
    • Posts: 8444
    • Thanks: 20
    • Website Developer

    Re: Adding Module Positions for Joomla 1.7, Gantry 3.2.12

    Posted 13 years 1 week ago
    • PM me your login information and I'll take a look.
    • The difficult we do immediately, the impossible takes a little longer.
    • Cliff Pfeifer's Avatar
    • Cliff Pfeifer
    • Preeminent Rocketeer
    • Posts: 8444
    • Thanks: 20
    • Website Developer

    Re: Adding Module Positions for Joomla 1.7, Gantry 3.2.12

    Posted 13 years 1 week ago
    • Hey, I fixed it, I've actually had this same problem before. As I suspected from what was happening, the issue is with the name of your positions. For some reason, Gantry doesn't like it when you use the same word in the name - like "top" - it was rendering your module in your new position and the actual top position, that's why it was there twice, it apparently can't tell the difference between top and top_margin.

      All I did was change your position name to margin, instead of top_margin, in all of the files and it works fine. I don't know why it does this, you just have to use unique position names to avoid it in the future. Hope that helps.
    • The difficult we do immediately, the impossible takes a little longer.
    • Duane Mitchell's Avatar
    • Duane Mitchell
    • Hero Rocketeer
    • Posts: 296
    • Thanks: 5
    • Technology consultant

    Re: Adding Module Positions for Joomla 1.7, Gantry 3.2.12

    Posted 13 years 1 week ago
    • Thank you so much! That is so cool to have a fix! I'm going to play around with it and follow up with a write up on how to do this in Joomla! 1.7.
    • Next Generation Solutions | www.nxgnsol.com | 617-539-6050
    • Duane Mitchell's Avatar
    • Duane Mitchell
    • Hero Rocketeer
    • Posts: 296
    • Thanks: 5
    • Technology consultant

    Re: Adding Module Positions for Joomla 1.7, Gantry 3.2.12

    Posted 13 years 6 days ago
    • Reviewing how to do this for Gantry 3.2.12 in Joomla! 1.7 and comparing the process to the steps in this demo.

      www.gantry-framework.org/documentation/j...ing-module-positions

      Step 2 has you add the following code to the template's index.php file in the position where you want your module row to appear. If you want it before the Header you put it before the Header, if you want it after then you put it after.

      <div id="rt-exampleposition">
      <?php echo $gantry->displayModules('example','standard','standard'); ?>
      <div class="clear"></div>
      </div>

      Step 3 has you add the following code to the templatesDetails.xml file. Following the format of the above step I pasted it into the sequential position of where the row will appear. I don't know if it matters on this one or not?

      <position>example-a</position>
      <position>example-b</position>
      <position>example-c</position>
      <position>example-d</position>
      <position>example-e</position>
      <position>example-f</position>

      Part 2 of Step 3 appears to be obsolete. There is no such line of code as specified in the demo:

      <param name="layouts" type="gspacer" default="" description="" label=" " glabel="LAYOUTS" />

      However if I look into the following files:

      template-options.xml
      template-options.12.xml
      template-options.16.xml

      I find similar code and add the code from the example into all 3. Not sure I need to add to all 3?

      <param name="examplePosition" type="positions" default="6,6" label="Label" description="Description goes here">
      <schemas>1,2,3,4,5,6</schemas>
      <words>2,3,4,5,6,7,8,9,10</words>
      </param>

      I change the "label" string to the actual name of the module position in order for it to appear in the Template Manger.

      This seems to work. If anyone has any comments feel free to add them.
    • Next Generation Solutions | www.nxgnsol.com | 617-539-6050
    • Henning's Avatar
    • Henning
    • Preeminent Rocketeer
    • Posts: 29362
    • Thanks: 954
    • Volunteer

    Re: Adding Module Positions for Joomla 1.7, Gantry 3.2.12

    Posted 13 years 6 days ago
    • Nice write up.

      One thing I'd like to add:

      <?php echo $gantry->displayModules('example','standard','standard'); ?>
      follows this pattern
      <?php echo $gantry->displayModules('name','gantry-rendering','mod-chrome');

      1. example = name of the module position. if you a have "standard'-module-rendering (see 2.) it will be example-a, example-b, example-c, example-d, example-e, example-f

      2. standard = module-layout. It adds the grid-classes. (libraries/gantry/html/layouts/mod_standard.php). Positions will be created from a to f together with this part in template-options.xml
      <param name="examplePosition" type="positions" default="6,6" label="Label" description="Description goes here">
      <schemas>1,2,3,4,5,6</schemas>
      <words>2,3,4,5,6,7,8,9,10</words>
      </param>
      (Just a very rough explanation. more here
      www.gantry-framework.org/documentation/j...custom-module-chrome
      www.gantry-framework.org/documentation/j...custom-module-layout
      It also could be 'basic". In this case it would just render a position 'example'

      3. standard = the mod_chrome that is used for the rendering around the modules you are publishing. You find the code in modules.php in the html folder of your template.
      It is also used for the presentation of the title of the module.
      In the basic-gantry template this is

      function modChrome_standard($module, &$params, &$attribs)
      {

      if (!empty ($module->content)) : ?>
      <?php if ($params->get('moduleclass_sfx')!='') : ?>
      <div class="<?php echo $params->get('moduleclass_sfx'); ?>">
      <?php endif; ?>
      <div class="rt-block">
      <?php if ($module->showtitle != 0) : ?>
      <div class="module-title">
      <h2 class="title"><?php echo $module->title; ?></h2>
      </div>
      <?php endif; ?>
      <?php echo $module->content; ?>
      </div>
      <?php if ($params->get('moduleclass_sfx')!='') : ?>
      </div>
      <?php endif; ?>
      <?php endif;
      }

      Think of it like this: green is around a-f, orange is around each individual module
      You can use that for advanced styling of module positions. Actually that is just where the fun begins ...

      Btw:
      template-options.xml <-- this is the one you are using
      template-options.12.xml <-- this is just a "template" for 12 columns
      template-options.16.xml <-- this is just a "template" for 16 columns

      If you are using 16 columns just rename
      template-options.xml to backup_template-options.xml
      and
      template-options.16.xml to template-options.xml

Time to create page: 0.046 seconds