cubicweb #1499661 get rid of <base> tag [resolved]

The rationale for using <base> was to use relative (shorter) urls but it looks like :

  • we always use absolute urls (built through self._cw.build_url())
  • it breaks hash-based href links (local anchor links such as <a href="#my-anchor">)

Of course, there might a few corner cases, especially in javascript code but most of it use baseuri() (cf. cubicweb.htmlhelpers.js) to build urls, so providing the appropriate implementation for baseuri() should fix most problems there.

I suggest the following :

  • TheMainTemplate adds a BASE_URL javascript variable (ideally, in cw namespace)
  • baseuri() simply returns BASE_URL if defined, otherwise fallback to original implementation for a somewhat bacwkard compatibility
done in3.11.0
load left0.000
closed by<not specified>