Extension talk:Widgets

Jump to: navigation, search

About this board

Old messages are archived.

How to add data inbetween several quotes

Fokebox (talkcontribs)

Hello all So at my java code there is a line with information which has quotes and should look like this:

data: [
['Value_name', 12.81], ['Value_name2', 11.55], ['Value_name3', 13.50]

And at widget page I do it so:

    data: [

and I put the values at wiki pages like this:

|data = ['Value_name', 12.81], ['Value_name2', 11.55], ['Value_name3', 13.50]

And result in HTML look like this:

data: [
[\'Value_name\', 12.81], [\'Value_name2\', 11.55], [\'Value_name3\', 13.50]

How to escape the sign "\", because widget doesn't work in this case?

Cavila (talkcontribs)

I can confirm that dumb quotation marks are not handled correctly, or as you would like to, in Smarty. The output shows the escaped \' rather than '. I haven't tested this myself, but Smarty offers a replace function. This link looks relevant: http://www.smarty.net/forums/viewtopic.php?p=50671

Another possible workaround is to use the widget inside a template and make sure that the template replaces each instance with its html equivalent &#39;.

Cavila (talkcontribs)

Belated update (better late than never): the answer is that you should use 'single quotes' not 'quotes'. I made the same mistake about a year ago, based on some old documentation, but then visited the Smarty website and found that the syntax was simply incorrect.

Fokebox (talkcontribs)

I did‘t get what you mean, could you five an example with provided above widget?

Cavila (talkcontribs)

Don't use {$data|escape:'quotes'} but {$data|escape:'single quotes'}. That's all.

Fokebox (talkcontribs)

Thank you, I try

Reply to "How to add data inbetween several quotes"
Kitsguru (talkcontribs)

I have recently install MediaWiki with the widgets extension (1.3.0). I can't get any widgets to work.

Product Version
MediaWiki 1.29.0
PHP 5.6.31 (litespeed)
MariaDB 10.0.32-MariaDB
ICU 57.1

There is nothing in the error logs or compiled_templates (777) folder.

I have looked through this discussion and google groups but found no solution. I am at a complete lose as to what is happening. Any help is appreciated.

Kitsguru (talkcontribs)


Zoglun (talkcontribs)

You should post how you solve it. So that others can benefit from your help.

Kristiandelay (talkcontribs)

I am hitting this exact issue what was the fix?

Kristiandelay (talkcontribs)

Turns out the Widget:Iframe article was missing, when migrating over i made the mistake of assuming we brought that article over as well..... i fixed it by creating the article and copying the code from here: https://www.mediawikiwidgets.org/w/index.php?title=Widget:Iframe&action=edit cheers!

Reply to "widgets not working"

Utime failed: Permission denied in smarty_internal_template.php on line 182

Summary by Kghbln
Zoglun (talkcontribs)

PHP Warning:  touch(): Utime failed: Permission denied in /wiki/extensions/Widgets/smarty/libs/sysplugins/smarty_internal_template.php on line 182

How to fix this?

Kghbln (talkcontribs)

Yeah, I have this all the time, too. I added the respective task to the summary section.

Reply to "Utime failed: Permission denied in smarty_internal_template.php on line 182"
Jomegat (talkcontribs)

I just installed Widgets 1.3.0, but I must have done something wrong. The error log shows this:

[27-Dec-2017 05:40:50 UTC] PHP Fatal error:  Call to undefined method Smarty::addPluginsDir() in /home/investit/public_html/wiki/extensions/Widgets/WidgetRenderer.php on line 30

I downloaded Smarty v2.6.31, and moved its libs directory to extensions/Widgets/smarty/libs. I also chmod'd 777 compiled_templates. Not sure what's missing...

Help? --~~~~

Jomegat (talkcontribs)

Solved. I installed using the git method (I had tried using tar originally).

How to pass Mediawiki images into a widget?

2 (talkcontribs)

I tried to display an image in a widget but the code

doesn't seem to work. It just displays [[Image:test.png]] as an alt text. That's all.

Yaron Koren (talkcontribs)

I don't think you can have wikitext within widget code, if that's what you're trying to do. Maybe what you can use is a wrapper template around the widget, that takes in a file name and handles calling both the wikitext and the widget...

Can't get git REL1_29 branch???

Summary by Zoglun

git checkout -f -b REL1_29 origin/REL1_29

Zoglun (talkcontribs)

So after

git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Widgets.git

I got


git branch

* master

I did see REL1_29 in

git branch -r

  origin/HEAD -> origin/master

How to get the REL1_29 downloaded to local and switch to it?

Thank you!

MarkAHershberger (talkcontribs)

If you type "git checkout -b REL1_29 origin/REL1_29", you should see the following message:

Branch REL1_29 set up to track remote branch REL1_29 from origin.
Switched to a new branch 'REL1_29'

Something like "git checkout REL1_29" should work, too, as long as REL1_29 is on origin and it doesn't show up on the output of "git branch".

MarkAHershberger (talkcontribs)

oh, and you may want to checkout submodules for that extension:

git submodule update --init
Zoglun (talkcontribs)

git checkout -f -b REL1_29 origin/REL1_29

Internal error adding widget to page

Summary by Kghbln

Upgrade to version 1.3.0

Henryfunk (talkcontribs)

When I add a widget to a page I get an Internal error:

[e9d3c35de62dbbc78dc0c67d] /wiki/index.php?title=Test&action=submit Error from line 176 of /var/www/html/wiki/extensions/Widgets/WidgetRenderer.php: Call to undefined method Article::getContent()

My configuration:

  • Widgets 1.2.1
  • Smarty 3.1.30
  • MediaWiki 1.29.1
  • PHP 7.0.22-0ubuntu0.16.04.1 (apache2handler)
  • MySQL 5.7.19-0ubuntu0.16.04.1
  • Article path /wiki/index.php/$1
  • Script path /wiki
  • index.php /wiki/index.php
  • api.php /wiki/api.php
  • load.php /wiki/load.php

The Widgets extension is listed under Installed Extensions on Special:Version, and I can create pages in the Widgets namespace without any errors.

I believe I have installed everything correctly (manual installation). Owner of extensions/Widgets is www-data:www-data . Owner and group permissions on extensions/Widgets and all its sub-folders are Read-Write-Execute. I have put the libs folder with contents into extensions/Widgets/smarty/ .

I will add backtrace here if needed.

Any suggestions would be much appreciated.

Kghbln (talkcontribs)

Upgrade to 1.3.0 and let's see how it goes.

Henryfunk (talkcontribs)

Now that was an easy fix! Thank you very much. I simply clicked the link in the "Installing from a .zip file" section and that link hadn't been updated to point to 1.3.0. I have now done so.

Kghbln (talkcontribs)

Cool that it works now. This was indeed a "bad" link. I further changed the links to make them less version dependent.

Problem folder permissions with Nginx

1 (talkcontribs)


I am using Serverpilot with Digital Ocean. I've problem with Widgets extension installation about folder permissons. How can i do folder permissions for Nginx?

Reply to "Problem folder permissions with Nginx" (talkcontribs)

i download google calendar and i insert on my wikipage, and works good but i have a problem, i can see the calendar but i cant see my proyects, activities, hours, etc in the calendar , and i insert this code: but i dont what is wrong cause i wrote my email, id and doesnt work, i cant see my activities

{{#widget:Google Calendar|id=mariananagelly_duarte@ucol.mx|color=B1440E|title=Mariana Duarte, Calendar}}

what can i do ?


Kghbln (talkcontribs)

I'd guess that the id is not correct. This is the one from the calendar settings? Apart from that I do not know what could be wrong. (talkcontribs)

what do u mean about the calendar settings ??

Kghbln (talkcontribs)

I guess there ought to be a control panel or such which allows you to change the calendar settings and tells you details about the calendar. Something like a preferences section for the calendar. Never used Google Calendar so I cannot send a link.

Reply to "Widget: Google Calendar"

Error in compiled_templates after moving wiki to new hosting

Rafama82 (talkcontribs)

I transfered my mediawiki to new hosting, but now the main page and other pages have errors because in the folder extension/widget/compiled_templates there are references that call old links of the old hosting...How can resolve it?

For example

Warning: include(/containers/30123/www/bancadati/extensions/Widgets/smarty/libs/plugins/modifier.escape.php): failed to open stream: No such file or directory in /home//www/bancadati/extensions/Widgets/compiled_templates/d02d6996ee307e0d4742b4b3f68de02468e0f271.wiki.DISQUSOK.php on line 28

MarkAHershberger (talkcontribs)

You need to delete the contents of your compiled_templates directory. (talkcontribs)

I can see a couple issues:

1.- Double slash on /home//www...

2.- During the migration the base path may change. Could you make a search and replace on the BD looking for harcoded base path and update it.

Reply to "Error in compiled_templates after moving wiki to new hosting"