Jump to content

diegonella

Members
  • Posts

    42
  • Joined

  • Last visited

Everything posted by diegonella

  1. In my time I also with PW 2.6.1 with an integer field. Via API will reasing value and was again visible in the admin
  2. Thanks Wanze, LostKobrakai, Is there any official recommendation configuration? Recommend that hosting and settings are you using?
  3. Hi @wanze, Slow in the admin to add a new field to a template, to move from one sector to anotherbetween templates, fields and other internal sections because I'm still in development and creating fields, assigning them to the templates. I am on a local development server, with processwire 2.6.1 So I ask if any special configuration recommended for php, mysql or apache. Thanks
  4. I am developing a site of some 200 pages and I notice very slow, I wonder if there are any recommended especially for mysql configuration, guess who comes out there, because they are pages that have many fields. The server is Intel Core Duo, 2GHz, 4GB RAM, and I've tested both on Windows and Linux, since it has dualboot. Any recommendation? Thanks
  5. I am using the following code: $new_pt = new Page(); $new_pt->parent = "/opt/"; $new_pt->template = "pt_template"; $new_pt->name = uniqid('pt-', true); $new_pt->title = "Title ".time(); if ( $new_pt->save()) { $page->of(false); $page->pt_field->add($new_pt); $page->save(); } and it turns out I inserted 2 pages, and I can not know where the problem. I'm using 2.6.1 PW Could give me a help, where my error. thanks
  6. Hello, I am wanting to hide the tree admin certain pages with a specific template, I tried to make a module, but I do not quite understand how to apply the hook This is my code public function init() { $this->addHookAfter("ProcessPageListRender::getPageActions", $this, 'hookPageList1'); $this->addHookAfter("ProcessPageListRender::Execute", $this, 'hookPageList2'); } public function hookPageList1(HookEvent $event) { $page = $event->arguments[0]; if ( $page->template == "familiares" ) { $actions = null; $event->return = $actions; } } public function hookPageList2(HookEvent $event) { $page = $event->arguments[0]; if ( $page->template == "familiares" ) { $event->return = false; } } As I apply the hook?
  7. Hello vxda, Could you share how I stay with your facebook login module without changing the password? I'm going through the same problem and I could not find resolve thank you very much
  8. Thanks LostKobrakai But what is not as changing the template assigned to the page I'm invoking (at runtime)
  9. Hi all, I am listing a gallery of products and each product, there is the possibility of seeing a rapid or enter the product and see it in detail view. I have the following structure /products/product-a and would like to pass on to the product in a segment to display quick view /products/product-a/quick-view There any way to use another template in runtime? Thanks
  10. Hi kongondo, I have encountered exactly the same error.
  11. Adrian, I need to filter the pages in which the "Field Page" is null or with ID xxxx
  12. Thank you for your prompt response, The field allows a single value, I tried, with ID and the page "standard" and no, I need to filter by NULL or page ID
  13. Hello everyone I want to filter all children adicional_hab field (product type) is NULL or empty or has X page What I want is to filter all the pages that adicional_hab field is empty or has selected a value. To translate it into SQL SELECT * FROM adicional WHERE adicional_hab IS NULL OR adicional_hab = 'standard' I tried $adiconal->children("adicional_hab=standard|''"); On the other hand there ay any way to make a print and view the sql query that is running with filters that these apply? Thank you very much, best regards Diego
  14. Hi, I have a number of pages with a template that has a repeater field (salida_fecha_repeater) which has 2 fields salida_fecha (type date) and salida_fecha_markup (float), when I show the pages, I have show the first available date, so I would not show dates before today. $salidas = $pages->get("/salida/")->children("limit=5,salida_fecha_repeater.salida_fecha>=".date("Y-m-d")); foreach($salidas AS $salida ) { $markup = $salida->salida_fecha_repeater->find("salida_fecha>=".date("Y-m-d"))->first(); # Test 1 #$markup = $salida->salida_fecha_repeater->first(); # Test 2 echo $salida->title." [".$salida->id."]"." | ".$markup->salida_fecha_markup."<br>"; } With # Test 1 returns nothing With # Test 2 returns the first record in the repeater does not always correspond. Thanks in advance Diego
  15. Thank you very much Nik Yes, at the end I did with a hook public function init() { $this->pages->addHookBefore('save', $this, 'hookSave'); } public function hookSave($event) { $page = $event->arguments[0]; # Guardar la ciudad de salida y arribo if( $page->template == 'salida_child' && $page->isChanged('itinerario_destino_repeater') ) { if ( count($page->itinerario_destino_repeater) ){ $salida_origen = $salida_destino = ""; foreach ($page->itinerario_destino_repeater AS $itinerario ) { if ( $itinerario->itinerario_ciudad->id ) { if ( $salida_origen == "" ) { $salida_origen = $itinerario->itinerario_ciudad; } $salida_destino = $itinerario->itinerario_ciudad; } } $this->message("Itinerario desde <b>".$salida_origen->title."</b> hasta <b>".$salida_destino->title."</b>"); $page->salida_origen = $salida_origen; $page->salida_destino = $salida_destino; } } }
  16. I'm making a site for a travel agency, excursions in the section, which has a repeater field cities in which loaded the itinerary. Then in the search frontend need search all trips leaving from "berlin" Trips Trip 1 Cities (repeater) Berlin Rome Paris Trip 2 Cities (repeater) Paris Rome I need to find all the children in the repeater field equals berlin cities, but only the first record How do the selector? $p = $pages->get("/trips/")->children("cities_repeater.0.city=berlin"); ??
  17. PW is excellent. When you install the version 2.3 (new installation) float fields not showing decimal me, someone had the same problem?
  18. I solved it well, right? foreach ($page->htl_idiomas AS $k => $p ) { $page->htl_idiomas->remove($k); } $idiomas = array(); foreach($input->post->htl_idiomas AS $idioma_id ){ $idiomas[] = $pages->get((int)$idioma_id); } $page->htl_idiomas->import($idiomas);
  19. Adrian was a mistake when typing the example, but the code in the submit button is as is what you wrote. If I keep the other fields but no such type PAGE
  20. This is my code <form method="post" action="<?php echo $page->url;?>"> <?php $idiomas = $pages->get('/tabla/idioma/')->children(); foreach($idiomas AS $idioma) { ?> <input type="checkbox" name="idiomas[]" id="idioma_<?php echo $idioma->id; ?>" value="<?php echo $idioma->id; ?>" <?php if ($page->htl_idiomas->has($idioma)) { echo "checked"; } ?>> <label for="idioma_<?php echo $idioma->id; ?>" class="label"><?php echo $idioma->title; ?></label> <?php } ?> <input type="submit" value="submit" /> </form> What I could not do it when I get the POST, save the selected values if($input->post->btn_submit) { $page->setOutputFormatting(false); foreach($input->post->htl_idiomas- AS $idioma_id ){ $page->htl_idiomas = $pages->get((int)$idioma_id); } $page->save(); } Can you give me a hand? Thanks
  21. and... $commentPage->comment->add($c); if ($commentPage->save('comment')){ echo $commentPage->id; }
×
×
  • Create New...