I'm trying to create a custom select button to my WikiEdit toolbar. However, I cannot find how to populate it dynamically with all the Templates I have on my wiki page.
Here is what I have added to the common.js file so far:
var customizeToolbar = function() {
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'sections': {
'templates': {
'type': 'toolbar', // Can also be 'booklet'
'label': 'Templates'
// or 'labelMsg': 'section-emoticons-label' for a localized label
}
}
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'templates',
'groups': {
'templates': {
'label': 'add-template' // or use labelMsg for a localized label, see above
}
}
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'templates',
'group': 'templates',
'tools': {
'choose': {
label: 'Add Template!',
type: 'select',
action: {
type: 'module',
options: {
{{Special:Allpages/Template|mode=list}} // this does not work, but I suppose I need something similar
}
}
}
}
} );
}