Extension talk:HTMLets
This page used the LiquidThreads extension to give structured discussions. It has since been converted to wikitext, so the content and history here are only an approximation of what was actually displayed at the time these comments were made. |
Iframe bug?
When I try to use this with an Iframe, the iframe shows up but everything on the left side of the page (logo & sidebar) are gone. 108.28.120.170 20:28, 22 February 2011 (UTC) 06:49, 9 October 2011 (UTC)
Help
Can I use this to somehow load a Javascript apt into a mediawiki article? I'm trying to load the REVVER video JS into a mediawiki article. I'm just not sure how to go about doing that. Would I create an HTML file, put the JS in it, and save it in the HTMLets folder, with this extension installed? Thanks --Rovo 20:57, 15 February 2007 (UTC) 06:49, 9 October 2011 (UTC)
- That's precisely the idea, yes. -- Duesentrieb 21:20, 15 February 2007 (UTC) 06:49, 9 October 2011 (UTC)
- What about javascript in the <html>? --Colejohnson66 00:47, 29 January 2011 (UTC) 06:50, 9 October 2011 (UTC)
- what about it? it should work like it always does in html. Or are you reffering to using the <html> tag to inlude raw html inline on the wiki page? That only works if you have $wgRawHtml enabled. In which case using HTMLets is pointless. -- Duesentrieb ⇌ 08:59, 13 February 2011 (UTC) 06:50, 9 October 2011 (UTC)
- What about javascript in the <html>? --Colejohnson66 00:47, 29 January 2011 (UTC) 06:50, 9 October 2011 (UTC)
Error in base64_decode text
Hey Dues, I found a bug in the base64 hack I originally sent you. To fix, change line 115 from this:
'//esm',</pre> To this:'//esm',</pre> I had forgotten that '/' is a legal base64 character. --Jimbojw 16:37, 19 February 2007 (UTC) 06:51, 9 October 2011 (UTC)
- Thanks - fixed in revision 19993 -- Duesentrieb ⇌ 21:31, 19 February 2007 (UTC) 06:51, 9 October 2011 (UTC)
- Thank you I am now going to create a form, and adapt the inputbox extension to take from that form and create a new page. Which will then give us the holy grail of a form creating a page and filling in a template 81.179.74.26 14:07, 30 March 2007 (UTC) 06:52, 9 October 2011 (UTC)
- The above comment was posted anonymously. Does somebody know if the described 'holy grail' was actually created? --Kassoe 08:52, 18 May 2008 (UTC) 06:52, 9 October 2011 (UTC)
- Thank you I am now going to create a form, and adapt the inputbox extension to take from that form and create a new page. Which will then give us the holy grail of a form creating a page and filling in a template 81.179.74.26 14:07, 30 March 2007 (UTC) 06:52, 9 October 2011 (UTC)
Div Tags
Very useful, thanks a lot! I thought div was an allowed HTML tag in MediaWiki. Apparently it isn't. However, with HTMLets I can insert them where I need them. Kevang 18:52, 30 March 2007 (UTC) 06:53, 9 October 2011 (UTC)
- Uh, <div> is allowed, as this post demonstrates... works on a fresh install too.-- Duesentrieb ⇌ 23:58, 30 March 2007 (UTC) 06:53, 9 October 2011 (UTC)
- sdad 189.111.104.170 13:34, 6 June 2013 (UTC)
PHP code support ?
- hi guys,
- thanks for the great functionality this extension brings to Wiki.. really helpful !
- got one question - i keep trying to have it parse PHP files as well - as far as i can see, when htmlet requests the file, the web server will return the results as HTML, so i don't see why it won't work...however it does not work...for me at least :) any help / hint is highly appreciated 86.121.11.216 18:18, 8 June 2007 (UTC) 06:54, 9 October 2011 (UTC)
- ahh...figured it out myself... all you need to do is specify "http://" and the complete path to the php file, and the resulting HTML output will be rendered, rather than the PHP source ;) 86.121.9.48 11:07, 10 June 2007 (UTC) 06:54, 9 October 2011 (UTC)
- Exactly what I needed. Many thanks! Martinwguy2 (talk) 00:00, 22 January 2018 (UTC)
ISO-8859-1
This is a great extension. But i have a problem with showing the html-files. I have HTML with charset ISO-8859-1 and when i use this htmlet then a char like é is displayed wrong (in Firefox 2). In IE6 it even stops showing the page. When i set the charset of the browser (which is standard on UTF8) to 8859-1 it goes allright... Does anyone knows what the problem is and how to solve it? --BB70 08:12, 21 April 2008 (UTC) 06:55, 9 October 2011 (UTC)
- Mediawiki uses UTF-8 for everything. If you want to inline HTML-snippets, they need to be encoded as UTF-8 too. Or use character-references like &t;amul; etc for all non-ascii characters. -- Duesentrieb ⇌ 08:23, 22 April 2008 (UTC) 06:55, 9 October 2011 (UTC)
Does this extension need "$wgRawHtml=true"?
I am comparing Extension:SecureHTML with HTMLets. Not being a programmer I like the simplicity of this extension and I think that is all I need to include a javascript. Will this extension work even with "$wgRawHtml=false" or does that need a "true"? --Kassoe 20:41, 15 May 2008 (UTC) 06:56, 9 October 2011 (UTC)
- It will work with $wgRawHtml=false; If you have that set to true, you can insert HTML anyway, so using this extension would be pretty pointless. -- Duesentrieb ⇌ 21:04, 16 May 2008 (UTC) 06:56, 9 October 2011 (UTC)
- Thanks for clarifying this for a newbie, it wasn't quite clear on Manual:$wgRawHtml where I first found a link to this extension so I will make a small change there also ... —The preceding unsigned comment was added by an unknown user on a unknown date. 06:56, 9 October 2011 (UTC)
Does this work with 1.12?
Does this work with 1.12? Could you provide some more documentation on installation? I have installed many extensions, but I can't seem to get this one to work. Thanks 118.92.110.162 08:11, 16 May 2008 (UTC) 06:57, 9 October 2011 (UTC)
- I have not tried on 1.12, but i don't see why it wouldn't work. But then, there's the new preprocessor code, maybe that itnerferes. WIll try to look into it in a couple of weeks. Installation should be streight forward, there's nothing special to do. -- Duesentrieb ⇌ 21:03, 16 May 2008 (UTC) 06:57, 9 October 2011 (UTC)
- I figured my problem out. When I downloaded the files, I used the 'browse' link (http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/HTMLets/) which took me to the wrong versions of the files. It seemed to download 'log' files or something, and not the actual PHP extensions. Thanks —The preceding unsigned comment was added by an unknown user on a unknown date. 06:58, 9 October 2011 (UTC)
Trouble relocating the htmlets directory
I've had the extension working with the htmlets directory located in the default location under the "wiki" directory. Wanted to move the htmlets directory to the root of my server so I can open up ftp directories without giving access to the htmlets directory. Entered the following in localsettings.php:
$wgHTMLetsDirectory = "http://localhost/htmlets/";
Used ?action=purge on the test page but still I get error message. Is there something very simple I'm overlooking (I'm new with all this stuff)? Kassoe 22:00, 24 August 2008 (UTC) 06:58, 9 October 2011 (UTC)
- Well, what do you mean by root - the file system root, or the document root? the URL above refers to the document root.
- Anyway, unless you want to access htmlets on a different server, it's better to use an (absolute) file path instead of a URL, for example "/htmlets/" or some such. This would refer to the htmlets directory directly in the file system root. --Duesentrieb ⇌ 08:22, 25 August 2008 (UTC) 06:59, 9 October 2011 (UTC)
- Hi Duesentrieb, thanks for fast response - was not familiar with the localhost concept and did not find enough explanation when looking around. I guess I mean "the file system root" but "http://localhost/htmlets/" was what I got from your help text. Just tested again and still haven't solved it.
- When localsettings.php has
- $wgHTMLetsDirectory = "$IP/htmlets";
- I get the htmlets served ok from /public_html/wiki/htmlets
- When localsettings.php has
- $wgHTMLetsDirectory = "/htmlets/";
- I do not get htmlets served, neither when locating the htmlets-directory in the server root shown in my ftp-progam as /htmlets nor when locating it as /public_html/htmlets. I wonder if "root" is really "root" - I run the site hosted with Siteground (I see the locations the same way when checking through their web-based ftp interface).
- Again, I'm not really familiar with server concepts, I might be doing something wrong. The file permissions are shown as the exact same for all three locations of the htmlets-directory (-rw-r--r--).
- Any hints? Kassoe 09:20, 25 August 2008 (UTC) 07:00, 9 October 2011 (UTC)
- The "root" you get from your FTP program is probably not "the" filesystem root, but simply your home directory or somethign similar. Ask your host what the actual file path is.
- Alternatively, you can do this: $wgHTMLetsDirectory = "$IP/../../htmlets"; that's "two up from where the wiki is, and then into the htmlets dir".
- What I don't quite get is... you want to open ftp directories? but hopefully not in a why that would allow others to manipulate your wiki files. that would be kind of bad... -- Duesentrieb ⇌ 10:02, 25 August 2008 (UTC) 07:01, 9 October 2011 (UTC)
- Great, thanks Duesentrieb. The "two up"-approach worked. No, I will open up ftp only for one or more external developers ... I need a little help, as you can gather ;-) and will soon be looking around for someone who'd be interested for pay. —The preceding unsigned comment was added by an unknown user on a unknown date. 07:01, 9 October 2011 (UTC)
Not working with PHP 5.3.x
When trying to use this extension with PHP 5.3.0, the following error occurs:
Warning: Parameter 3 to wfRenderHTMLet() expected to be a reference, value given in /.../w/includes/parser/Parser.php on line 3243
Any help would be appreciated. Thx -- Tommy us Kölle 16:26, 6 December 2009 (UTC) 07:01, 9 October 2011 (UTC)
- I can confirm that, I have exactly the same problem (line 3243) under PHP 5.3.1 now! So I have put away the Probably from the title. ;-) --Master on EN 17:53, 11 March 2010 (UTC) 07:02, 9 October 2011 (UTC)
- I can confirm too. Can someone please take a look at this? --ToreN 15:41, 28 April 2010 (UTC) 07:02, 9 October 2011 (UTC)
- PHP 5.3 seems to be quite picky here. Should be fixed in 1.17 67215. -- Duesentrieb ⇌ 15:26, 2 June 2010 (UTC) 07:03, 9 October 2011 (UTC)
- Hello Daniel, with 1.17 you mean the next release of MediaWiki, correct?
- After updating to XAMPP 1.7.7 with PHP 5.3.8 and MediaWiki 1.17.0 I again got the same problem, just on another line:
Warning: Parameter 3 to wfRenderHTMLet() expected to be a reference, value given in ...\includes\parser\Parser.php on line 3470
- Then I downloaded the last version of the extension and replaced the previous version and added the necessary line ($wgHTMLetsDirectory = "$IP/htmlets";) to the LocalSettings.php and now it works fine again, at least for me! --WikipediaMaster 19:29, 8 October 2011 (UTC) 07:03, 9 October 2011 (UTC)
- Affirmative. After upgrade to PHP 5.3.8 this extension stopped working (same error message). (MW 1.17.0) I guess I will file a bug. Cheers
- Edit: Done with bug 32714 [[kgh]] 00:39, 30 November 2011 (UTC)
- Shame on me. I moved the freshly downloaded extension to the wrong wiki. :( This is actually working with PHP 5.3.8. Case closed since r67215 did the job. Thank you for the fix and Cheers [[kgh]] 00:57, 30 November 2011 (UTC)
Subfolders?
Is there any way to split HTMLet files into subfolders within the main htmlets directory?
I've got a lot of these and it would be nice to separate them, rather than having them all in one megafolder.
I tried
<htmlet>subfolder/filename</htmlet>
but that didn't work.
No biggie if this is impossible. DoubleSuitedChris 04:53, 9 July 2010 (UTC) 07:04, 9 October 2011 (UTC)
Mix with mediawiki code.
It would be nice to add wiki code inside HTML pages, for example, autofill username in a form field. — Preceding unsigned comment added by 150.241.210.1 (talk • contribs) 10:52, 16 September 2010 07:04, 9 October 2011 (UTC)
- HTMLets are for static HTML only. Extension:RawMsg might allow something like this, not sure.
- In any case: pre-filling form fields with user-specific information has to be done with JavaScript anyway. Remember that the generated HTML for pages gets cached. This means that there can be no user-specific content there. -- Duesentrieb ⇌ 09:03, 13 February 2011 (UTC) 07:05, 9 October 2011 (UTC)
Passing pagename to a htmlet as a variable?
Any chance I could do this? I have a search script that I want to do a search on the pagename, and want to pass it inside the htmlet as a variable. 188.221.47.163 22:19, 4 March 2012 (UTC)
HTMLets does not work with MobileFrontend
The HTMLets extension does not work well with the MobileFrontend extension. Page displays the HTML well in desktop view but the code is distorted in mobile view.
Desktop-Example: KKG Wiki:Chapters
Mobile-Example: Chapters-Mobile 216.29.96.198 16:08, 11 May 2012 (UTC)
editing localsettings HTMLets disables my site
Adding "require_once( "$IP/extensions/HTMLets/HTMLets.php" ); $wgHTMLetsDirectory = "$IP/htmlets";"
to my localsettings.php makes my site unavailable (white page of nothing) - any idea why and how i can fix it? I have to remove those two lines for it to come up. Sorry, i'm a bit new to mediawiki.
Also, the download link to the extension does not work. I had to dig and find this to get the extension http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/HTMLets/
Thanks! 82.44.113.40 17:44, 24 September 2012 (UTC)
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead
- Not sure if this is proper, but here is how I fixed it:
- diff HTMLets.php HTMLets.php.org
- 133,137c133,135
- < $text = preg_replace_callback(
- < '//sm',
- < function ($m) {
- < return base64_decode("$m[1]");
- < },
- ---
- > $text = preg_replace(
- > '//esm',
- > 'base64_decode("$1")',
- If anyone has a better solution, please post it.
- Thank you!
- Reverse Corruption
Reverse Corruption (talk) 20:58, 15 July 2013 (UTC) - how to set $v = preg_replace("/'/", "'", $v); to preg_replace_callback 119.160.195.124 (talk) 08:06, 10 October 2018 (UTC)
PDFExport
I am using the HTMLets extension in my wiki to include some other files (tables of data) on my server. I noticed however, that if you use PDFExport, the content is not printed in the PDF, only the tags with the filename. Is there are way that the extension parameters could be modified to include the page in the export? SpartanGuy07 (talk) 17:31, 17 September 2013 (UTC)
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in HTMLets.php
Hello:
I'm getting the following error message on my wiki:
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in HTMLets.php on line 139.
I'm running:
MediaWiki 1.25.3
PHP 5.6.19 (apache2handler)
MySQL 5.1.56-log
Thank you! Patricia Barden (talk) 19:26, 26 April 2016 (UTC)
- This was reported with T68706 and fixed with this commit in June 2015. Use the REL1_26 tag or the MW 1.26 tarball and the issue should go away. Cheers [[kgh]] (talk) 22:02, 26 April 2016 (UTC)
Broken in 1.27 with the depreciation of wfMsgForContent
Change lines 93-100 from
if ( !preg_match('!^\w+://!', $dir ) && !file_exists( $f ) ) {
$output = Html::rawElement( 'div', array( 'class' => 'error' ), wfMsgForContent( 'htmlets-filenotfound', htmlspecialchars( $name ) ) );
} else {
$output = file_get_contents( $f );
if ( $output === false ) {
$output = Html::rawElement( 'div', array( 'class' => 'error' ), wfMsgForContent( 'htmlets-loadfailed', htmlspecialchars( $name ) ) );
}
}
TO
if ( !preg_match('!^\w+://!', $dir ) && !file_exists( $f ) ) {
$output = Html::rawElement( 'div', array( 'class' => 'error' ), wfMessage( 'htmlets-filenotfound', htmlspecialchars( $name ) )->inContentLanguage()->text() );
} else {
$output = file_get_contents( $f );
if ( $output === false ) {
$output = Html::rawElement( 'div', array( 'class' => 'error' ), wfMessage( 'htmlets-loadfailed', htmlspecialchars( $name ) )->inContentLanguage()->text() );
}
} 108.11.216.62 (talk) 03:04, 8 August 2016 (UTC)
- Are you sure that you upgraded to REL1_27? The code does not show the transgressing code for the version meant to be used with MW 1.27.x [[kgh]] (talk) 19:24, 8 August 2016 (UTC)
Compatibility with VisualEditor
Currently, when a user tries to edit a page which contains a page rendered with HTMLets using VisualEditor, the HTML page included disappears as it is parsed as a div by VE. Thus, if user saves its changes to the page, the HTML page content is no longer included.
Would it be possible to make HTMLets compatible with VisualEditor or is it inherently impossible? Addind such compatibility would be great, as editing a page by manipulating the source can be difficult for non-experienced users...
Thank you in advance for your responses, Hwgen22 (talk) 14:41, 14 January 2019 (UTC)
Disruption of pages
Thanks for your good program
There are some styles that change wiki pages:
For example: https://wikicod.ir/wiki/Test
What method should I use that does not affect another VIC code css?
<htmlet>test1</htmlet>
Thanks Sokote zaman (talk) 03:00, 17 April 2020 (UTC)
Embedding dynamic content from other sources
I'm trying to determine if this will do what I'm looking for. I have a webserver running in a different place than the one hosting my mediawiki install (only accessible internally). I want to embed content from that other web server based on a variable that is sent within the URL. Example ([URL]/scriptname?sname=hh7750) - where that hh7750 is a dynamic value. I want to put the html that you get back from that query into the cell of a table or something along those lines in one of my mediawiki pages. Is this mechanism entirely static (i.e. you can't pass a variable)? If so, do you know of any other extension that I might be able to do that with safely? Thank you for your time - I'm a noob at the deeper workings of mediawiki. Gigawattx (talk) 20:05, 3 December 2021 (UTC)