Harmen

Members
  • Content count

    86
  • Joined

  • Last visited

Community Reputation

43 Excellent

About Harmen

  • Rank
    Full Member

Profile Information

  • Gender
    Male
  • Location
    The Netherlands

Recent Profile Visitors

320 profile views
  1. Hi all, I do have a form in the 'backend' of my website which has a fieldtype of ASMSelect. I gave all the options of that field a custom attribute with a value: foreach ($feature_group['features'] as $feature_id => $feature) { $field->addOption($feature_id, $feature['name'], array('data-feature_group' => $feature_group_id)); } How can I read out the value of that custom attribute named data-feature group? I've tried it with $selected_feature_groups = $form->get($category_id)->getAttribute('data-feature_group'); //AND selected_feature_groups = $form->get($category_id)->feature_group; but that doesn't work. How can I get this to work? ~Harmen
  2. Shame to me, didn't notice that.
  3. Have you tried to put only the plugin file there and not in a directory? I mean, PW says to put the plugin file directly in the plugin folder so that should work I guess
  4. Thanks, didn't know that! Changed the $this into wire(' ') and now it works! ~Harmen
  5. Hi all, Currently I am working on a filter for all the products in a category. So I've set up a class and built a (PW) form in it. When the user clicks on continue the form should return a processform function which sets the variable of the form in a session. Later in the file I want to read out that session and use that variable to select which products should show up and which should be hidden. So now with code examples to make it a bit more clear for you: In my file I start with a class: class classname { public function ShowForm() { $form = $this->Form1(); if ($this->input->post->submit) { if ($this->processForm1($form)) $this->session->redirect("./"); } return $form->render(); } Then a form inside the class: protected function Form1() { $form = wire('modules')->get("InputfieldForm"); $form->description = "Fill in the fields to find the mouse which fits your wishes"; $form->label = "Mouse Selector"; $form->action = "./"; $form->method = 'post'; $f = wire('modules')->get("InputfieldRadios"); $f->name = "Hand"; $f->label = "label"; $f->addOption(1, "1"); $f->addOption(2, "2"); $form->add($f); $this->addSubmit($form, 'Continue'); return $form; } This function is called when the user submits: protected function ProcessForm1($form) { $form->processInput($this->input->post); $this->session->hand = (int)$form->get("Hand")->value; } As you see I store the variable of the submitted form in a session. After closing the class I continue with building the page and then I want to read out that variable: $value = $this->session->hand; $content .= "Value of 'Hand': " . $value; But when I execute this on my website I cannot see the value of the form. Have I done something wrong or how can I fix this? Thanks in advance, ~Harmen
  6. Do you mean the core modules or the modules at /site/modules? And is that really a problem to refresh once to initialise the modules?
  7. Looks great! Looking forward to implement this!
  8. I think this can be done with a simple if statement.... Don't have the time to provide a snippet for you at the moment, I'm sorry. Something like this: if ($image->caption){ //Output markup 1 } else { //Output markup 2 }
  9. Hi Manlio, Are you sure you've set a name in different languages? So if your page is called 'Prodotti' in Italiano, is it 'Products' in English? ~Harmen
  10. Hi, I am not familiar with the specific settings and configurations for the CKEditor, but I've found something: Have you applied this to your field using the CKEditor? Maybe <br /> works? ~Harmen
  11. You're right, but as I said. I did not tested it, and wrote this piece of code in a rush. Thanks for the addition. I think it is, most of the time I use it at the end of operations.
  12. Hi, I think this is not that difficult, you work already with an id which you can use now: You could add a if statement for the very first id in your foreach loop: $id = 0; // set it to zero foreach ($sections as $item) { if ($id == 0) continue else { echo "<li><a href='#section-$id'>$item->title</a></li>"; } $id ++; } NOTE: Haven't tested this As you want to skip the first element, which id is equal to 0, the first rendered <li> will have id 1, so if you add another if statement in your foreach loop for id ==1 you can filter that item out and the rest gets the normal tags. See code below: $id = 0; // set it to zero foreach ($sections as $item) { if ($id == 0) continue else { if ($id == 1){ echo "<li class='yourclassforfirstitem'><a href='#section-$id'>$item->title</a></li>"; } echo "<li><a href='#section-$id'>$item->title</a></li>"; } $id ++; } Haven't tested it so far, but I expect this works (maybe with some adjustments)
  13. module

    New version is launched! I've added some new features/options - Earlier I've launched a version with a new option to import the reference codes of your products and the EAN-numbers too - Added a link to module info which links to this module in the module section of processwire. - If you used this module before and only want to update your data, you don't need to first import your categories, then products etc. You can directly click on the import button you want to use. - Revised this module to make translations available. Also made a dutch translation for this module. Download the .zip file (attached to this post or get it via my github) and add it to your dutch language site translations file. Enjoy the new features! NL-Translations.zip
  14. Hai @manlio, As far as I know this is not available at the moment. Currently the development for multi-language export and maybe import is ongoing for BatchChildEditor. I don't know if there is another way to import your multi-language csv into Processwire yet.
  15. True At that time Tracy Debugger didn't show any errors @adrian. To check if it really had nothing to do with your module I uninstalled it (will install it again, no worries ) and tried to import the images again. Everything worked as expected again. It feels a bit unreal to me, as I tried many things and now it works on the code I wrote at the start of developing this feature.