Probably user error, but stuck

9 views
Skip to first unread message

Ross Rosen

unread,
Mar 13, 2023, 5:21:31 AM3/13/23
to MediaWiki Widgets
I'm new to mediawiki and Widgets and php, but a developer. I recognize I'm probably doing something wrong, but I'm at a loss.  My goal is to create a widget to allow an iframe. Simple enough. 

My widget: Widget:iFrameWidget
<iframe
   src="<!--{$url|escape:'url'}-->"
   width="<!--{$width}-->"
   height="<!--{$height}-->"
</iframe>

My wiki page:

As rendered: (Inspector)
<iframe src="%22https%3A%2F%2Fwww.google.com%2Fmaps%2Fd%2Fu%2F0%2Fembed%3Fmid%3D1zF6jmAEuTNwGlDCY3XlijlyzT-6T-D8%26ehbc%3D2E312F%22" width="" 640""="" height="" 480""="" <="" iframe="">

Questions
  1. First and most obviously, what am I doing wrong?
  2. also, the quoting is bizzarre. And the ordering is strange. And even the closing bracket? Is this somehow protecting against iframes?
  3. Also, in some places you use the <!-- {$var}--> notation, in some, just plain ${var}. I'm confused.
Sorry if I'm being an idiot, but I've read the docs and looked over it for an hour and I am out of things to try.

WikiVisor

unread,
Mar 14, 2023, 7:03:53 AM3/14/23
to MediaWiki Widgets
1. Do not pass quotes to the widget parameters as they are already present in iframe parameters, otherwise it leads to double-quoting and parser confusion.
2. Should be solved by #1
3. If both notations work, then no difference, perhaps. I use <!--{$var}-->

This should work:
{{#widget:iFrameWidget|url=https://www.google.com/maps/d/u/0/embed?mid=1zF6jmAEuTNwGlDCY3XlijlyzT-6T-D8&ehbc=2E312F|width=640|height=480}}
Reply all
Reply to author
Forward
0 new messages