Jump to content

Topic on Extension talk:Create Page/Flow

Adding a preload parameter

4
Dmundra (talkcontribs)

Thank you for this extension!

We like to use the preload parameter to include a template with new pages. I looked at the other extensions and found them to be overkill. So I added a fourth parameter to take a template page to your extension form field. Here is the added code (using version 0.1):

CreatePage.php

                if ( array_key_exists( 3, $args ) ) {
                        $html .= Html::hidden( 'preload', trim( $frame->expand( $args[3] ) ) );
                }

SpecialCreatePage.php

                        $preload = '';
                        if ( $req->getCheck( 'preload' ) ) {
                                $preload = $req->getText('preload');
                        }
                        
                        $target = Title::newFromText( implode( ':', $parts ) )->getLocalUrl( array(
                                'action' => 'edit',
                                'redlink' => '1',
                                'preload' => $preload
                        ) );
Reply to "Adding a preload parameter"