0
Welcome Guest! Login
0 items Join Now

Additional content-top module positions

    • Henning's Avatar
    • Henning
    • Preeminent Rocketeer
    • Posts: 29362
    • Thanks: 954
    • Volunteer

    Re: Additional content-top module positions

    Posted 13 years 10 months ago
    • Ok my answer to the first post. I didnt manage to just duplicate content-top-a-b-c.
      But what you can achieve easily is to add a position "Extra" without that abc.

      open in the template-folder
      html/layouts/body_mainbody.php
      or
      html/layouts/orderedbody_mainbody.php

      that depends on wich file is used in the index.php of the template.

      <?php echo $gantry->displayMainbody
      or
      <?php echo $gantry->displayOrderedMainbody ...

      after
      <?php if (isset($fparams->contentTop)) : ?>
       <div id="rt-content-top">
      <?php echo $fparams->contentTop; ?>
       <div class="clear"></div>
      </div>
      <?php endif; ?>

      add
      <?php /** Begin Extra **/ if ($gantry->countModules('extra')) : ?>
      <?php echo $gantry->displayModules('extra','basic','standard'); ?>
      <?php /** End Extra **/ endif; ?>

      in templateDetails.xml add the position
      <position>extra</position>

      Now you can add a module to that position.
      But as I said you don't have the a/b/c option for this ...
    • DanG's Avatar
    • DanG
    • Preeminent Rocketeer
    • Posts: 36750
    • Thanks: 3229
    • Custom work done

    Re: Additional content-top module positions

    Posted 13 years 10 months ago
    • Adding to what our Gantry-guru Henning said there are 12 files that you would have to recode to duplicate Gantry's functionality of content-top a-c, they are:
      ...\components\com_gantry\CHANGELOG.php
      ...\components\com_gantry\core\renderers\gantrymainbodyrenderer.class.php
      ...\components\com_gantry\core\renderers\gantryorderedmainbodyrenderer.class.php
      ...\components\com_gantry\css\gantry.css
      ...\components\com_gantry\css\gantry-ie6.css
      ...\components\com_gantry\html\layouts\body_mainbody.php
      ...\components\com_gantry\html\layouts\orderedbody_mainbody.php
      ...\templates\rt_zephyr_j15\params.ini
      ...\templates\rt_zephyr_j15\templateDetails.xml
      ...\templates\rt_zephyr_j15\css\template.css
      ...\templates\rt_zephyr_j15\css\template-ie6.css
      ...\templates\rt_zephyr_j15\html\layouts\body_mainbody.php
      wpd90
    • Mr Toast's Avatar
    • Mr Toast
    • Sr. Rocketeer
    • Posts: 152
    • Thanks: 0
    • Wanderer, philanderer, occasional web monkey

    Re: Additional content-top module positions

    Posted 13 years 10 months ago
    • Thanks Henning and Dan for such quick help, thats excellent!
    • Cheers,
      Mr Toast says... keep toasting!
    • DrVolt's Avatar
    • DrVolt
    • Jr. Rocketeer
    • Posts: 38
    • Thanks: 1

    Re: Additional content-top module positions

    Posted 13 years 10 months ago
    • I think such an important feature should be added in a future release of Gantry with no need to hack the code.

      I hope RT will implement this soon.
    • Henning's Avatar
    • Henning
    • Preeminent Rocketeer
    • Posts: 29362
    • Thanks: 954
    • Volunteer

    Re: Additional content-top module positions

    Posted 13 years 10 months ago
    • No chance for that ...
      (from my personal view)

      Edit: Actually I just talked to Andy about that ... the team will look at it when it comes to Gantry 4.0.
      But dont't take this as a promise ...
    • CHRISY's Avatar
    • CHRISY
    • Jr. Rocketeer
    • Posts: 28
    • Thanks: 0

    Re: Additional content-top module positions

    Posted 13 years 10 months ago
    • Henning,

      Thanks for the code snippets which helped a great deal.

      However, I noted that in using the code as written, the additional div id's don't appear in the rendered page code, this making it impossible to add css.

      Through trial and error I've discovered that div id must be specfied in the additional 'count modules' code as well to obtain style control over these div's.

      Surely it must be possible to combine the two code snippets and thus do away with this duplication?

      I'm at a loss as to how to do that though, and wonder if you'd be kind enough to advise?

      Be Well,

      CHRIS
    • Henning's Avatar
    • Henning
    • Preeminent Rocketeer
    • Posts: 29362
    • Thanks: 954
    • Volunteer

    Re: Additional content-top module positions

    Posted 13 years 10 months ago
    • hmm sorry for the confusion ...
      Actually I noticed that my first snippet was not correct, Its really just about finding the existing contentTop stuff and add ...

      <?php /** Begin Extra **/ if ($gantry->countModules('extra')) : ?>
      <div id="mynewdiv">
      <?php echo $gantry->displayModules('extra','basic','standard'); ?>
      <div class="clear"></div>
      </div>
      <?php /** End Extra **/ endif; ?>

      below that ... (and use the #mynewdiv in the css)
      So not TWO snippets ... just ONE that you must add.
      (I corrected my post, really just a "cut and paste" error from my modified local code...)
    • CHRISY's Avatar
    • CHRISY
    • Jr. Rocketeer
    • Posts: 28
    • Thanks: 0

    Re: Additional content-top module positions

    Posted 13 years 10 months ago
    • Henning,

      You are a true "code god" sir.

      Thanks so much for the prompt reply.

      Be Well,

      CHRIS
    • CHRISY's Avatar
    • CHRISY
    • Jr. Rocketeer
    • Posts: 28
    • Thanks: 0

    Re: Additional content-top module positions

    Posted 13 years 10 months ago
    • Henning,

      One final question if I may?

      In the Gantry framework is it possible to attach a different body-mainbody.php layout to a particular page?

      For example, I'm creating a News Section made entirely of modules (Rok Stories, K2 Content etc etc) to deliver content to the landing page.

      It would be pretty neat to be able to apply a body-mainbody2.php (or something similar) to this page alone.

      Hope you can advise?

      Be Well,

      CHRIS
    • Henning's Avatar
    • Henning
    • Preeminent Rocketeer
    • Posts: 29362
    • Thanks: 954
    • Volunteer

    Re: Additional content-top module positions

    Posted 13 years 10 months ago
    • would be easier to link that page to the frontpage component (it actually doesnt have to be the frontpage for this) and disable the display of the main-component in the template-settings (template-seetings>advanced). Doing it this way you can build a page only from modules ...

Time to create page: 0.062 seconds