0
Welcome Guest! Login
0 items Join Now

Modifying the mainbody

    • Ali Samii's Avatar
    • Ali Samii
    • Elite Rocketeer
    • Posts: 629
    • Thanks: 2

    Modifying the mainbody

    Posted 11 years 2 months ago
    • Hi,

      In the Gantry default template, the index.php file has the following code:
      <div id="rt-transition"<?php if ($gantry->get('loadtransition')) echo $hidden; ?>>
      	<div id="rt-mainbody-surround">
      		<?php /** Begin Main Top **/ if ($gantry->countModules('maintop')) : ?>
      		<div id="rt-maintop">
      			<div class="rt-container">
      				<?php echo $gantry->displayModules('maintop','standard','standard'); ?>
      				<div class="clear"></div>
      			</div>
      		</div>
      		<?php /** End Main Top **/ endif; ?>
      		<?php /** Begin Main Body **/ ?>
      		<div class="rt-container">
      	    		<?php echo $gantry->displayMainbody('mainbody','sidebar','standard','standard','standard','standard','standard'); ?>
      	    	</div>
      		<?php /** End Main Body **/ ?>
      		<?php /** Begin Main Bottom **/ if ($gantry->countModules('mainbottom')) : ?>
      		<div id="rt-mainbottom">
      			<div class="rt-container">
      				<?php echo $gantry->displayModules('mainbottom','standard','standard'); ?>
      				<div class="clear"></div>
      			</div>
      		</div>
      		<?php /** End Main Bottom **/ endif; ?>
      	</div>
      </div>

      Note, in the snippet above, I have deleted some structure to keep it focused on the elements I need to address.

      Specifically, in lines 11-15 of the snippet above you have the following:
      <?php /** Begin Main Body **/ ?>
      <div class="rt-container">
      		<?php echo $gantry->displayMainbody('mainbody','sidebar','standard','standard','standard','standard','standard'); ?>
      	</div>
      <?php /** End Main Body **/ ?>

      This generates a structure aling these lines:
      <div id="rt-main" class="mb9-sa3">
      	<div class="rt-container">
      		<div class="rt-grid-9 ">
      			<div class="rt-block">  <!-- THIS IS THE DIV I'D LIKE TO ADD A CUSTOM CLASS TO -->
      				<div id="rt-mainbody" style=""></div>
      			</div>
      		</div>
      	</div>
      </div>

      My design requires that the container around the mainbody have a transparent background, but that that actual 'mainbody' and 'sidebar' divs have a white (or other colour) background. This allows a small gap between the main body and the sidebar to show the full-screen background.

      I can easily modify my CSS to add a "background: transparent !important;" to <div ID="rt-main"> to set it's background to transparent.

      My question is where does the structure for 'mainbody' and 'sidebar' come from, and how do I either make a template override (preferred method) or otherwise modify that structure to add a class so I can control the background of the mainbody (as commented in the code above. I can't seem to find the file that generates the above structure, and would appreciate help finding the resources that generate the structure.
    • Thank you.

      Ali Samii
    • Ali Samii's Avatar
    • Ali Samii
    • Elite Rocketeer
    • Posts: 629
    • Thanks: 2

    Re: Modifying the mainbody

    Posted 11 years 2 months ago
    • This message contains only secure information that is visible to Ali Samii, moderators and administrators
    • Thank you.

      Ali Samii

Time to create page: 0.045 seconds