0
Welcome Guest! Login
0 items Join Now

Gantry 5: What is "Chrome"(not talking about the browser)

    • shenk's Avatar
    • shenk
    • Hero Rocketeer
    • Posts: 424
    • Thanks: 11

    Gantry 5: What is "Chrome"(not talking about the browser)

    Posted 8 years 9 months ago
    • In Gantry 5 layout manager -> position particle setting, other than 'key', there is a field called "chrome", what is this about?
    • Henning's Avatar
    • Henning
    • Preeminent Rocketeer
    • Posts: 29362
    • Thanks: 954
    • Volunteer

    Re: Gantry 5: What is "Chrome"(not talking about the browser)

    Posted 8 years 9 months ago
    • docs.joomla.org/Module_chrome

      You find it in templates/"templatename"/html/modules.php

      basically it's the html-structure in that the content of a module get's rendered ...
      I think right now Gantry is using just one chrome and so there is not much to choose from right now.
    • Last Edit: 8 years 9 months ago by Henning.
    • shenk's Avatar
    • shenk
    • Hero Rocketeer
    • Posts: 424
    • Thanks: 11

    Re: Gantry 5: What is "Chrome"(not talking about the browser)

    Posted 8 years 9 months ago
    • Thanks for the info. Looks like this feature has been there since 1.5, surprisingly I've been using joomla for years but never heard of it before. I've read the documentation you linked but I still don't get what it does and how it affects my website. And although gantry 5 documentation mentions it here and there, but I can't find any details about it.
    • Henning's Avatar
    • Henning
    • Preeminent Rocketeer
    • Posts: 29362
    • Thanks: 954
    • Volunteer

    Re: Gantry 5: What is "Chrome"(not talking about the browser)

    Posted 8 years 9 months ago
    • just take a look at the file I mentioned


      // Gantry Specific Module Chrome
      function modChrome_gantry($module, &$params, &$attribs)
      {
      	$moduleTag      = $params->get('module_tag', 'div');
      	$headerTag      = htmlspecialchars($params->get('header_tag', 'h3'));
      	$bootstrapSize  = (int) $params->get('bootstrap_size', 0);
      	$moduleClass    = $bootstrapSize != 0 ? ' span' . $bootstrapSize : '';
      
      	// Temporarily store header class in variable
      	$headerClass    = $params->get('header_class', 'g-title');
      	$headerClass    = ($headerClass) ? ' class="' . htmlspecialchars($headerClass) . '"' : '';
      
      	if (!empty ($module->content)) : ?>
      		<<?php echo $moduleTag; ?> class="moduletable <?php echo htmlspecialchars($params->get('moduleclass_sfx')) . $moduleClass; ?>">
      			<?php if ((bool) $module->showtitle) : ?>
      				<<?php echo $headerTag . $headerClass . '>' . $module->title; ?></<?php echo $headerTag; ?>>
      			<?php endif; ?>
      			<?php echo $module->content; ?>
      		</<?php echo $moduleTag; ?>>
      	<?php endif;
      }

      As you can see in the code in this file reponsible for how the title of the module and the mod-class get rendered. Devs know that file very well. Most "regular" users never touch it. Since Gantry 5 allows you to build modulepositions (and not just modules) there is a need to have the chrome option so devs can use it in Gantry5.

      Right now Hydrogen offers only one chrome. Other templates may offer several in the future
    • Last Edit: 8 years 9 months ago by Henning.

Time to create page: 0.040 seconds