Jump to:

3393 Posts in 976 Topics by 852 members

Template Questions

SilverStripe Forums » Template Questions » How to avoid / in ankers

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 775 Views
  • Andre
    Avatar
    Community Member
    125 Posts

    How to avoid / in ankers Link to this post

    Hi,

    short, I want to use jquer idTabs, but have a Problem with the anker-tags.

    idTags needs the following Syntax to work

    <ul class="idTabs">
    <li><a href="#jqtabs4-1" class="linked">1</a></li>
    <li><a href="#jqtabs4-2" class="linked">2</a></li>
    </ul>

    So i wrote the following Template

    <ul class="idTabs">
    <% control Object %>
    <li><a href="#jqtabs2-{$Pos}" class="linked">{$Pos}</a></li>
    <% end_control %>
    </ul>

    The damn thing always generates the following for me:

    <ul class="idTabs">
    <li><a href="/#jqtabs4-1" class="linked">1</a></li>
    <li><a href="/#jqtabs4-2" class="linked">2</a></li>
    </ul>


    or

    <ul class="idTabs">
    <li><a href="/?flush=1#jqtabs4-1" class="linked">1</a></li>
    <li><a href="/?flush=1#jqtabs4-2" class="linked">2</a></li>
    </ul>


    when i flush

    so how do i prevent adding the leading slashes?

  • banal
    Avatar
    Community Member
    901 Posts

    Re: How to avoid / in ankers Link to this post

    Hi Andre

    That's really strange. I'm just working on a site where I make use of the jQuery Tabs and I used a template much like yours

    <div id="TabContent">
       <ul>
          <% control Tabs %>
          <li><a href="#content$ID">$TabTitle</a></li>
          <% end_control %>
       </ul>
       <% control Tabs %>
       <div id="content$ID">$TabContent</div>
       <% end_control %>
    </div>

    I get the leading slashes too (actually the whole path), but it works nevertheless. It should work with the slashes anyway... why do they pose a problem for you?

  • Andre
    Avatar
    Community Member
    125 Posts

    Re: How to avoid / in ankers Link to this post

    I dont need them to go away if it works nevertheless, but it doesn't so I thought maybe the slashes are the Problem.

  • Andre
    Avatar
    Community Member
    125 Posts

    Re: How to avoid / in ankers Link to this post

    damn, it's working now, I found the Problem. I was using <div class="jqtab"> instead of <div id="jqtab">.

    775 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.