Results 1 to 2 of 2

Thread: Placing anchor on page to link Image

  1. #1
    New user
    Join Date
    10-07-14.
    Posts
    2

    Default Placing anchor on page to link Image

    hi I am newbie in cantao and my question might have been handled but couldnt find it.
    question: On same page i have 4 images at the top and I want each time i click one of them it should jumps to the section below relating to the image. Has any one idea how to go about this in Cantao?

    Regards

  2. #2
    User Andreas's Avatar
    Join Date
    07-11-09.
    Location
    Mönchengladbach
    Posts
    499

    Default

    On the fact that contao uses the base tag in HEAD
    HTML Code:
    <base href="http://example.org/">
    a hash like #myId isn't enough. You additionaly have to use the actual page (folder) name. For this to achieve you can use the insert tag {{env::request}}
    Code:
    {{env::request}}#myId
    The rest is as in every HTML-page: your link
    HTML Code:
    <a href="my-page.html#myId">myId</a>
    leads to an element with the ID "myId" on that page.
    Web-Development, Freelancer, Burgtech, XHTML, HTML5, CSS, PHP, Javascript, MooTools, MySQL and more
    Amazon wishlist

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •