Menu

#2 Page.RemoveTemplateParameter

Unstable (example)
closed-fixed
nobody
None
5
2015-01-24
2012-07-20
No

New method for Page class that removes a parameter from a template in a wikipage. It is modeled on SetTemplateParameter and reuses much of the same code, but instead of setting a new value for a parameter, the parameter is removed from the page.
Parameters:
templateTitle: template in which to remove a parameter
templateParameter: the parameter to be removed
firstTemplateOnly: if true, only first instance of template, if false all.

If the template or parameter doesn't exist, no action is taken.

Discussion

  • Lsjjsllsjjsl

    Lsjjsllsjjsl - 2012-07-20

    C# source, to be inserted in DotNetWikiBot.cs

     
  • CodeDriller

    CodeDriller - 2012-07-20
    • status: open --> open-accepted
     
  • CodeDriller

    CodeDriller - 2012-07-20

    Thank you. That function can be very useful.

    I have one question. Why did you change
    site.FormatTemplate(templateTitle, parameters, template);
    for
    site.FormatTemplate(templateTitle, parameters, false, false, 0);
    ?

     
  • Lsjjsllsjjsl

    Lsjjsllsjjsl - 2012-07-20

    The FormatTemplate change was for my own lazy reasons, I wanted to reformat the templates in the same run. Then I forgot to change it back before submitting it here. Better change it back to the original form site.FormatTemplate(templateTitle, parameters, template) before any general release. Should have no effect on the main function of this Method.

     
  • CodeDriller

    CodeDriller - 2015-01-24

    RemoveTemplateParameter(string templateTitle, string templateParameter, bool firstTemplateOnly) method was added in v3

     
  • CodeDriller

    CodeDriller - 2015-01-24
    • status: open-accepted --> closed-fixed
    • Group: --> Unstable (example)
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.