Jump to content

ngrmm

Members
  • Posts

    441
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by ngrmm

  1. @Juergen thanks for the module. I tried this: $form = new \FrontendForms\Form('myForm'); … $file1 = new \FrontendForms\InputFile('fileupload1'); $file1->setLabel('Multiple files upload'); $file1->setMultiple(true); $file1->setRule('allowedFileSize', '100000'); $file1->setRule('allowedFileExt', ['jpg','jpeg','png']); $form->add($file1); $button = new \FrontendForms\Button('submit'); $button->setAttribute('value', 'Send'); $form->add($button); if($form->isValid()){ print_r($form->getValues()); } echo $form->render(); But it renders this for the fileupload: <form method="post" action="/path/" id="myForm" name="myForm-1705439668" novalidate="" autocomplete="off" class="form" enctype="multipart/form-data"> … <div class="fieldwrapper" id="myForm-fileupload1-fieldwrapper"> <label class="label" for="myForm-fileupload1">Multiple files upload</label> <div class="inputwrapper" id="myForm-fileupload1-inputwrapper"> <input id="myForm-fileupload1" name="myForm-fileupload1[]" type="file" class="input input-file" multiple="" onchange="showClearLink(event)" accept=".jpg,.jpeg,.png" max-size="2048"> <div id="myForm-fileupload1-clearlink-wrapper" class="clear-link-wrapper" style="display:none;"> <a id="myForm-fileupload1-clear" href="#" class="clear-link" onclick="event.preventDefault();clearInputfield(this); return false;">Clear the input field</a> </div> </div> <p class="notes">Please do not upload files larger than 2,0 kB<br>Allowed file types: jpg, jpeg, png</p> </div> … </form> Do I have set the attribute allowedFileSize in another way, so that it allows larger files?
  2. Could you tell a little bit more? Any Errors? At which step are you stuck?
  3. Just FYI for those pages you would need to loop through $championship->winner_name. So you better loop always
  4. What is the output for this: echo gettype($championship->winner_name);
  5. @da² yes, but user IDs have normally only two digits
  6. I'm curious and would like to know how the Drupal way handles the problem of layout shifts if images and image dimensions are not available on load?
  7. Then maybe winner_name is a multipagefield and you try this: $playerChampionships = $pages->find("template=Championship_results, winner_home_club={$page->id}"); foreach($playerChampionships as $championship) { echo "<li><a href='$championship->url'> $championship->title - {$championship->winner_name->first->title}</a></li>"; }
  8. as @da² mentioned you missed adding the "->title" $playerChampionships = $pages->find("template=Championship_results, winner_home_club={$page->id}"); foreach($playerChampionships as $championship) { echo "<li><a href='$championship->url'> $championship->title - {$championship->winner_name->title}</a></li>"; }
  9. @JerryDi could you paste in here the latest version of your code.
  10. @neophron you could to set your settings here Setup > Templates > your-template > Advanced > List of fields to display in the admin Page List And maybe you look into a css solution to hide it for non-superusers. But I don't know if that is possible
  11. @neophron why is code bad? Do you get an error or any output?
  12. @da² the PageReference field needs a pagearray. Try this $classPageIds = PageArray([16988]); $page->carClasses = $classPageIds; echo $page->carClasses; // should output 16988 Be aware that this change will not be saved!
  13. @JerryDi you can access fields and variables of your page (in this case champrionship pages) echo "<a href='$championship->url'>$championship->title</a>; have a look here: https://processwire.com/api/ref/page/
  14. try this $playerChampionships = $pages->find("template=championship_results, winner_name=$page->id"); // or $playerChampionships = $pages->find("template=championship_results, winner_name={$page->id}");
  15. I guess, it's this typo winner_name=§page->id' Should be winner_name=$page->id' You could also try winner_name=$page'
  16. @lenoir you could also use the builtin option in the backend here: setup > templates > your-template > advanced > List of fields to display in the admin Page List
  17. assuming your other template name is championship you could do this in your player.php template $playerChampionships = $pages->find('template=championship, winner_name=$page->id'); foreach($playerChampionships as $championship) { // … }
  18. @ryangorley there is also the option to separate tags and categories from your blog tree structure and use URL segments. This way you could create URLs like /blog/tag-A/ and /blog/category-A/ at the same time
  19. @Jhin AFAIK there is fixed number of status options (locked, unique, hidden, unpublished, …) which you can set or check. Therefore you could add a checkbox field to your template. Then you could set the status in the backend or via API.
  20. @mpdude try this hook – Create a role for user, who should not be able to publish pages – Put this in ready.php file in the site directory $wire->addHookBefore('Pages::save', function(HookEvent $event) { $page = $event->arguments(0); $userRole = wire('user')->role; $page->of(false); if($userRole == "your_user_role_which_can_not_publish_pages") { $page->status('unpublished'); } });
  21. @BitPoet I've not tried it yet, but would this be not possible with a hook on page save out of the box?
  22. I think what happens is this: When you try to view [localhost/myprocesswiretestsite]/informations-generales/ processwire does not find any associated template and gives you a 404-Error. And your 404-Error-Page has the basic-page.php template. This is how it supposed to be. This happens also if you type in [localhost/myprocesswiretestsite]/qwer1234/.
  23. strange, It worked for me. I pasted this and it got stripped with the default settings. After adding video to the pastefilter whitelist it stays. Which tags get stripped for you? <video width="320" height="240" controls> <source src="movie.mp4" type="video/mp4"> <source src="movie.ogg" type="video/ogg"> Your browser does not support the video tag. </video>
×
×
  • Create New...