Jump to content

Topic on Extension talk:AutoCreatePage

Added 3 stripping lines

6
Baxi69 (talkcontribs)

Hi,

I added 3 lines to AutoCreatePage.php behind line 94:

$newPageContent = str_replace ( "{" , "{" , str_replace ( "}" , "}" , $newPageContent ) );

$newPageContent = str_replace ( "|" , "|" , $newPageContent );

$newPageContent = str_replace ( """ , "#" , $newPageContent );

This makes the use of templates much easier. Just write in the template what you need with &#123&#59;, &#125&#59, and &#124&#59; and &#34&#59; into a template. Include the template in the parameter, and all works as expected. Made my life much easier...

Kghbln (talkcontribs)

Heiya, thank you for sharing your improvement. Why not creating a pull request at GitHub? Cheers

Baxi69 (talkcontribs)

I'm a bit in war with git...

Wanted to place an extension there, failed, and didn't have time to learn all about git...

I'm not English native, and did not find good documentation.

Kghbln (talkcontribs)
Markus Krötzsch (talkcontribs)

You can just write <nowiki> around your content to achieve this, like so:

{{#createpageifnotex:New page title|<nowiki>{{Template|parameter=value}}</nowiki>}}

Maybe the documentation on the extension page needs to be extended to clarify this.

Baxi69 (talkcontribs)

It's not so easy sometimes. If you place the new content into a template, and you pass parameters to the template, you can get fast a lot of blocks like:<nowik>...some content...</nowiki>{{{...|}}}<nowik>...some content...</nowiki> inside the template, while replacing the "&#xxx;" makes the source much easier to read.

My call looks like this:

{{#createpageifnotex:New page title|{{Template|parameter=value}} }}

Meaning, I call the template with params, and want the params to get placed into the template content. But I don't want to get the template functions executed.

Reply to "Added 3 stripping lines"