0
Welcome Guest! Login
0 items Join Now

Creating a module variation

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

    Re: Creating a module variation

    Posted 12 years 8 months ago
    • GoG wrote:
      And while we are at it, how can I reduce the vertical separation between modules published in the sidebar-a position. There's a gap of at least 50 pixels that looks unattractive.

      Can you give me a link where I can check this?
    • GoG's Avatar
    • GoG
    • Rocketeer
    • Posts: 91
    • Thanks: 1

    Re: Creating a module variation

    Posted 12 years 8 months ago
    • Henning wrote:
      Just some basic pointers.
      There are two main ingredients for mod-suffixes.

      The html that is used in the modChrome. Think of it what directly surrounds the module you publish. You can check the modules.php in the html folder of your template for that.

      this is the "standard"-modChrome:

      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;
      }

      The modChrome is set via this piece of code in index.php
      <?php echo $gantry->displayModules('top','standard','standard'); ?>
      The 2nd "standard" is the one that sets the chrome.

      Now you can see that the chrome is much simpler as it is in the club-releases.
      In the club releases we also have divs like <div class="module-surround">
      that can be used for styling.

      In the modChrome

      <div class="<?php echo $params->get('moduleclass_sfx'); ?>">

      is pulling the mod-suffix.

      So checking the code you see there is .rt-block in that code-block.
      We can use that now. (if you really want to get into I would add an element just for the mod-suffix.)

      Just to give an example:
      Here is the code for three mod-suffixes.
      One that adds rounded corners and two add background colors ...

      div.suffix-1 div.rt-block {
      background-color: maroon;
      color: white;
      }

      div.rounded div.rt-block {
      -webkit-border-radius: 10px;
      -moz-border-radius: 10px;
      border-radius: 10px
      }

      div.suffix-2 div.rt-block {
      background-color: red;
      color: white;
      }

      they can be used as a mod-suffix in a combination like this:
      "suffix-2 rounded"

      I hope this helps. Of course it's just the beginning. Check out the latest templates to see what other cool things you can do. The suffix can also be used as a toggle to inject html-elemnts to the module chrome for icons, badges etc ...

      Thanks for your reply, that should get me started :)
    • GoG's Avatar
    • GoG
    • Rocketeer
    • Posts: 91
    • Thanks: 1

    Re: Creating a module variation

    Posted 12 years 8 months ago
    • Henning wrote:
      GoG wrote:
      Also, why won't adding a line to style1.css like this;

      #rt-content-top-a {background-color: #eeeeee;}

      change the background of that module position?


      because there is no
      <div id="rt-content-top-a">...</div> in the code.
      If it doesn't exist you can't style it.

      When you create mod-suffixes you have to look into the generated html-structure wich gives you the hooks to style ...

      Noted.
    • GoG's Avatar
    • GoG
    • Rocketeer
    • Posts: 91
    • Thanks: 1

    Re: Creating a module variation

    Posted 12 years 8 months ago
    • Henning wrote:
      GoG wrote:
      And while we are at it, how can I reduce the vertical separation between modules published in the sidebar-a position. There's a gap of at least 50 pixels that looks unattractive.

      Can you give me a link where I can check this?

      Still working on intranet installation, but no worries I figured this one out by tinkering with margins in the CSS.
    • Adrie's Avatar
    • Adrie
    • Newbie
    • Posts: 6
    • Thanks: 0

    Re: Creating a module variation

    Posted 11 years 6 months ago
    • hello is this where I can ask about creating a new module class suffix?
    • Henning's Avatar
    • Henning
    • Preeminent Rocketeer
    • Posts: 29362
    • Thanks: 954
    • Volunteer

    Re: Creating a module variation

    Posted 11 years 6 months ago
    • the posts above don't help you?

Time to create page: 0.059 seconds