0
Welcome Guest! Login
0 items Join Now

[SOLVED[ Adding a custom position to templates

    • ZioRiP's Avatar
    • ZioRiP
    • Hero Rocketeer
    • Posts: 282
    • Thanks: 0

    [SOLVED[ Adding a custom position to templates

    Posted 10 years 10 months ago
    • Hi, I am using Stratos (but I think it is irrelevant) on Joomla 3.
      It is the first time I try to do something like this in my life as I have just finished to read something about html and css.
      I think I need to add a custom position for the logo of the website that I am building for myself. I need this logo to be where the header-a position is, but I need it to be overlapping the usual header boundaries in order to prevent the logo to change the height of the header as I want it to be a high as it is in the rocket launcher version (so with the navigation menu).

      Said so, I believe I need to do some customizations that go over the usual change and resize image :)
      I have been reading gantry documentation and joomla 3 documentation related to templating and I have customized my index.php file in the template folder adding the following code between the top position and the header position code:
       
      <?php /** Begin Logo **/ endif; ?>
             <div id="customLogo">
                  <?php echo $gantry->displayModules('logo','standard','standard'); ?>
             </div>
      <?php /** End Logo **/ endif ?>
       

      I will obviously create some css with the "customLogo" id.

      Then I have added the following code in the templateDetails.xml file, right between the top and the header codes:
      <position>logo</position>

      I have then added some code in the other xml file, the templateOptions (and here I have some doubts), exactly the one related to the "logo":
       
      <fields name="top" type="position" label="TOP_POS" description="LAYOUT_POS_DESC">
           <field name="layout" type="positions" default="3,3,3,3" label="">
                <schemas>1,2,3,4,5,6</schemas>
                <words>2,3,4,5,6,7,8,9,10</words>
           </field>
           <field name="showall" type="toggle" default="0" label="FORCE_POS"/>
           <field name="showmax" type="showmax" default="6" label="POS_COUNT"/>
           </fields>
              
      <fields name="logo" type="position" label="logo" description="LAYOUT_POS_DESC">
           <field name="layout" type="positions" default="3,3,3,3" label="">
                <schemas>1,2,3,4,5,6</schemas>
                <words>2,3,4,5,6,7,8,9,10</words>
           </field>
           <field name="showall" type="toggle" default="0" label="FORCE_POS"/>
           <field name="showmax" type="showmax" default="6" label="POS_COUNT"/>
      </fields>
       
      <fields name="header" type="position" label="HEADER_POS" description="LAYOUT_POS_DESC">
           <field name="layout" type="positions" default="3,3,3,3" label="">
                <schemas>1,2,3,4,5,6</schemas>
                <words>2,3,4,5,6,7,8,9,10</words>
           </field>
           <field name="showall" type="toggle" default="0" label="FORCE_POS"/>
           <field name="showmax" type="showmax" default="6" label="POS_COUNT"/>
      </fields>
       

      Now, I am not sure if the last code is correct for my needs and above all I don't seem to have understood where to add the css code. I wanted to create my own css file with just that id style, but I can't find any calls to the stylesheets in the index.php file and I have noticed that the css folder doesn't have many files as I expected.

      Can anyone help me with this problem? I would just like to know if I have done everything correct so far and where I can add my own css file and how I can call it so that the system recognizes it. I would like to just add a <link type="text/css" href="custom/css/customlogo.css' rel="stylesheet" /> within the head portion of the index file, but I am not sure cause I don't see anything about css in there.

      Thanks in advance for the support :)
    • Last Edit: 10 years 10 months ago by ZioRiP.
    • Henning's Avatar
    • Henning
    • Preeminent Rocketeer
    • Posts: 29362
    • Thanks: 954
    • Volunteer

    Re: [SOLVED[ Adding a custom position to templates

    Posted 10 years 10 months ago
    • best is to add a custom css rt_stratos-custom.css in the css folder of template and to add your code

      #customLogo {your css}
    • ZioRiP's Avatar
    • ZioRiP
    • Hero Rocketeer
    • Posts: 282
    • Thanks: 0

    Re: [SOLVED[ Adding a custom position to templates

    Posted 10 years 10 months ago
    • Thanks, I am on it! :)
      So glad you were this fast hehehe
    • ZioRiP's Avatar
    • ZioRiP
    • Hero Rocketeer
    • Posts: 282
    • Thanks: 0

    Re: [SOLVED[ Adding a custom position to templates

    Posted 10 years 10 months ago
    • I am wondering if there is anything wrong with this code in the index.php file of the template, the website shows a completely white page. If I remove it, the website works again:
       
      <?php /** Begin Custom Logo **/ endif; ?>
        <div id="customLogo">
          <?php echo $gantry->displayModules('custom-logo','standard','standard'); ?>
          <div class="clear"></div>
        </div>
      <?php /** End Custom Logo **/ endif ?> 
       
    • Henning's Avatar
    • Henning
    • Preeminent Rocketeer
    • Posts: 29362
    • Thanks: 954
    • Volunteer

    Re: [SOLVED[ Adding a custom position to templates

    Posted 10 years 10 months ago
    • <?php /** Begin Custom Logo **/ endif; ?> can't work ...

      <?php /** Begin Custom Logo **/ if ($gantry->countModules('custom-logo')) : ?>
      <div id="customLogo">
      <?php echo $gantry->displayModules('custom-logo','standard','standard'); ?>
      <div class="clear"></div>
      </div>
      <?php /** End Custom Logo **/ endif; ?>

      just look at a different positions and use copy paste to get the code right.
      Also I suggest to clear the gantry cache ...
    • ZioRiP's Avatar
    • ZioRiP
    • Hero Rocketeer
    • Posts: 282
    • Thanks: 0

    Re: [SOLVED[ Adding a custom position to templates

    Posted 10 years 10 months ago
    • I Just noticed that there was an 'if (gantry etc
      Thanks! :)
    • ZioRiP's Avatar
    • ZioRiP
    • Hero Rocketeer
    • Posts: 282
    • Thanks: 0

    Re: [SOLVED[ Adding a custom position to templates

    Posted 10 years 10 months ago
    • yes, it works fine!
      And now my very first css :)
      I have just one more concern.
      The custom-logo position appears in the layout (awesome, I have never expected it to be integrating that way), it obviously appears where I have positioned it (between the top and the header position).
      My only doubt is that I need the custom logo to be exactly were the header-a is, is this configuration coing to be a problem?
      Thanks again for everything :)
    • Henning's Avatar
    • Henning
    • Preeminent Rocketeer
    • Posts: 29362
    • Thanks: 954
    • Volunteer

    Re: [SOLVED[ Adding a custom position to templates

    Posted 10 years 10 months ago
    • do you have a link to check?
    • ZioRiP's Avatar
    • ZioRiP
    • Hero Rocketeer
    • Posts: 282
    • Thanks: 0

    Re: [SOLVED[ Adding a custom position to templates

    Posted 10 years 10 months ago
    • ZioRiP's Avatar
    • ZioRiP
    • Hero Rocketeer
    • Posts: 282
    • Thanks: 0

    Re: [SOLVED[ Adding a custom position to templates

    Posted 10 years 10 months ago
    • Maybe I should put header and custom logo positions in a div, is this right?

Time to create page: 0.053 seconds