0
Welcome Guest! Login
0 items Join Now

SOLVED Adding template path in one of the Gantry Features.

    • Vikram Rao's Avatar
    • Vikram Rao
    • Rocketeer
    • Posts: 93
    • Thanks: 0
    • Consultant

    SOLVED Adding template path in one of the Gantry Features.

    Posted 13 years 10 months ago
    • Hi I am trying to add a tabs script as 'Feature'. My html is something like this:
       
      <ul class="mytabs" id="tabs">
        <li><a href="<?php echo $this->templateUrl; ?> images/tabs/slide1.jpg">Tab 2</a></li>
        <li><a href="<?php echo $this->templateUrl;?> images/tabs/slide2.jpg">Tab 3</a></li>
        <li><a href="<?php echo $this->templateUrl; ?> images/tabs/slide3.jpg">Tab 4</a></li>
        <li><a href="<?php echo $this->templateUrl; ?> images/tabs/slide4.jpg">Tab 5</a></li>
        <li><a href="<?php echo $this->templateUrl; ?> images/tabs/slide5.jpg">Tab 6</a></li>
      </ul>

      All my images are in a folder called 'tabs' within the 'images' folder.

      By using this way I am not able to get the path. I want to know in this the right syntax? If not what will be the correct syntax?
    • Last Edit: 13 years 10 months ago by Vikram Rao.
    • Vikram Rao
      http://www.vikramrao.com
    • Henning's Avatar
    • Henning
    • Preeminent Rocketeer
    • Posts: 29362
    • Thanks: 954
    • Volunteer

    Re: SOLVED Adding template path in one of the Gantry Features.

    Posted 13 years 10 months ago
    • Not sure how these how links should work?
      Result would be that the link (href) would directly go to the image.

      ... as an example for the gantry-url(<?php echo $gantry->baseUrl; ?>) you can look into the logo-feature ...
      <a href="<?php echo $gantry->baseUrl; ?>" id="rt-logo"></a>
    • Vikram Rao's Avatar
    • Vikram Rao
    • Rocketeer
    • Posts: 93
    • Thanks: 0
    • Consultant

    Re: SOLVED Adding template path in one of the Gantry Features.

    Posted 13 years 10 months ago
    • Hey Henning thanks for the post but that is not correct. That will take to the site url.

      I want to get the current template URL.

      I tried using :
      <li><a href="<?php echo $gantry->templateUrl; ?>/images/tabs/slide1.jpg">Tab1</a></li>

      But it does not work.
    • Vikram Rao
      http://www.vikramrao.com
    • Vikram Rao's Avatar
    • Vikram Rao
    • Rocketeer
    • Posts: 93
    • Thanks: 0
    • Consultant

    Re: SOLVED Adding template path in one of the Gantry Features.

    Posted 13 years 10 months ago
    • Henning's Avatar
    • Henning
    • Preeminent Rocketeer
    • Posts: 29362
    • Thanks: 954
    • Volunteer

    Re: SOLVED Adding template path in one of the Gantry Features.

    Posted 13 years 10 months ago
    • <a href="<?php echo $gantry->baseUrl; ?>/images/stories/demo/frontpage/banner1.jpg">Test</a>

      works perfect for me ...
      Check your path again ...
    • Vikram Rao's Avatar
    • Vikram Rao
    • Rocketeer
    • Posts: 93
    • Thanks: 0
    • Consultant

    Re: SOLVED Adding template path in one of the Gantry Features.

    Posted 13 years 10 months ago
    • Henning wrote:
      <a href="<?php echo $gantry->baseUrl; ?>/images/stories/demo/frontpage/banner1.jpg">Test</a>

      works perfect for me ...
      Check your path again ...

      Henning agreed, this works perfectly with or without it because Joomla root directory is the default.
      <a href="<?php echo $gantry->baseUrl; ?>/images/stories/demo/frontpage/banner1.jpg">Test</a>
      and by the way it works perfectly even without BaseUrl
      <a href="/images/stories/demo/frontpage/banner1.jpg">Test</a>
      This image is hidden for guests.
      Please log in or register to see it.

      However when you add a different path it does not work.
      <a href="<?php echo $gantry->templateUrl; ?>/images/stories/demo/frontpage/banner1.jpg">Test</a>
      This image is hidden for guests.
      Please log in or register to see it.

      With this what I concluded is that No matter what you add over there it does not take any thing. I tried replacing the same with the following options :
      <?php echo $gantry->baseUrl; ?>
      <?php echo $gantry->templateUrl; ?>
      <?php echo $gantry->templatePath; ?>
      <?php echo $gantry->layoutPath; ?>
      <?php echo $gantry->templateName; ?>
      <?php echo $gantry->custom_dir; ?>
      <?php echo $gantry->templatePath; ?> 
      but the result is just the same.
      <a href="/images/slider/1.png">Tab 1</a>

      Kindly help with this. I do not want to give the full path like
      <a href="templates/rt_gantry_j15/images/slider/1.png">Tab 1</a>
      This works but that is not the correct way as every time we change name of the template directory we will have to get into these feature files and alter the paths. If it was just one file may be it was OK but I have about 7 to 8 Features like Tabs (3 types), Accordion, Featured Articles Sliders, AdSquares and so on.... which have about 8-10 paths like this each.

      Kindly Help.
    • Vikram Rao
      http://www.vikramrao.com
    • Henning's Avatar
    • Henning
    • Preeminent Rocketeer
    • Posts: 29362
    • Thanks: 954
    • Volunteer

    Re: SOLVED Adding template path in one of the Gantry Features.

    Posted 13 years 10 months ago
    • on my installation (wich is in a sub folder)
      <a href="/images/stories/demo/frontpage/banner1.jpg">Test 2</a>
      does not work ...
    • Henning's Avatar
    • Henning
    • Preeminent Rocketeer
    • Posts: 29362
    • Thanks: 954
    • Volunteer

    Re: SOLVED Adding template path in one of the Gantry Features.

    Posted 13 years 10 months ago
    • <a href="<?php echo $gantry->baseUrl; ?>/templates/<?php echo $gantry->templateName; ?>/images/backgrounds/img-circles.jpg">Test to link to an image in the template-folder</a>

      gives the link to an image in the template-folder ...

      (test based on zephyr)
    • Henning's Avatar
    • Henning
    • Preeminent Rocketeer
    • Posts: 29362
    • Thanks: 954
    • Volunteer

    Re: SOLVED Adding template path in one of the Gantry Features.

    Posted 13 years 10 months ago
    • wich is the same like this
      <a href="<?php echo $gantry->templateUrl; ?>/images/backgrounds/img-circles.jpg">Test to link to an image in the template-folder</a>

      they all work for me ...

      (test based on zephyr)
    • Vikram Rao's Avatar
    • Vikram Rao
    • Rocketeer
    • Posts: 93
    • Thanks: 0
    • Consultant

    Re: SOLVED Adding template path in one of the Gantry Features.

    Posted 13 years 10 months ago
    • Hey Henning thanks once again for looking into this.
      Henning wrote:
      on my installation (wich is in a sub folder)
      <a href="/images/stories/demo/frontpage/banner1.jpg">Test 2</a>
      does not work ...
      I would say .... it works please see the code below. Remove the '/' before '/images/...'
      Henning wrote:
      <a href="<?php echo $gantry->baseUrl; ?>/templates/<?php echo $gantry->templateName; ?>/images/backgrounds/img-circles.jpg">Test to link to an image in the template-folder</a>

      gives the link to an image in the template-folder ...

      (test based on zephyr)
      Henning wrote:
      wich is the same like this
      <a href="<?php echo $gantry->templateUrl; ?>/images/backgrounds/img-circles.jpg">Test to link to an image in the template-folder</a>

      they all work for me ...

      (test based on zephyr)
      Nop this does not work. Again please see the code below.

      Okay I have uploaded the project on two different servers and here are the links :
      http://problogger.kodingen.com/gantry/ .
      &
      http://www.skillset.in/projects/15/
      I'll be more than happy to share the FTP details in a PM if you need.

      Here is how I gave the paths"
      <ul class="mytabs" id="tabs">
         <li class="current"><a href="<?php echo $gantry->templateUrl; ?>/images/tabs/slide1.html">Tab 1</a></li>
         <li><a href="templates/rt_gantry_j15/images/tabs/slide2.html">Tab 2</a></li>
         <li><a href="<?php echo $gantry->templateName; ?>/images/tabs/slide3.html">Tab 3</a></li>
         <li><a href="templates/rt_gantry_j15/images/tabs/slide4.html">Tab 4</a></li>
         <li><a href="<?php echo $gantry->templatePath; ?>/images/tabs/slide5.html">Tab 5</a></li>
         <li><a href="templates/rt_gantry_j15/images/tabs/slide6.html">Tab 6</a></li>
      </ul>

      Here are the feature files (PHP, JS and CSS)
      This attachment is hidden for guests. Please log in or register to see it.


      Now This is what FireBug shows
      Tabs 1, 3 and 5 where I gave <?php ?> tags are ignored and the other Tabs 2, 4 and 6 are displayed without any <?php ?> tags as that is the default Joomla Root directory.
      This image is hidden for guests.
      Please log in or register to see it.


      Kindly Help
    • Vikram Rao
      http://www.vikramrao.com

Time to create page: 0.067 seconds