Results 1 to 2 of 2

Thread: Relative image paths even if page is in a folder URL

  1. #1
    New user
    Join Date
    05-03-16.
    Posts
    1

    Default Relative image paths even if page is in a folder URL

    I'm not sure if this is just me being confused or a Contao issue.

    If I look at the site https://contao.org/en/news/contao-4_5_6.html in Safari on a Mac I see books on the right hand side.

    The first image has an absolute path of https://contao.org/assets/images/6/x...m9DrWjyaz-.png

    I go to Inspect Element the image and the IMG src of the first book is src="assets/images/6/xcontao-academy-174f1dfd.png.pagespeed.ic.m9DrWjyaz-.png". this is a relative path but the current page is in an imitated folder called /en/news/ so I would say the image path should either be relative "../../assets/images[...]" or from the top of the domain with a leading slash "/assets/images[...]".

    If I from Safari's inspector right-clicks the image link and say "Open in a new tab" it opens this image - that does not exist:
    https://contao.org/en/news/assets/im...m9DrWjyaz-.png

    Am I seeing ghosts or is Contao not handling paths OK? It works in all the browsers I've seen but I had a broken link checker choke on this and see it in Safari's and Firefox's source inspector (not Chrome).

    Screen Shot 2018-03-08 at 11.52.30.png

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

    Default

    I can not do a test on mac, but folder handling is ok. The browser builds the path form the base tag and the img src.
    HTML Code:
    <base href="https://contao.org/">
    ...
    <img src="assets/images/6/xcontao-academy-174f1dfd.png.pagespeed.ic.m9DrWjyaz-.png" ...
    Seems that the tool you are usign does not handle it correct. But if this is a Mac Safari bug you should report it on github https://github.com/contao/website/issues
    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
  •