Jump to content


  • Posts

  • Joined

  • Last visited

Community Answers

  1. alexcapes's post in Copy content of image field within repeater field via API was marked as the answer   
    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"); } }
  2. alexcapes's post in Dynamic template icon based on field value was marked as the answer   
    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)
  3. alexcapes's post in Publish page permissions per template was marked as the answer   
    @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.
  4. alexcapes's post in Creating rel="next" and rel="prev" links on paginated pages. was marked as the answer   
    Thank you very much for those links, will investigate (+ also look at searching better!)
  • Create New...