Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by lokomotivan

  1. $query = $modules->get('SearchEngine')->find($input->get->q); Is it possible to get a PageArray from this? So i can render my own markup... I know i can use "search_index%=q" to find pages, but i would like to take advantage of the module settings, so dont have to hardcode the operator... I'm trying: $results = $query->results; I get "Method Query::get does not exist or is not callable in this context" When i try "renderResults()" method, it works as expected. Never mind, solved it after looking into Query class. $results = $query->getResults();
  2. Like kongondo mantioned, you can refine the selector, for example you can include grandchild template: $pages->count("template=grandchild_template_name, name_of_checkbox_field=1");
  3. $pages->count("checkbox_field_name=1"); 🙂
  4. Try to url instead of httpurl <img src="<?php echo $bild->httpUrl; ?>"> to <img src="<?php echo $bild->url; ?>">
  5. I asume you are talking about the page reference field. With "Select Options Fieldtype" you define options in field settings, while for page reference field, you use pages as options (any pages), you can select pages by template, parent page, or a custom selector etc... For the dropdown, you have to write your own markup, processwire doesn't do any automatic front-end work for you.
  6. This solved the issue. Was busting my head a lot THANK YOU @Zeka! 🙂 Just to note that u also need getPage() method in your module. class MyModule extends Process implements WirePageEditor { public function getPage() { return $this->page; } }
  7. Thanks for the tips @Zeka. Yes having same issue when creating new pages , they are inactive for all other languages. I solved this for now by checking if page is active for another language on page edit, based on language id, eg: $page->status1105 public function executeEdit() { // breadcrumb $this->fuel->breadcrumbs->add(new Breadcrumb($this->page->url, $this->page->title)); // Force activate multi-language page variations foreach($this->languages as $lng) { $id = $this->sanitizer->int($this->input->get->id); $p = $this->pages->get("id=$id"); $status_field = "status{$lng}"; if($p->{$status_field} != "" && $p->{$status_field} != 1) { $p->of(false); $p->{$status_field} = 1; $p->save(); } } // Execute Page Edit $processEdit = $this->modules->get('ProcessPageEdit'); return $processEdit->execute(); } In this case i loose ability to deactivate the page for some languages but for now i can live with it. Creating a custom add new page is also an option, /module-manager/new/, and writing a custom form for adding new pages and handle it manually. But for page edit is not so easy
  8. Hey guys, i built a custom process module so i can edit pages from the custom ui. Everything works great except that multi-language page name fields does't show up in the settings tab when i edit the page from custom ui. See attached image... I use `executeEdit()` method in my module: public function executeEdit() { // breadcrumb $this->fuel->breadcrumbs->add(new Breadcrumb($this->page->url, $this->page->title)); // Execute Page Edit $processEdit = $this->modules->get('ProcessPageEdit'); return $processEdit->execute(); } Any tips? Thanks
  9. foreach($files as $filename) { $page->{$file_field}->add($upload_path . $filename); }
  10. $fields->get("priduct_sku")->type
  11. Yep, i think that should be expected. In my case there was no segment in the url just option enabled. Ill test it again, maybe i missed something.
  12. No segments defined, "just Allow URL Segments?" option checked. When i uncheck it, it start counting 🙂 Edit: Otherwise works great, thank you for this module 🙂
  13. It doens't work if you have have "Allow URL Segments" option enabled on the template, at least not in my case. Can this be fixed?
  14. You could check if speaker exists, but why do you have empty speakers in backend? In this case you can check for title or thumb or any requierd field <?php foreach($page->speaker as $speaker) { if(!empty($speaker->photo) { // speaker markup } } :
  15. Maybe u can try putting "./" in your filter form action link ./?studio=london <a href="./?studio=london">London</a>
  16. You can use JSON.stringify(data) Edit: Sorry ddint read ur post entierly :). Why dont u for example add data="<?=item->id?>" attribute to each button, then in ur script get the value var itemId = $(this).attr("data"); var data = { id: itemId, }; $.ajax({ type: "POST", url: "/intra/status/", data: JSON.stringify(data), success: function(){ console.log(itemId); } });
  17. Try this: <?php $get_field = $fields->get('some_field_name'); $field_options = $get_field->type->getOptions($get_field); foreach($field_options as $option) { // }
  18. +1 on SamC suggestion, laragon is great! Im also using vagrant and https://box.scotch.io/ now. full ubuntu enviroment out of the box, in combination with https://github.com/deveres/vagrant-manager-windows
  19. <?php echo $pages->get('/shopping-cart')->url ?> your request not hitting the page, you need: <?php echo $pages->get('/shopping-cart/')->url ?> or to make sure u always get the right page even if you change name: <?php echo $pages->get('template=your_shopping_cart_template')->url ?> And dont forget in your shoppping-cart template to check for ajax request: <?php if($config->ajax) { // page was requested from ajax }
  20. Ive done something simular recently, well not sure if this is what u looking for: Simple markup (number in a class represents opacity level) <div class="tm-overlay-dark-60"> <img src="" /> </div> If u want to use it with background image, just need to define height <div class="tm-overlay-dark-60" style="height:500px;background:url(./myimage.jpg) center center no-repeat;backgroudn-size:cover;"> </div> I usually use uikit framework and less @tm-overlay-dark-bg: #000; @tm-overlay-light-bg: #fff; /** * TM Overlay BG */ [class*='tm-overlay-'] { position:relative; } [class*='tm-overlay-']:before { content: ""; display:block; position: absolute; top:0; bottom:0; left:0; right:0; background: fade(@tm-overlay-dark-bg, 60%); z-index:0; } /** * Dark */ [class*='tm-overlay-10']:before, [class*='tm-overlay-dark-10']:before { background: fade(@tm-overlay-dark-bg, 10%); } [class*='tm-overlay-20']:before, [class*='tm-overlay-dark-20']:before { background: fade(@tm-overlay-dark-bg, 20%); } [class*='tm-overlay-30']:before, [class*='tm-overlay-dark-30']:before { background: fade(@tm-overlay-dark-bg, 30%); } [class*='tm-overlay-40']:before, [class*='tm-overlay-dark-40']:before { background: fade(@tm-overlay-dark-bg, 40%); } [class*='tm-overlay-50']:before, [class*='tm-overlay-dark-50']:before { background: fade(@tm-overlay-dark-bg, 50%); } [class*='tm-overlay-60']:before, [class*='tm-overlay-dark-60']:before { background: fade(@tm-overlay-dark-bg, 60%); } [class*='tm-overlay-70']:before, [class*='tm-overlay-dark-70']:before { background: fade(@tm-overlay-dark-bg, 70%); } [class*='tm-overlay-80']:before, [class*='tm-overlay-dark-80']:before { background: fade(@tm-overlay-dark-bg, 80%); } [class*='tm-overlay-90']:before, [class*='tm-overlay-dark-90']:before { background: fade(@tm-overlay-dark-bg, 90%); } /** * Light */ [class*='tm-overlay-light-10']:before { background: fade(@tm-overlay-light-bg, 10%); } [class*='tm-overlay-light-20']:before { background: fade(@tm-overlay-light-bg, 20%); } [class*='tm-overlay-light-30']:before { background: fade(@tm-overlay-light-bg, 30%); } [class*='tm-overlay-light-40']:before { background: fade(@tm-overlay-light-bg, 40%); } [class*='tm-overlay-light-50']:before { background: fade(@tm-overlay-light-bg, 50%); } [class*='tm-overlay-light-60']:before { background: fade(@tm-overlay-light-bg, 60%); } [class*='tm-overlay-light-70']:before { background: fade(@tm-overlay-light-bg, 70%); } [class*='tm-overlay-light-80']:before { background: fade(@tm-overlay-light-bg, 80%); } [class*='tm-overlay-light-90']:before { background: fade(@tm-overlay-light-bg, 90%); } Maybe u need to change :before z-index if you dont use image as background image
  21. https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch
  22. I think you just have to remove the parent=1018 from your selector, doctor page cant be child page of multiple locations... $doctors = $pages->find('template=staff-page,locations=$page'); foreach($doctors as $doc) { echo "<h4>$doc->title</h4>"; }
  23. Just installed it, first thing i noticed that it doesn't work with custom hanna tags, works with "[[", but not with custom one "{{" i currently use for hanna codes
  24. This seem exactly what i need at this moment, especially for hanna :), will try it out definitely, thank you!
  • Create New...