Last modified: 2010-05-15 15:28:10 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T3045, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 1045 - Template for New Articles
Template for New Articles
Status: RESOLVED DUPLICATE of bug 2286
Product: MediaWiki
Classification: Unclassified
Templates (Other open bugs)
1.3.x
All All
: Normal enhancement with 3 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
http://meta.wikimedia.org/wiki/Help:I...
: patch, patch-need-review
: 1259 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2004-12-09 00:02 UTC by Marcio Ribeiro
Modified: 2010-05-15 15:28 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Marcio Ribeiro 2004-12-09 00:02:22 UTC
This patch enables support for the use of Templates for New 
Articles.
It does check if it is a New Article (and not a preview) and 
can be enabled/disabled in LocalSettings.php.

This is a diff from my local CVS wiki (original version) to 
the installed one.

RCS file: /usr/cvs/wiki/includes/EditPage.php,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 EditPage.php
404a405,418
>
>     $articletemplate = '';
>     /* Checking if its a new article and it is not a 
preview */
>       if(!$this->mTitle->getArticleID() && $formtype !
= 'preview'){ # new article
>       /*
>        * Yes, it is a new article.
>        * Checking if should get data from template and if 
template file exists
>       */
>       global $wgUseArticleTemplate;
>       global $wgArticleTemplateFile;
>       if($wgUseArticleTemplate && is_readable
($wgArticleTemplateFile)){
>         $articletemplate = implode('', file
($wgArticleTemplateFile));
>       }
>     }
412c426
< htmlspecialchars( $wgLang->recodeForEdit( $this-
>textbox1 ) ) .
---
> htmlspecialchars( $wgLang->recodeForEdit( 
$articletemplate . $this->textbox1 ) ) .
424a439
>     unset($articletemplate);

---

RCS file: /usr/cvs/wiki/LocalSettings.php,v
retrieving revision 1.2
diff -r1.2 LocalSettings.php
102a103,105
>
> $wgUseArticleTemplate   = true;
> $wgArticleTemplateFile  = 'templates/templatetoedit.txt';

Above are the entries used in LocalSettings.php.
$wgUseArticleTemplate is a boolean (true/false) which 
enables/disables the support for Article Templates usage.
$wgArticleTemplateFile is the file which will be automaticly 
loaded in New Article's textarea edition space.

I hope this helps somebody. :)
Comment 1 Zigger 2005-01-05 13:08:15 UTC
*** Bug 1259 has been marked as a duplicate of this bug. ***
Comment 2 Fabian Zeindl 2005-07-14 14:54:30 UTC
Is there a way to include the template in the database?
Comment 3 Rowan Collins [IMSoP] 2005-08-10 01:35:33 UTC
See also the slightly different solution at bug 2286

*** This bug has been marked as a duplicate of 2286 ***

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links