Not quite sure why but this is now working and copy across all field content (including images)...
// Repeater
if(count($page->article_list)) {
$translation->of(false);
$translation->article_list->removeAll();
$lists = $page->article_list;
foreach($lists as $item) {
$translation->article_list->import($item);
$translation->save("article_list");
}
}
Thank you horst, this is exactly what I was looking for.
For those interested, this is my working module below, which adds in icons based on an select options field.
<?php
class DynamicIcons extends WireData implements Module {
public static function getModuleInfo() {
return array(
'title' => 'Dynamic icons for the page tree based on field values',
'version' => 1,
'summary' => 'Module to change the icon on the page tree depending on field values.',
'singular' => true,
'autoload' => true,
);
}
public function init() {
$this->addHookAfter('ProcessPageListRender::getPageLabel', $this, 'addPageListLabelItems');
}
public function addPageListLabelItems($event) {
$page = $event->arguments('page');
$page->of(false);
// Check options field for correct value
if($page->content_type == '1') {
// Add fontawesomeicon
$styleItem = "<i class=\"fa fa-file-text-o\"></i>";
// Add to pagetree
$event->return = $styleItem . $event->return;
}
}
}
(This just shows one options but obviously you could add in additional icons for different field values)
@LostKobrakai thank you, the Dynamic Roles Module is exactly what I'm looking for.
I've used it to override and allow 'page-publish' for translators on the 'tag' template.