Extension talk:CreateBox

From mediawiki.org
Latest comment: 9 years ago by Timeshifter in topic Weird doubled namespace prefix problem

noinclude-text does not disappear[edit]

When preloading a template the text between the noinclude tags is still in the created article. It should disappear, shouldn't it? Boris 17:12, 11 June 2011 (UTC)Reply[reply]

Clear on Focus[edit]

Suggestion to add to this extension, an option 'clearonfocus' which lets the default value in the createbox act as a suggestion for the user - when they click in the box the default value disappears and if they leave it empty and click out, the default value re-appears.

Add the few lines before the $output= line, and also add the $focushtml variable to the createboxInput line (fourth from the bottom here).

    $submit = htmlspecialchars($wgScript);
    $width = acGetOption($input,'width',0);
    $align = acGetOption($input,'align','center');
    $br = ((acGetOption($input,'break','no')=='no') ? '' : '<br />');
    $label = acGetOption($input,'buttonlabel',wfMsgHtml("createarticle"));
    if (acGetOption($input,'clearonfocus',0) == 0) 
      $focushtml = '';
      $focushtml =<<<FOCUSCODE
 onblur="javascript:if(this.value=='') this.value='{$text}';" onfocus="javascript:if (this.value=='{$text}') this.value='';" 
<div class="createbox" align="{$align}">
<form name="""createbox""" action="{$submit}" method="get" class="createboxForm">
<input type='hidden' name="""action""" value="create">
<input type="hidden" name="""prefix""" value="{$prefix}" />
<input type="hidden" name="""preload""" value="{$preload}" />
<input type="hidden" name="""editintro""" value="{$editintro}" />
<input class="createboxInput" name="""title""" type="text" value="{$text}" size="{$width}"{$focushtml}/>{$br}
<input type='submit' name="""create""" class="createboxButton" value="{$label}"/>

Instructions for use: Add clearonfocus=1 to enable (or any non-zero value)

Somehow this is not working for me (Mediawiki 1.11.1). Added these six lines and the variable, but nothing happens...what am I missing? 04:19, 18 March 2008 (UTC)Reply[reply]


Is it possible to add this to the sidebar like the searchbox?


The Preloaded content dosent show... I have tested it on www.gamemedia.jackphoenix.com and it dosent show in the editing field- -- 13:57, 11 August 2007 (UTC)Reply[reply]

  • The page you need to load from needs to be in the namespace "Template" (i.e. Template:Name_of_page). Then, you create the CreateBox with the parameter "preload=template:Name_of_page"

I have PHP 5.2.6, MediaWiki 1.16.4, and MySQL 5.1.25-rc-standard installed.
preload=template:Name_of_page" does not work, nothing is loaded into the edit window of either the default editor or the FCKEditor.

Invalid XHTML[edit]

In the next version, could <input type='hidden' name="""action""" value="create"> possibly be fixed for XHTML compliance? That is; <input type='hidden' name="""action""" value="create" />. Seeing as it's the only one I'm guessing it was intended as closed. Another note on XHTML-compliance (which this extension might not have control over) is the placement of the form-element. The start-tag is placed within a p-element (which is an invalid location for a form), and the end-tag is outside said p-element (defining the start inside and end outside is invalid in XHTML). Such as:

<p><form ...>
</p></form> 19:06, 8 January 2008 (UTC)Reply[reply]

The <p> tags is being added by the MediaWiki software. Although I do hazard a guess, that if the end tags for <form> and <div> are placed on separate lines, as they are for the start tags, then the MediaWiki software will place the <p> elements correctly. 20:15, 9 July 2012 (UTC)Reply[reply]

Bug with Prefix[edit]

I emailed the person who created the extension, but here is my bug I have, if anyone can help...:

If I put a Prefix, it will always create the page. Here is an example:

  1. the prefix is: Issue
  2. In my input box, to create a page, I put L345
  3. The page Issue L345 is created.
  4. I go back to my CreateBox input with prefix Issue and write down L345
  5. The page Issue Issue L345 is created, instead of saying: "The page Issue L345 is already created, do you want to edit or read, etc..."

Is it possible to fix this bug?

Thanks a lot!

-- 17:16, 13 March 2008 (UTC)Reply[reply]

I think I fixed[edit]

Ok, I fixed the bug, but I'm not sure of the consequences of this... Please advise of any

Line 143 to

$query = "action={$action}" . //&prefix=" . $wgRequest->getVal('prefix') .
        "&preload=" . $wgRequest->getVal('preload') .
        "&editintro=" . $wgRequest->getVal('editintro') .
        "&section=" . $wgRequest->getVal('section');

Have default text automatically set as current date and time?[edit]

Is this possible? - Derrickfarnell 19:28, 17 May 2008 (UTC)Reply[reply]

Prefix & {{PAGENAME}}[edit]

I'm hoping to use this to help with subpage creation from a given page, and to generify the function (e.g. so I could easily include it on many pages), wanted to pass "{{PAGENAME}}/" in as the prefix. However, this was interpreted literally - So I added the line below. It is probably not elegant or complete - but addresses my need.  :-)

In function acMakeBox:

function acMakeBox($input, $argv, &$parser) {
    global $wgRequest, $wgScript;
    if(...) {
      // ....
    } else {
        $prefix = acGetOption($input,'prefix');
        // below line added by DEF to account for {{PAGENAME}} variable usage in "prefix" variable of CreateBox..
        // ....

Could you give an example of how to use your add-on ? Thanks. --Colonna 16:53, 28 September 2008 (UTC)Reply[reply]

need an Installation paragraph[edit]

It is not said in the extension page that

require_once($IP . "/extensions/CreateBox.php" );

is needed in LocalSettings.php. Could someone do it ? Thanks. -----Colonna 16:53, 28 September 2008 (UTC)Reply[reply]

Bug In r65814 - Warning: Parameter 3 to acMakeBox() expected to be a reference[edit]

The Create Box never renders on the page. The extension works find for me in MediaWiki 1.15.2 so I suspect it has to do with me running 1.15.3.

Full Error:

Warning: Parameter 3 to acMakeBox() expected to be a reference, value given in /var/www/w/includes/parser/Parser.php on line 3243

My System Details:

Ubuntu 10.04 64 Bit

Product Version MediaWiki 1.15.3 PHP 5.3.2-1ubuntu4 (apache2handler) MySQL 5.1.41-3ubuntu12

CreateBox 1.6 (r65814)

Compatibility with PHP 5.3[edit]

The problem is with PHP 5.3 compatibility. In CreateBox.php find the following line (should be around line 95):

function acMakeBox( $input, $argv, &$parser ) {

and change it to:

function acMakeBox( $input, $argv, $parser ) {

I found that I also needed to change line 50 in order to get the createbox to parse and render.
The offending code is:
function wfCreateBox( &$parser ) {
change this to
function wfCreateBox( $parser ) {
I did note that there is a similar item on line 85 (function acGetOption( &$input, $name, $value = null ) {, but it seems to work both with and without changing it, so I left it alone since php is not one of my strengths.
-AerosAtar, 30 October 2010

Suggested parameter[edit]

Would be nice to have an extra parameter that defines whether to open the edit box in a new window. 17:53, 8 May 2010 (UTC)Reply[reply]

Create Box Exists[edit]

I have defined the message I want to show when a user attempts to create a new article that already exists, but it does not appear to be working. Here is where I have defined the message: http://jet.wikia.com/wiki/MediaWiki:Createbox-exists

I have the most recent version of the plugin.

  • This is the text I expect:
    • Good news! "Extension talk:CreateBox" already exists. Someone has already started work on this. You can edit it, read it, or choose to create a different page.
  • This is the text I get:
    • ERROR: The article you are attempting to create already exists.

Any help would be appreciated. Thanks --Boy.pockets 02:15, 17 August 2010 (UTC)Reply[reply]

i get absolutly nothing.. its a blank page?? what i did wrong when i installed it? Flipp0 29-09 2010 16:37

Could not be used in templates?[edit]

Could you set up this extension, that the parsers replaces the template-parameters? Thanks!-- 12:00, 26 October 2011 (UTC)Reply[reply]

Swedish letters[edit]

The swedish letters Å, Ä and Ö is not working. -- 14:17, 18 November 2011 (UTC)Reply[reply]

Automatic Link?[edit]

Is it possible to have a link to the new page automatically appear on the same page as the new document button?

Problems while using WYSIWYG editor[edit]


when editing page that is using CreateBox plugin i always got this parse error message when switching from WYSIWYG to Source code. Any idea why this is happening? My guess is because parameters are in many rows, and editor is trying to parse this as Wikitext, or I am wrong .... I am wondering why parameters are in many rows and not in one row passed as $argv, like in many other plugins...

<parsererror>XML Parsing Error: mismatched tag. Expected: </input>. Location: Line Number 1, Column 1683:<sourcetext><body xmlns:x="http://excel"><div class="createbox" align="left"><p></p><form name="createbox" action="/index.php" method="get" class="createboxForm"><img class="cke_hidden" src="" data-cke-realelement="%3Cinput%20type%3D%22hidden%22%20name%3D%22action%22%20value%3D%22create%22%20%2F%3E" data-cke-real-node-type="1" alt="Hidden Field" title="Hidden Field" data-cke-real-element-type="hiddenfield" align=""/> <img class="cke_hidden" src="" data-cke-realelement="%3Cinput%20type%3D%22hidden%22%20name%3D%22prefix%22%20value%3D%22Main%20Page%2F%22%20%2F%3E" data-cke-real-node-type="1" alt="Hidden Field" title="Hidden Field" data-cke-real-element-type="hiddenfield" align=""/> <img class="cke_hidden" src="" data-cke-realelement="%3Cinput%20type%3D%22hidden%22%20name%3D%22preload%22%20value%3D%22Template%3AEpicTemplate%22%20%2F%3E" data-cke-real-node-type="1" alt="Hidden Field" title="Hidden Field" data-cke-real-element-type="hiddenfield" align=""/> <img class="cke_hidden" src="" data-cke-realelement="%3Cinput%20type%3D%22hidden%22%20name%3D%22editintro%22%20value%3D%22%22%20%2F%3E" data-cke-real-node-type="1" alt="Hidden Field" title="Hidden Field" data-cke-real-element-type="hiddenfield" align=""/> <input class="createboxInput" name="title" value="" size="0" type="text"> <input name="create" class="createboxButton" value="Create Page for Epic" type="submit"> </form></div><hr/><p></p><h2>List of Epics/Stories</h2><div class="subpagelist"><i>Page "<a _fcknotitle="true" href="Main_Page" class="selflink">Main_Page</a>" has no subpages to list.</i></div><p></p><hr/><h2>List of LMs</h2><p><img class="FCK__MWSpecial" src="" data-cke-realelement="%3Cspan%20class%3D%22fck_mw_special%22%20_fck_mw_customtag%3D%22true%22%20_fck_mw_tagname%3D%22tmerge%22%20_fck_mw_tagtype%3D%22t%22%20headers%3D%22Loadmodule%20name%7CSubsystem%7CChange%20description%22%20namespace%3D%220%22%3E%20%3C%2Fspan%3E" data-cke-real-node-type="1" alt="Unknown Object" title="Unknown Object" data-cke-real-element-type="span" align=""/></p><p></p><h2>List of Interfaces</h2><p><img class="FCK__MWSpecial" src="" data-cke-realelement="%3Cspan%20class%3D%22fck_mw_special%22%20_fck_mw_customtag%3D%22true%22%20_fck_mw_tagname%3D%22tmerge%22%20_fck_mw_tagtype%3D%22t%22%20headers%3D%22Interface%20name%7CChange%20description%22%20namespace%3D%220%22%3E%20%3C%2Fspan%3E" data-cke-real-node-type="1" alt="Unknown Object" title="Unknown Object" data-cke-real-element-type="span" align=""/></p><p><span _fcknotitle="true" class="fck_mw_category" sort="Feature">Feature</span></p></body> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------^</sourcetext></parsererror>

Glitch when using with latest InputBox[edit]

When using this extension with the latest version of InputBox, the prefix is repeated twice when creating pages. So if prefix=Page, the user will be sent to Page:Page:Xyz instead of Page:Xyz. --Porplemontage (talk) 03:09, 9 May 2012 (UTC)Reply[reply]

passing values from the page where the createbox is located to the template called by created page[edit]

I may be wrong in thinking this is possible ? Purpose is to enable the reader of page A to create page B. But page B needs to have a link back to page A. I want this link back to be created automatically. So I hope to pass the pagename from A to B.

Explaining how I have tried might bore you and I may be way off-track. I guess that there are articles elsewhere that explain how to do this ? Thank you for your help.

Weird doubled namespace prefix problem[edit]

I had a problem at http://en.sturmkrieg.com with the create box doubling the Forum namespace when used with the DPL forum, and the prefix was set to Forum:. It worked at first, as I was able to create one page properly, but shortly after it stopped working. I installed InputBox and upgraded from MW 1.17 to 1.17.5, if either of those could have caused it. The problem seems to be fixed after I changed it to an InputBox. ఠ_ఠ Inquisitor Sasha Ehrenstein des Sturmkrieg Sector (Talk) (Contr) 16:51, 25 January 2013 (UTC)Reply[reply]

I see you fixed it with this use of inputbox:
See it transcluded here for example:
See also: Extension talk:DPLforum#Weird Bug. Doubling of namespace in header --Timeshifter (talk) 13:47, 2 August 2013 (UTC)Reply[reply]