<?php
// CKEditor Image Select Source
$wire->addHookAfter('InputfieldCKEditor::renderReadyHook', function(HookEvent $event) {
$inputfield = $event->object;
$page = $inputfield->hasPage;
$field = $inputfield->hasField;
// Whatever test you need to identify when the asset page should be changed
if($field->name === 'body' && $page->template == 'basic_page') {
$js_config = $this->config->js('InputfieldCKEditor_' . $inputfield->name);
$js_config['pwAssetPageID'] = 1234; // The id of the asset page you want to use
$this->config->js('InputfieldCKEditor_' . $inputfield->name, $js_config);
}
});