Extension talk:Widgets

From MediaWiki.org
Jump to: navigation, search

Old messages are archived.

Start a new discussion

Contents

Thread titleRepliesLast modified
"" is not a valid magic thingie for widget014:56, 27 April 2012
Using a function in a variable value012:04, 23 April 2012
Widgets: smarty error103:23, 30 March 2012
Doesn't work properly112:04, 17 March 2012
mediawikiwidgets.org down1706:05, 29 February 2012
Google Presentation doesn't show220:52, 25 February 2012
When is the Widget namespace created?421:50, 6 February 2012
gallery widget reversion.218:57, 2 February 2012
Installation Error (Unable to move the new CDB file into place)515:59, 25 January 2012
Widget Errors600:29, 7 December 2011
Error returned when trying to view a page containing a widget217:54, 27 November 2011
Folder "Widgets/compiled_templates" and wiki farm with symlinks023:25, 28 August 2011
Widgets: Smarty error 3116:12, 18 August 2011
Thumbshot service408:03, 28 July 2011
Can Widgets Include ParserFunctions301:05, 28 July 2011
List widgets used on edit page214:54, 26 July 2011
Widgets: Smarty error 2201:25, 11 April 2011
potential security issue questions321:41, 10 April 2011
How do i see the ID to use on my applications?116:24, 30 March 2011
Problem in version 1.16.0Beta3020:51, 18 July 2010
First page
First page
Previous page
Previous page
Last page
Last page

"" is not a valid magic thingie for widget

In one of my 1.16.4 MWs the extension "Widgets" (0.9.2, Version 80102) does not work: the wiki page simply renders the source text: {{#widget:Google Gadget |url=http://www.google.com/coop/api/008224879786263662799/cse/dlukhlm8-0m/gadget |title=TEST |width=320 |height=76}}. I have checked so far

  • the inclusion of the extension "Widgets" (o.k.)
  • the listing of "widgets" as a parser function on Special:Version (o.k.)
  • the permissions of the folder compiled_templates (writable for the server)
  • the existence of the namespace "Widget" and the page "Widget:Google Gadget" with content (o.k.)

The apache error-log has an entry: "" is not a valid magic thingie for "widget"

Does anybody have an idea why the parser tag is not recognized and how the problem can be solved?

Thank you very much

Kappa (talk)14:56, 27 April 2012

Using a function in a variable value

I'm trying to create a widget for ReseacherId. The problem there is that the HTML code of a ResearcherId Badge requires a unique element ID at two places in the code (in this case the id is badgeCont983337):

<span id='badgeCont983337' style='width:126px'>
<script src='http://labs.researcherid.com/mashlets?el=badgeCont983337&mashlet=badge&showTitle=false&className=a&rid=A-7713-2008'>
</script>
</span>

I have tried to generate this id and store it in a Smarty template to be able to reuse it, but to no avail. What I tried looks like the following. I have also tried various variants.

<!--{assign var="elid" value=$id{counter}}-->
<span id=<!--{$elid|escape:'html'}--> style='width:126px'>
<script src="http://labs.researcherid.com/mashlets?el=<!--{$elid|escape:'html'}-->&mashlet=badge&showTitle=false&className=a&rid=<!--{$id|escape:'html'}-->">
</script>
</span>

The problem seems to be that the function counter is not called when the template elid is created. How can I do this? What am I doing wrong?

Olenz (talk)12:04, 23 April 2012

Widgets: smarty error

i just installed Widget extension using SemanticBundle and installed Youtube widget. But it dont show up videos instead it give error like this.

Warning: Smarty error: unable to read resource: "wiki:YouTube" in /home2/uetblogs/public_html/wiki/extensions/Widgets/smarty/Smarty.class.php on line 1095

How can i get it worked?? :(

Adilch21:42, 16 January 2011

This is probably a permissions problem. Check that your web server has permissions to read and write your compiled widgets.

Badon (talk)03:23, 30 March 2012
 

Doesn't work properly

[edit] Not updatable

After changing a widget nothing changes on the pages that call it. It is stuck in some cache. Purging doesn't help, neither does manually cleaning compiled_templates folder.

[edit] <noinclude> section is included anyway

Subj.

UPD: the template seems to compile correctly. Can it get stuck in the message cache?

178.72.112.25511:39, 17 March 2012

[edit] Resolved

Since the extension generates PHP code, any PHP cache like APC should be purged before the changes take effect. If you add code that does it (for common PHP cache engines) on widget page purge, it will be helpful.

178.72.112.25512:04, 17 March 2012
 

mediawikiwidgets.org down

For some days Mediwikiwidgets.org is not reachable. Will the website come up again? Singlespeedfahrer 15:23, 31 August 2011 (UTC)

Singlespeedfahrer15:23, 31 August 2011

I'm back from vacation, website is moved to a new server now and should function properly.

69.125.204.7401:58, 1 September 2011

Down again ........

84.196.119.5514:02, 30 October 2011

... down again.

93.228.109.8810:13, 3 November 2011

...and again. The server on which mediawikiwidgets.org is hosted seems to be very unreliable. Maybe the widgets can be moved on the MW server?

10:02, 1 February 2012
 
 
 
 
 

Google Presentation doesn't show

Hi, when I use the Google Presentation widget I only get a white plane in the place where the presentation should be. It doesn't say that the document doesn't exist (which it does when I change the docid) so apparently that is not the problem. But what is, I don't know!

AdSvS08:31, 21 December 2011

I have the same problem. It appears to be something wrong with new presentations. Old presentations with short ids can be displayed.

89.178.102.16520:40, 25 February 2012

Here is a hack: One can disable new presentation editor and make older format presentations as described here: http://support.google.com/docs/bin/answer.py?hl=en&answer=1685857

89.178.102.16520:52, 25 February 2012
 
 

When is the Widget namespace created?

Hello:

I've installed the Widget extension (version 0.9.2) on MediaWiki v1.15.1.

When is the Widget namespace created?

Shouldn't I be able to see it right after unpacking the extension in the extensions directory and adding the include statement in LocalSettings.php?

I've checked at Special:AllPages and I do not see the new namespace.

Thank you for any advice you can give me.

Patricia Barden 19:27, 3 February 2012 (UTC)

19:27, 3 February 2012

Yes, you should be seeing Widget namespace on Special:AllPages right after adding it to LocalSettings.php

Do you see any error messages in error log?

157.166.159.23021:50, 3 February 2012

Thank you for your response.

I have error reporting turned on and there are no errors showing up. Additionally, I checked the Apache error log and did not see anything there either.

So, I decided to set up a clean install of MW 1.15.1 and try out the Widgets extension there. The namespace showed up without any problem.

So, I had to figure out what was causing the namespace not to show up on the production site.

There appears to be a conflict with a custom namespace that was set up for portal pages. If I comment out the following lines in LocalSettings.php, then the Widget namespace appears:

$wgExtraNamespaces =
       array(100 => "Portal",
             101 => "Portal_Talk"
             );
$wgNamespacesWithSubpages[100] = true;

Do you have any idea how to fix this? We definitely do not want to stop using portal pages on our wiki.

Thank you for any help you can give me with this.

Patricia Barden 20:06, 6 February 2012 (UTC)

Patricia Barden20:06, 6 February 2012

Hmm, I have a similar setup on my wiki with a working widgets extension. I guess you have to use the ns constant instead of the ns number. Did you define your namespaces?

# Define namespaces
define("NS_PORTAL", 100);
define("NS_PORTAL_TALK", 101);

# Name namespaces 
$wgExtraNamespaces[NS_PORTAL] = "Portal";
$wgExtraNamespaces[NS_PORTAL_TALK] = "Portal_Talk";

# Subpages for namespaces
$wgNamespacesWithSubpages[NS_PORTAL] = true;

Cheers

[[kgh]]20:15, 6 February 2012

That works just great! Thanks very much for your help.

Patricia Barden21:50, 6 February 2012
 
 
 
 

gallery widget reversion.

this information was reverted, it includes a gallery widget example [1] Adamtheclown 14:06, 26 July 2011 (UTC)

Adamtheclown14:06, 26 July 2011

Sorry, I don't understand this post.

Sergey Chernyshev14:51, 26 July 2011
 

Here is more information on the gallery widget also here.

Igottheconch18:54, 2 February 2012
 

Installation Error (Unable to move the new CDB file into place)

As soon as I enable the extension for the first time, I get the above error. I'm running Mediawiki 1.16.5 on a Windows 2008 server. I'm guessing it's a permissions issue, but I'm not sure which folder and which user to grant permissions to.

MikeDarling19:29, 16 January 2012

I'm not sure what CDB is - are you sure it's Widgets extension that throws the errors?

Sergey Chernyshev14:00, 17 January 2012
Edited by another user.
Last edit: 23:45, 18 January 2012

I only get the error when I enable the widgets in my LocalSettings.php. Here is the full error which will hopefully shed some light.

see here

MikeDarling15:51, 18 January 2012

Hi, perhaps setting the rights of folder /cache to 777 (= writable) will solve this problem. Cheers

[[kgh]]19:35, 18 January 2012

That worked! Thanks... I was focusing on the compiled_templates folder. I'm running Mediawiki on a Windows 2008 R2 Server so I just had to make the folder writable using user permissions.

MikeDarling14:36, 25 January 2012

You are welcome. This is not an "issue" isolated to NT 6.1. This also has to be done when running other OSs too. Your reply proved that it was not a Widgets issue. Cheers

[[kgh]]15:59, 25 January 2012
 
 
 
 
 

Widget Errors

Hi, I installed the Widgets extension and then created the page Widget:YouTube and put {{#widget:YouTube|id=NAal5r_qEQY}} on this page, but nothing shows up on the page. I have been trying to trouble shoot the problem for a while, but haven't been able to seem to figure out the problem yet.

I'm using MW 1.17 and have set the permissions for compiled_templates to 666 . Any advice on what steps I can take would be much appreciated.

ForestForTrees820:27, 30 November 2011

Did you check log files? do they show any errors?

Sergey Chernyshev02:33, 1 December 2011

Thanks for getting back to me. I checked the log files and they didn't show any errors. I'm not sure if it really matters, but when I remove the # from {{#widget:....}} the code from Widget:YouTube appears on the page. The code is

<object width="" height=""><param name="movie" value="http://www.youtube.com/v/"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/" type="application/x-shockwave-flash" wmode="transparent" width="" height=""></embed></object>

When I leave the # in the code nothing shows up on the page. It is pretty weird. Have any other ideas?

ForestForTrees816:00, 1 December 2011

That's expected. Everything you see see there is stuff that normally would be transcluded by normal transclusion. But the #widget tag is the one that's supposed to make it actually work.

Reach Out to the Truth17:11, 1 December 2011
 

Thanks again for both of your help. I'm very eager to get this working, so I poked around the PHP code a little bit. I was wondering if you might be able to help me interpret what I found.

In wiki_get_template, the line

$widgetCode = $widgetArticle->getContent();

is returning the content of the YouTube widget. This seems like a good sign in that Smarty is able to access the wiki template.

However, in renderWidget, when I inserted the code,

echo "<-- renderWidget afteroutput=$output-->"; 

right after

$output = 'ENCODED_CONTENT '.base64_encode($output).' END_ENCODED_CONTENT';,

the resulting HTML included <-- renderWidget afteroutput=ENCODED_CONTENT END_ENCODED_CONTENT-->

In other words, the content of the widget seems to get completely lost by the end of renderWidget. Somehow, it looks like fetch() isn't working quite right.

You can view this for yourself at the following page: http://tmswiki.medialayer.net/w/index.php?title=Scratch_pad&action=purge Because the wiki is being used and I didn't want to leave any detritus around, I added a '!' right after the '<' in the following line

echo "<-- renderWidget afteroutput=$output-->"; 

Doing so turned the output into an HTML comment, so it can only be seen if you look at the source.

ForestForTrees821:34, 1 December 2011
 

Thanks for your help. I think that this must have been user error. I uninstalled and very carefully reinstalled and everything is working perfectly.

ForestForTrees820:30, 6 December 2011

Glad to hear that it worked in the end! Enjoy!

Sergey Chernyshev00:29, 7 December 2011
 
 

Error returned when trying to view a page containing a widget

I can create pages in the Widget: namespace, and the Widgets extension is installed, but whenever I try to save or preview a page with the code to include a widget in, I get the following error message:

Fatal error: Smarty error: the $compile_dir '/var/www/theopenglobe.org/w/extensions/Widgets/compiled_templates/' does not exist, or is not a directory. in /etc/wikiglobal/mw/extensions/Widgets/smarty/Smarty.class.php on line 1093

What is causing this, and how can it be fixed?

Dendodge16:17, 27 November 2011

Is compiled_templates writable by the server?

Reach Out to the Truth17:31, 27 November 2011

Yes, I gave it 777 to debug and the error still occurred.

Pilif12p17:54, 27 November 2011
 
 

Folder "Widgets/compiled_templates" and wiki farm with symlinks

Extension:Widgets requires write permission for a subfolder of its code folder (Widgets/compiled_templates). Does this work if many wikis share the same code base, i.e. all these wikis would write into the same folder? Are the cache-file-names created wiki specific? Widgets is the first extension I encounter (not suggesting that I know all...) that attempts to write into the code area rather than to the standard $wgCacheDirectory. G.Hagedorn 10:03, 28 August 2011 (UTC)

G.Hagedorn10:03, 28 August 2011

Widgets: Smarty error 3

Hi, I just installed Widgets and also got the following smarty error: Warning: Smarty error: unable to read resource: "wiki:Google Maps" in /home/rtseeker/public_html/en/extensions/Widgets/smarty/Smarty.class.php on line 1095

The wiki page is: http://www.omneswiki.com/en/index.php?title=Restaurants I saw Sergey's reply to "Klurie" about creating a new Widget:Google Maps page. It is impossible to create new page Widget:Google Maps or any page starting with "Widget:". So I tried to delete the Widget extension, and then I was able to create Widget:Google Maps page and copied the source code. Then I added Widget extension back to MW, but it gives me the same result, and the Widget page I created simply disappeared.

Thank you very much for your help!

Lei

Lei.xu215:03, 18 August 2011

You should not create pages in Widget namespace before you install the extension - they basically show up in main namespace with name starting with "Widget: ".

Disable the extension, delete the page, then enable the extension and re-create the page.

Keep an eye for the exact name of the widget - it must match the name you enter in parser function call on the page.

Sergey Chernyshev16:12, 18 August 2011
 

Thumbshot service

Hi, as far as I can see there is not thumbshot service available. It would be cool to have one though. Are there any plans? Cheers

[[kgh]]14:04, 29 June 2011

Not sure what you mean by thin shot service. Can you elaborate?

Sergey Chernyshev14:52, 26 July 2011

Hi Sergey, I was thinking of something like the integration of thumbshots provided by services like e. g. http://www.thumbshots.com/, http://www.thumbalizr.com/. Hopefully this is possible. Cheers

[[kgh]]16:34, 26 July 2011

I'm still not sure I understand. Are you looking for a widget that will include thumbnail of the URL using those services?

Sergey Chernyshev02:51, 28 July 2011

Yes, the widget should display the thumbshot of the entered URL, e. g. entering http://www.mediawiki.org/Extension_talk:Widgets would display a thumbshot of this talk page. Cheers

[[kgh]]08:03, 28 July 2011
 
 
 
 

Can Widgets Include ParserFunctions

I understand that templates can use parser functions, and that templates can use widgets, but can widgets can use parser functions?

Papyromancer21:36, 26 July 2011

What do you mean by "use parser functions" - within the #widget call, or within the widget definition itself? You can use them in the former, but not in the latter.

Yaron Koren14:28, 27 July 2011
Edited by another user.
Last edit: 19:47, 27 July 2011

I think the source of my confusion was trying to learn widgets and templates at the same time and using the two interchangeably.

I've now figured out that Widgets are most effective when used within Templates.

Papyromancer19:44, 27 July 2011

Widgets themselves can have if/else statements coded using Smarty.

It makes sense to combine them with Templates if you want to insert a site-wide API key or display the widget with predefined parameters, but allow users enter one of them (e.g. YouTube video ID or Twitter search query).

Glad it works for you now - enjoy!

Sergey

69.125.204.7401:05, 28 July 2011
 
 
 

List widgets used on edit page

Would it be possible to include a list of the widgets used on a page (similar to how MW lists "Templates used on this page") at the bottom of the edit form? I tried looking through EditPage.php and here to see if there were any hooks in the right place to do this, but none of them seemed promising.

Having this list would make it easier for users to find the widget's documentation. (Example: User sees another user's page with spiffy stuff on it, thinks "How did they do that?" --> edit page to see code --> see widget list at bottom --> click link to widget page --> voilà!)

Dr ishmael19:32, 12 May 2011

Yeah, that would be an awesome feature. One way to work around the limitation to wrap them in templates.

157.166.159.23019:52, 12 May 2011

Hmm. Not sure this can be done.

Sergey Chernyshev14:54, 26 July 2011
 
 

Widgets: Smarty error 2

I'm fairly new to MediaWiki and trying to install Widgets. I'm receiving the following error when trying to use one of the widgets (I tried google spreadsheet, and youtube): Warning: Smarty error: unable to read resource: "wiki:YouTube" in /var/www/html/wiki/extensions/Widgets/smarty/Smarty.class.php on line 1095 I followed the installation instructions and went through the troubleshooting errors (I'm sure I'm spelling everything correctly, because I just copied from the webpages, and I've also purged the page to make sure it's reloading from the source)

Do you have any suggestions for what might be wrong? I'm not sure what other details would be useful here, but please let me know. Your help is appreciated.

Thanks! Klurie

Klurie00:54, 10 April 2011

If you created Widget:YouTube page after you installed the widget, then it should be fine. Can you post a link to your wiki so I look at it directly?

Sergey Chernyshev21:39, 10 April 2011

Perfect. That's what I was missing. Thanks for your (extremely quick) help!

klurie01:25, 11 April 2011
 
 

potential security issue questions

Forgive me I'm new to Media Wiki's but how dangerous is it to give read, write access to all potential users?

Start telnet with port22 find / -name 'compiled_templates' [cr] [result] /share/MD0_DATA/Qweb/mediawiki-1.15.1/extensions/Widgets/compiled_templates chmod a+rw /share/MD0_DATA/Qweb/mediawiki-1.15.1/extensions/Widgets/compiled_templates

I was just wondering if there is any more secure way of doing this so that a would be hacker couldn't mess this up, or is there something I'm missing that makes this more secure then I think it is?

thanks for you time

Gobrien05:41, 5 April 2011

I'm not the extension author, so I'm basing this on other knowledge I have on how webservers work, etc.

From what I can tell, the reason to make this writable by everyone is because the webserver runs as a (presumably) different user than you who owns the files. Since the webserver (PHP specifically) needs to be able to write to that directory, you need to give that user write permissions. The easiest way to do this without assuming people have strong working knowledge of linux permissions is to simply make it writable by everyone. Is this the most secure way to do so? Absolutely not, but it certainly is the easiest to follow. Alternatives include running PHP as a CGI module (via fastcgi or similar) in apache so that the PHP gets executed as the user who owns the file, and thus you would not need to make it world-writable. Another alternative is to chown/chgrp (dunno if chgrp is a command or not, but it sounds like it should be) to the user php/apache is running as (probably www-data or nobody) so that you can set user/group permissions instead of world permissions.

Skizzerz07:30, 5 April 2011

That's kind of what I was thinking, anyway, it works fine, Thanks for the quick reply

Gobrien16:41, 5 April 2011
 

There is no way around it until Widgets are rewritten using new Smarty which does not require the files on the drive to be created.

Sergey Chernyshev21:41, 10 April 2011
 

How do i see the ID to use on my applications?

Hey guys! I applied some widgets to my mediawiki,and i'm trying to use some resources made by me with them For example,i'm using the Voki widget(http://www.mediawikiwidgets.org/Voki).The code goes like this

{{#widget:Voki|id=74c74db2e8026a0fc7b161cc29f5742d%26sc=2370055}}

I've made me on Voki,avaliable here http://www.voki.com/pickup.php?scid=3638109&height=267&width=200 So,where do i get that ID,to use it with my widget? I'm having the same problem wit the Google Docs Widget too =/ Can anyone help me,please? If you want to contact me,please send an email to tatsuya.naru@gmail.com

189.42.237.13017:45, 29 March 2011

Hi tatsuya.naru, I would expect that voki.com provides this id. I advise you to inquire there for this id. Probably it is indicated somewhere in your personal account on their page. Cheers --[[kgh]] 16:24, 30 March 2011 (UTC) PS I think Voki is cool. I was just looking for something like that. Thank you for making me aware of it.

[[kgh]]16:24, 30 March 2011
 

Problem in version 1.16.0Beta3

- Sorry - I found the problem. My mistake. Please forget this entry :-)

Oferiks20:07, 18 July 2010
First page
First page
Previous page
Previous page
Last page
Last page
Personal tools
Namespaces

Variants
Actions
Navigation
Support
Download
Development
Communication
Print/export
Toolbox