That is what I had guessed but I get
This snippet is where I am having problems ..
I want to pre-stuff the new page depending on the title. So I have this *------------------------------------------------------------ if ( ereg("technical", $editpage->mArticle->mTitle) ){ $boilerplate_title = Title::newFromText('Template:Technical Design'); $boilerplate_article = new Article($boilerplate_title); $editpage->textbox1=$boilerplate_article->GetContent(); $editpage->textbox2=$editpage->textbox1; } else { $editpage->textbox1 = "text here"; $editpage->textbox2 = $editpage->textbox1; } *------------------------------------------------------------- Since this wasn't "working" I changed this
if ( ereg("technical", $editpage->mArticle->mTitle) ){
to
if ( 1 ){
With this it seemed to get the template and stuffed the editbox with the data. If I changed the 1 to 0 then it would stuff "text here" in the box
So I left it to 0 sor it would force the else and changed
$editpage->textbox1 = "text here";
To
$editpage->textbox1 = $editPage->mArticle->getTitle();
At this point I get ..
Catchable fatal error: Object of class Title could not be converted to string in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\wiki\includes\EditPage.php on line 1016
If I change the line back to
$editpage->textbox1 = "simple text here"
It displays correctly.
Sure I must have hammered a property somewhere along the line
Hope this makes sense.
DSig David Tod Sigafoos | SANMAR Corporation PICK Guy 206-770-5585 davesigafoos@sanmar.com
-----Original Message----- From: mediawiki-l-bounces@lists.wikimedia.org [mailto:mediawiki-l-bounces@lists.wikimedia.org] On Behalf Of Rob Church Sent: Thursday, June 07, 2007 15:47 To: MediaWiki announcements and site admin list Subject: Re: [Mediawiki-l] Docs on objects and properties/methods
On 07/06/07, Dave Sigafoos davesigafoos@sanmar.com wrote:
At this point what is the object/property for the title of the new
page?
Should be $editPage->mArticle->getTitle(), which returns a standard Title object.
Rob Church