community

This is a work in progress! We plan to document common issues converting from DynamicPageList (third party) to DynamicPageList3.

Frequently asked questions

/* "Temporary" fix for {{#dpl:execandexit=geturlargs}} */
/* Credit and thanks go to MarkusRost */
$( function() {
	/* Make the confirmation on action=purge keep DPL arguments */
	if ( mw.config.get('wgAction') === 'purge' ) {
		var purgeForm = $('#mw-content-text form.mw-htmlform');
		var purgeParams = purgeForm.find('input[name="redirectparams"]').val().split('&').filter( function (param) {
			return param.startsWith('DPL_');
		} );
		if ( purgeParams.length ) {
			purgeForm.attr('action', purgeForm.attr('action') + '&' + purgeParams.join('&') );
		}
	}
	/* Avoid the purge confirmation all together, restoring legacy behaviour until extension is fixed */
	$('.DPL-purge a.external').on( 'click', function( e ) {
		var $form = $( '<form>' ).attr( {
			method: 'POST',
			action: this.href,
		} ).appendTo( document.body );
		$form.submit();
		e.preventDefault();
	} );
} );