0
Welcome Guest! Login
0 items Join Now

Gantry module position parameters

  • Gantry module position parameters

    Posted 12 years 1 month ago
    • I want to create a module position in the <head> </head> area of my template that will allow me to load modules that contain javascript that only loads on specific pages on my site. I don't want to bloat my homepage with Javascript that isn't needed on that page.

      So I opened my gantry index.php and added this code before the ending </head> tag.

      <?php echo $gantry->displayModules('add-head-code','standard','standard'); ?>

      It loads just as I suspect it would and even loaded my javascript file. However it adds the module div tags around it.
      <div class="rt-grid-12 rt-alpha rt-omega">
        <div class="rt-block ">
           <div class="module-surround">
             <div class="module-content">
                <div class="custom"  >
                     <script src="//cdn.optimizely.com/js/test123456.js"></script></div>
                 </div>
             <div class="module-bottom"></div>
           </div>
          </div>
      </div>

      So I'm wonding if displayModules('add-head-code','standard','standard'); is the key? What does 'standard','standard' mean? Is there an option that will display no div tags and just the contents of the module? My goal would to have the module only load this into my head:

      <script src="//cdn.optimizely.com/js/test123456.js"></script>

      Any suggestions or is there a module that could do this for me without a template hack?
    • Henning's Avatar
    • Henning
    • Preeminent Rocketeer
    • Posts: 29362
    • Thanks: 954
    • Volunteer

    Re: Gantry module position parameters

    Posted 12 years 1 month ago
    • Henning's Avatar
    • Henning
    • Preeminent Rocketeer
    • Posts: 29362
    • Thanks: 954
    • Volunteer

    Re: Gantry module position parameters

    Posted 12 years 1 month ago
    • you could also just use a php condition in the head tag of your index.php

      <?php $itemid = JRequest::getInt('Itemid', NULL); ?>
      <?php if ($itemid == 101) : ?>
      <script src="//cdn.optimizely.com/js/test123456.js">
      <?php endif; ?>

      $itemid == 101 is the id of the menu-item ...

      The rest is up to you ...
  • Re: Gantry module position parameters

    Posted 11 years 7 months ago
    • Hello, how to change this php condition for more menu itemids?
      Thanx
    • Henning's Avatar
    • Henning
    • Preeminent Rocketeer
    • Posts: 29362
    • Thanks: 954
    • Volunteer

    Re: Gantry module position parameters

    Posted 11 years 7 months ago
  • Re: Gantry module position parameters

    Posted 9 years 4 months ago
    • 2 years later and we still don't have an answer to this? How do we do raw??

      $gantry->displayModules('myheader','basic','basic');
    • Henning's Avatar
    • Henning
    • Preeminent Rocketeer
    • Posts: 29362
    • Thanks: 954
    • Volunteer

    Re: Gantry module position parameters

    Posted 9 years 4 months ago
    • you dont have to use the gantry syntax ... you can also use the standard joomla syntax with a mod_chrome that fits your needs ...

      Now that I think about you probably need to to override the mod_custom html-output to get rid of unwanted divs.
    • Last Edit: 9 years 4 months ago by Henning.
  • Re: Gantry module position parameters

    Posted 9 years 4 months ago
    • Thanks I killed /modules/mod_custom/tmpl/default.php

      That's an imcompetent file, customs means custom!
    • Last Edit: 9 years 4 months ago by Hola789432.
    • Henning's Avatar
    • Henning
    • Preeminent Rocketeer
    • Posts: 29362
    • Thanks: 954
    • Volunteer

    Re: Gantry module position parameters

    Posted 9 years 4 months ago

Time to create page: 0.075 seconds