hyde icon indicating copy to clipboard operation
hyde copied to clipboard

Add relative_media_url and relative_content_url functions

Open navilan opened this issue 14 years ago • 2 comments

https://groups.google.com/d/msg/hyde-dev/rh3updsfR80/y55Jkv1CMsEJ

navilan avatar Jun 19 '11 09:06 navilan

For now, moving this out of this release - this is better suited for a version that focuses on multi-language features.

navilan avatar Nov 09 '11 21:11 navilan

I don't know if backward compat is an issue, but it could be implemented this way while keeping only media_url() and not adding rel_media_url():

  • Consider the url to be absolute if it starts with a '/' (ie the same behaviour as media_url does now)
  • Consider the url to be relative to the current document if it starts with something else.

The issue I can see here is: how should the relative path behave when used in a layout? Presumably in this case the relative media url should be relative to the resource.

It would also be possible to add an argument to media_url and content_url saying "relative to what?": media_url(resource_path, relative_to) with relative_to being 'self' (ie the current template) or 'resource'

nud avatar Jan 05 '12 08:01 nud