Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/10/2019 in all areas

  1. ProcessWire 3.0.144 and 3.0.145 add improved field template context override settings and include a new Inputfields API, along with numerous other issue fixes, optimizations and improvements to the core. This blog post is a continuation (and more in-depth version) of last week's post on 3.0.144 that was in the forum— https://processwire.com/blog/posts/pw-3.0.145/
    2 points
  2. $wire->addHookBefore('InputfieldForm::render', function(HookEvent $event) { $form = $event->object; if($form->id !== 'ProcessPageEditLinkForm') return; $inputfields = $form->children('name=link_page_id|link_page_file'); foreach ($inputfields as $inputfield) { $inputfield->collapsed = Inputfield::collapsedHidden; } $tab = $form->child('id=link_attributes'); $tab->collapsed = Inputfield::collapsedHidden; });
    2 points
  3. It's a good idea to limit your support request to only one category. Posting in multiple places makes it very difficult to track the progress.
    1 point
  4. Hi! It was a cache problem. I leave this topic for any similar issues.
    1 point
  5. Just released SearchEngine 0.13.0. This version adds more validation regarding the search index field: there's a warning if the field is of wrong type, an option to automatically create it if it doesn't exist (i.e. it has been removed after the module was installed), and there's a notice in the module settings screen if the index field exists and is valid but hasn't been added to any templates yet. Additionally there's a fix for an issue where FieldtypeTextareaLanguage wasn't recognised as a valid index field type in module settings. This could've resulted in the index field setting getting unintentionally cleared if/when module settings were saved.
    1 point
  6. Thanks for the thoughts! I've started to use Laravel. It reminded me that, 5-6 years ago, I'd spent a while trying out an idea using CodeIgniter. My guess, from that experience, is that I could use PW or Laravel for this, but I'd have access to a wider range of stuff with Laravel. In the end, I wouldn't learn much about the real nuts and bolts of PHP or SQL, but if I get a basic prototype of my app running, I'll have a good overview of all the zillion things out there, how they can fit together, and how to put something together, at least, roughly, on my own. Which sounds like a good outcome, and useful if it goes further and I have to work with designers, developers, engineers. ?
    1 point
  7. Just played around with your example and did a little refactoring ? Thx for sharing your code! $this->addHookAfter('ProcessPageList::find', function(HookEvent $event) { $pages = $event->return; $excludePagesByTemplate = array('admin', 'basic-page'); $pages->each(function($p) use($pages, $excludePagesByTemplate) { if(!in_array($p->template, $excludePagesByTemplate)) return; if(!$p->editable() && !$p->addable()) $pages->remove($p); }); $event->return = $pages; });
    1 point
  8. 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)
    1 point
×
×
  • Create New...