0
Welcome Guest! Login
0 items Join Now

SOLVED Customising the gantry style to add more options

    • Boradan's Avatar
    • Boradan
    • Jr. Rocketeer
    • Posts: 42
    • Thanks: 0

    SOLVED Customising the gantry style to add more options

    Posted 12 years 8 months ago
    • I am happy with my site/template design now for http://www.symbiotic-ubiquity.co.uk , but am currently adding more options to the 'style' template in the gantry template editor.
      So far, it as working as planned, with the option set up to modify a custom style for the blocks - so far, you can change the border size, colour, radius and background colour, but I think I am going about it in a way thats inefficient.

      I cant figure out a way to have the fields 'chained' - well, thats wrong.... I cant figure out how to CALL the output when the fields are chained.

      The current options I have added to the template-options.php are :
                  <field name="bordersize" type="selectbox" default="0px" label="MODULE_BORDER_WIDTH"  setinsession="true"
                      setbysession="true" setincookie="true" setbycookie="true" isbodyclass="true">
                      <option value="0px">None</option>
                      <option value="1px">1 Pixel</option>
                      <option value="2px">2 Pixels</option>
                      <option value="3px">3 Pixels</option>
                      <option value="4px">4 Pixels</option>
                      <option value="5px">5 Pixels</option>
                      </field>    
                  <field name="bordercolor" type="colorchooser" default="transparent" label="MODULE_BORDER_COLOR" setinsession="true"
                     setbysession="true" setincookie="true" setbycookie="true"/>
                  <field name="backgroundcolor" type="colorchooser" default="transparent" label="MODULE_BACKGROUND_COLOR" setinsession="true"
                     setbysession="true" setincookie="true" setbycookie="true"/>
                  <field name="borderradius" type="selectbox" default="0px" label="BACKGROUND_RADIUS" setinsession="true"
                     setbysession="true" setincookie="true" setbycookie="true">
                      <option value="0px">None</option>
                      <option value="1px">1 Pixel</option>
                      <option value="2px">2 Pixels</option>
                      <option value="3px">3 Pixels</option>
                      <option value="4px">4 Pixels</option>
                      <option value="5px">5 Pixels</option>
                      <option value="6px">6 Pixels</option>
                      <option value="7px">7 Pixels</option>
                      <option value="8px">8 Pixels</option>
                      </field>

      This works fine with the following lines added to the styledeclaration.php :
              $css .= '.custom .rt-block {border-width:'.$gantry->get('bordersize').';}'."\n";
              $css .= '.custom .rt-block {border-color:'.$gantry->get('bordercolor').';}'."\n";
              $css .= '.custom .rt-block {background-color:'.$gantry->get('backgroundcolor').';}'."\n";
              $css .= '.custom .rt-block {border-radius:'.$gantry->get('borderradius').';}'."\n";

      All work as intended, but I would like to have these condensed into a chain in the style panel to make the configuring easier to follow. I can get them chained in the panel by wrapping the following line areound the code in the template-options.xml:
      <fields name="module" type="chain" label="MODULE_STYLING"> 
      **** CODE HERE***
      </fields>

      My question is.... what do I need to change in the styledeclaration.php code I added in order to call module>bordersize etc......?

      You can see from http://www.symbiotic-ubiquity.co.uk/layout that currently, the options WORK... it just isnt very neat considering I want to add a lot more options (both for module and module.title).....
    • Last Edit: 12 years 8 months ago by Boradan.
    • Shazdeh's Avatar
    • Shazdeh
    • Elite Rocketeer
    • Posts: 4984
    • Thanks: 29

    Re: SOLVED Customising the gantry style to add more options

    Posted 12 years 8 months ago
    • Boradan's Avatar
    • Boradan
    • Jr. Rocketeer
    • Posts: 42
    • Thanks: 0

    Re: SOLVED Customising the gantry style to add more options

    Posted 12 years 8 months ago
    • thankyou .... was trying it separated with a comma .... D'OH!

Time to create page: 0.076 seconds