Topic on Extension talk:Widgets

relative URL for a widget

2
Chantoune (talkcontribs)

I am using the widget video given in the list of already designed widgets

but this one use an absolute url

and i want something like src= instead of URL=

because videos are locales to my wiki and not external

Could you please give me the syntax to change this

best regards

Because in my old version of mediawiki i used HTML5Video extension and now with version 1.39 of mediawiki it doesn't work

Cavila (talkcontribs)

I would think that the Video widget already makes use of src internally. I'm not sure what you by mean "videos are locales to my wiki", but there's a couple of things you could do.

  • You could rewrite the widget to make use of $_SERVER['SERVER_NAME' ]
  • You could rewrite the widget to include a hard-coded reference to the domain.

Or before passing stuff to the widget:

  • You could use prefix your relative urls with Help:Magic words: e.g. https:{{SERVER}}/
  • If a video is uploaded to the wiki, you can retrieve its url by using filepath

Hope that helps.

Reply to "relative URL for a widget"