Jump to content

ngrmm

Members
  • Posts

    441
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by ngrmm

  1. @ManuelBridwell this a thread from the ProMailer forum. You need to buy ProMailer to have access to that forum.
  2. go here: https://processwire.com/talk/clients/purchases/ And look for ProMailer. You should see somthing llike There is a pending renewal invoice for this product. Pay Now If not, just contact Ryan and tell him, you would like to a renewal If the ProMailer key does not belong to you, you have to buy ProMailer first
  3. I think you need to extend your annual subscription and this automatically gives you access to the promailer-forum And yes it is possible to have multiple lists. see here:
  4. @kaz you could store your class in a variable before echo // storing class in a variable $class = ($page->check == 1) ? "checkedClass" : "defaultClass"; // // or emtpy by default // $class = ($page->check == 1) ) "checkedClass" : ""; echo "<img class='$class' src='{$page->image->url}'>";
  5. hi @Rob0610 processwire is a CMS. If you have a html document and want to publish it, just upload it to a webserver. You don't need processwire for that.
  6. I guess you use numbers in you url segments right? So this would result into $images->2->get('foo|bar')? Maybe I'm wrong, but I don't think this syntax is correct.
  7. @biberI don't get what you are doing with the $seg1 variable. What are you trying to access with $images->$seg1 ? And I doubt that the pageimage/s Classes have a get method that accepts two fieldnames. Let's say you want the value of the description field from your third image. You could access it this way: $images = $page->images; echo $images->eq(2)->description;
  8. I'm not sure where $images or $seg is defined in your code. Anyway, you can access images with key inside loops like this: foreach ($page->images->getValues() as $i => $image) { echo "<img class='number_$i' src='$image->url'>"; } // $page->images is an object // $page->images->getValues() is an array You can also access an image without looping $firstImage = $page->images->eq(0); // first image $thirdImage = $page->images->eq(2); // third image If name_1 isn't an extra image field, then you should access it via $page->name_1.
  9. @biber have a look here Since 3.0.142 there is a core option to have additional custom fields for image and file fields I guess they are stored separately.
  10. @joe_gi would recommend to let user add and sort pages manually. And add an extra checkbox or option/page field in which sorting options are available. Then you would use a hook to sort them by the option used after save. Your option field should have an empty option as default and should be resetted after save. I'm sure there are also ways to do that via JS in the backend.
  11. Hi @SIERRA, I guess you have to find a solution for this via hooks. May be you can use https://processwire.com/api/ref/inputfield/get-errors/ or other error methos. Take your time and have a look at the API docs And please avoid duplicate questions, thanks!
  12. @SIERRA i think repeater items are actually pages. They are somewhere down the site tree branch of the admin page. So you could change the select field in your Test2 Repeater into a page reference field first Then you would use a hook to make those pages be selectable. Maybe it's even possible through the page reference, look here:
  13. So when you create another page (lets call it homepage_new) with the same template as your homepage template, it works and the body of homepage_new is editable in frontend?
  14. @monollonom nice work! Do you use PWs $config->ajax in the templates or is the content switching done completely with custom js?
  15. With a js frontend solution your php code would output all posts and you would have a js pagination. Just try the url segment way. If everything is working, you make it ajax driven Another similar option would be HTMX
  16. ok. got it ProcessWire let's you do whatever you want on frontend. So you have to come up with you preferred solution. There are many solution for your goal. Two of them would be to A: do the filtering with javascript (custom js or scripts like mixitup.js) B: or using processwire url segments and a link list (your dropdown) to those url segments
  17. @Boost could you elaborate more on what you mean by filter. If you want a url like domain.com/blog/category_a/ to show all blog children pages with a page reference field value of category_a, then url segments are perfect for this. URL segments are a good tool if you cant use your page tree structure
  18. @JonI would recommend to rule out the sources of error. Create another page with the same template and test it there. Create another template with the exact same code as your home template. Try different browsers (I know it sounds silly), but you never know.
  19. @Jon Do you have any Errors or warning in the browser console? Or any hints in the PW Logs?
  20. @canwild I think the way to go is to have multiple selectors // selectors $selector_title = "title%=$q"; $selector_summary = "summary%=$q"; // do the search // make matches unique $matches_summary->removeItems($matches_title); $matches_title->import($matches_summary);
  21. @Boost how are those H2 headings created? Through a textarea field or through custom textfield inside a repeater?
  22. @joe_g Please check if you have any typing errors. I also have a repeater matrix and it works for me. foreach ($wire->languages as $lang) { $page->set("status$lang", 1); } $page->save(); 1. You could check if status$lang is 1 2. If there is no translation, PW automatically views the default content. But you could also check for translations an do a redirect
  23. I'm not an expert ? but this sounds good. And another issue I had was this: I generate a page with the values of the submitted form. The filenames get sanitized after submitting. An uploaded Image.jpg is saved as image.jpg. So in order to save add the files uploaded to a page, you have to sanitize them. Because the values-array has the original filenames I did it this way: if($form->isValid()){ $p = new Page(); // create new page object $p->template = 'template_name'; // set template $p->parent = $pages->get(1111); // set the parent $p->name = $sanitizer->pageName($form->getValue('surname'), true); // give it a name used in the url for the page $p->title = $form->getValue('textField'); // set page title $p->save(); $p->addStatus('unpublished'); foreach($form->getValue('fileuploads') as $fileItem) { // // sanitizing // $sanitizer->fileName() did not work for me :( // $sFile = $sanitizer->pageName($fileItem, true); $p->images->add("https://domain.com/site/assets/files/{$page->id}/{$sFile}"); } $p->save(); } Maybe it be an option in the future to output the url of the image inside the values fieldarray?
  24. Thanks @Juergen it worked! My other question is, if there is an option for unique filenames. I would like to use the form for submission. If someone uploads a file with the image.jpg, this file would be overwritten if someone else uploads another image with the same filename (image.jpg). Maybe something like this would help? $base = $pathinfo["filename"]; $filename = $base . "." . $pathinfo["extension"]; $destination = __DIR__ . "/uploads/" . $filename; $i = 1; while(file_exists($destination)) { $filename = $base . "($i)." . $pathinfo["extension"]; $destination = __DIR__ . "/uploads/" . $filename; $i++; }
×
×
  • Create New...