ngrmm
Members-
Posts
441 -
Joined
-
Last visited
-
Days Won
3
Everything posted by ngrmm
-
@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?
-
Need help for setup my Processwire MAMP ( beginner)
ngrmm replied to antoine.ctrs's topic in Getting Started
Could you tell a little bit more? Any Errors? At which step are you stuck? -
Just FYI for those pages you would need to loop through $championship->winner_name. So you better loop always
-
@JerryDi you already tried this?
-
What is the output for this: echo gettype($championship->winner_name);
-
that's right ?
-
@da² yes, but user IDs have normally only two digits
-
How to display page while images are getting resized?
ngrmm replied to Jozsef's topic in General Support
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? -
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>"; }
-
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>"; }
-
@JerryDi could you paste in here the latest version of your code.
-
@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
-
@neophron why is code bad? Do you get an error or any output?
-
@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/
-
try this $playerChampionships = $pages->find("template=championship_results, winner_name=$page->id"); // or $playerChampionships = $pages->find("template=championship_results, winner_name={$page->id}");
-
I guess, it's this typo winner_name=§page->id' Should be winner_name=$page->id' You could also try winner_name=$page'
-
Display additional field next to title on tree list.
ngrmm replied to lenoir's topic in General Support
@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 -
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) { // … }
-
How to structure Blog Posts, Categories, and Tags
ngrmm replied to ryangorley's topic in Getting Started
@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 -
@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.
-
Making unpublished changes to pages that require approval?
ngrmm replied to mpdude's topic in Getting Started
@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'); } }); -
Making unpublished changes to pages that require approval?
ngrmm replied to mpdude's topic in Getting Started
@BitPoet I've not tried it yet, but would this be not possible with a hook on page save out of the box? -
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/.
-
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>