Download
We're evolving to serve you better! This current forum has transitioned to read-only mode. For new discussions, support, and engagement, we've moved to GitHub Discussions.

Plugin Development help with ‘addInsertions’ method?

  • #10791
    Avatar photo[anonymous]

    Also, in general is there any documentation on plugin development because I can’t seem to find any?

    Looking at some of the example we have `API.addInsertions`, `API.addEvents`, and `API.addModifiers `

    When to use which?

    In the following code we see `addInsertion` with ‘customCommentsCode’ as the first argument, where :

    “`
    <div>
    <pre>this.API.addInsertion(‘customCommentsCode’, this.addPostScripts, 1, this);
    <code></code>`

    some other examples:

    “`</pre>
    <div>
    <pre>this.API.addInsertion(‘publiiHead’, this.addStyles, 1, this);
    this.API.addInsertion(‘publiiFooter’, this.addScripts, 1, this);</pre>
    </div>
    <pre><code></code>`
    the parameters to `addInsertion` are apparently: `place, callback, priority, pluginInstance`
    So above ‘publiiHead’ is a `place`

    I guess one question is what/where are these places? Can we stick any value in there? etc…

    The same goes for `addModifiers`

    `this.API.addModifier(‘postText’, this.addDecodingAttribute, 1, this);`

    In this code how do we know that ‘postText’ is a valid value, is there a list or something somewhere?

    Thank you!