Jump to content

All Activity

This stream auto-updates     

  1. Today
  2. Hi @Andoro I don't believe Padloper 1 has a site profile unfortunately. Someone will correct me if I am wrong. Best bet is to follow the installation instructions here https://padloper.pw/documentation/installing-padloper/
  3. Hello, could somebody help me out, how can I install a quick demo using Padloper site profile? I bought Padloper 1 and would like try it ASAP, but I can't see the site profile in the package I downloaded. Thanks!
  4. Yesterday
  5. @bernhard - good idea. Fixed in the latest version.
  6. Hi @adrian could you please add a $session->redirect after the email-sent-flag has been reset? I've had it several times the last days that I had a tab oben and got an error "file could not be removed" on reload which was caused by a ?tracy-clear-email-sent-flag-whatsoever=1 that was still left in the url. Thx 🙂
  7. Alternatively, you could use ProcessWire's API $files https://processwire.com/api/ref/wire-file-tools/ To find files in a folder, you can use $files->find(); https://processwire.com/api/ref/wire-file-tools/find/
  8. I spent almost 2 days of searching for that stuff... Thank you! I love you 🙂
  9. In your template, you should be able to do echo $page->your_file_field->name; This is a good cheatsheet regarding the file field as well: https://cheatsheet.processwire.com/files/file-properties/ I apologize, I kinda missed that you were not going through a file field but were uploading to a directory. This might be a bit better approach for you then:
  10. I did upload files to the server and now I need to display the names of these files on my page.how to do it. thank you in advance.
  11. true. I missed that somehow, was more focused on the code. Anyways, that did the trick, thanks a lot, indeed dead simple 😄
  12. I was using this method very recently, its very easy method to migrate from/to live + server. But recently, this method started to show some error, I posed a query here Is it possible, because of the latest version, this module no longer works ?
  13. Last week
  14. I had the same issue. The problem was that there was a templates record in the database created with no-name. When I deleted this record (with Adminer), everything was working again.
  15. Step 1: Change your form element’s action attribute to <?php echo $page->url; ?> Step 2: There is no step 2. edit: sorry, I didn’t read the whole thread either. This same answer had actually been posted by Soma two posts ago.
  16. I have a similar issue, what I basically need is to reset the URL-segments, i.e. go back to the baseURL(?) without /page2 or above whenever the get variables change. Because when I'm on /page2 I and switch the search term, it won't find anything because the results I would get are not enough to require a pagination. You would think that something like this would be dead simple, but it's not. I don't even know what I exactly need to change. linkMarkup? urlSegment? pageNum? So here's how I tried to solve this now if ($session->what != $what || $session->letter != $letter) { $input->setPageNum(0); } $session->letter = $letter; $session->what = $what; I tried many different API commands, but they all won't work. Please help!
  17. thanks for all your inputs, I figured out a way to not use AJAX at all. I'm using HTML hidden input fields and only change its value to be the clicked letter via javascript. Now I have no issue with the search field in the footer and the pagination works as well. <input type="hidden" id="hiddenletter" name="l" value="<?php echo $input->get('l'); ?>"> var letter; var hiddenletter = document.getElementById('hiddenletter'); var alphabet = document.getElementsByClassName('alphabet'); for (i = 0; i < alphabet.length; i++) { alphabet[i].addEventListener('click', setLetter); } function setLetter() { letter = this.id; for (i = 0; i < alphabet.length; i++) { alphabet[i].parentElement.classList.remove('active'); alphabet[i].parentElement.classList.remove('current'); } this.parentElement.classList.add('active'); hiddenletter.value = letter; } The only thing I'm still struggling with is the URL-segments. But that problem is discussed in this topic I need the URL-segments to reset when new get variables are being submited on /page2 and above. Not so easy…
  18. @bernhard I didn't come up with the dictionary words in the JSON files, they are converted from an existing one (here) and apparently the original source is wordnet.princeton.edu. So I'm not sure if those particular words are intended or mistakes. New to me, but "wa" and "wo" are actual English words. Though as far as I can tell they aren't related to "was" or "will". I can't imagine those two instances will ever be helpful for our intended use case so maybe it makes sense to remove them. My plan was to keep looking for more existing dictionaries and continue to merge them into the one in WireWordTools so that it becomes more comprehensive over time.
  19. Sounds very interesting! Thx for the updates Ryan 🙂 I understand "we" -> "i" but don't understand the pointed 2.. are they wrong or is my english too bad? 🙂
  20. Thanks for your contributions to the community 😄 Good luck in all that you do - we'll see you around pwFoo 🙂
  21. Just in case it helps anyone else, after upgrading from PW core 3.0.148 to latest (3.0.161), the ending bracket gets striped from the CDATA element when generating the output for the RSS XML feed. Not sure what has changed or caused this. Changed line 187 from: $description = '<![CDATA[' . $description . ']]'; to: $description = '<![CDATA[' . $description . ']]>'; Thanks.
  22. Not sure if related to your issue, but shouldn't that be a double = after $template?
  23. if ($child->id === $pid ) { $class= 'active'; // Why are you declaring it here for the 2nd time? } elseif ($template= "memorials" && $child->id === $parents ) { // $template == ... missing double equal sign btw $class= 'active'; } I think you get Undefined because you are overwriting class after the first declaration and then sometimes your if statements never run (depending on false conditions) and so $class is not set at that point.
  24. OK, I figured it out. I transformed the values of the inputfields inside the sleepValue function to a json array and now the values will be stored in the database. public function sleepValue(Page $page, Field $field, $value) { // throw error if value is not of the right type if (!$value instanceof OpeningHours) { throw new \Exception($this->_('Expecting an instance of OpeningHours')); } $content = json_encode($value->data['hours']); $sleepValue = ['hours' => $content]; return $sleepValue; } So the responsible lines are $content = json_encode($value->data['hours']); $sleepValue = ['hours' => $content]; The problem of the storage was that the column 'hours' was not defined in the sleepValue method. This was the important part because without it the system doesnt know where to store the value.
  25. $out .= "<li><a class='{$class}' href='{$child->url}'>{$child->title}</a></li>"; This is a line 43 BTW 🙂
  26. anyone, any ideas how to solve? i get following error on a website: Notice: Undefined variable: out in /var/sites/i/islandmemorials.co.uk/public_html/site/templates/includes/functions.php on line 43 and this is a code in that very functions file: <?php function numberOpen() { date_default_timezone_set("Europe/London"); $currentHour = date('G'); if($currentHour > 9 && $currentHour < 21) { $openFor = 21 - $currentHour; if($openFor > 1) { echo "We're currently open for another ".$openFor." hours, why not pop in?"; } else { echo "Our lines are open for another hour - <a href=\"tel:+01983 857 600\">01983 857 600</a>"; } } else { echo "Unfortunately, our lines are currently closed, but you can still send a message below"; } } function getSubNav($pid) { $test = wire('pages')->get("/services/"); $parents = wire('page')->parentID; $template = wire('page')->template; $out = ''; //echo "pid".$pid."<BR>"; //echo "parents".$parents."<BR>"; //echo "template".$template."<BR>"; $children = $test->children; foreach($children as $child) { $class = $child->id === $pid ? " active" : 'inactive'; if ($child->id === $pid ) { $class= 'active'; } elseif ($template= "memorials" && $child->id === $parents ) { $class= 'active'; } $out .= "<li><a class='{$class}' href='{$child->url}'>{$child->title}</a></li>"; } return $out; } ?> i suppose this has to do with a variable scope, but not sure
  27. OK, I am 1 step forward :-) Adding $this->value['hours'] = $time_values; to the processInput() method adds the values to the object Here is the complete code of this method: public function ___processInput(WireInputData $input): self { $name = $this->attr('name'); $value = $this->attr('value'); //input object includes always every input on the page, so lets filter out only inputs from this field //we need to do this, because the number of values is variable - so extract only values that starts with $name.'_' $nameAttributes = []; foreach($input as $key=>$value){ if(substr($key, 0, strlen($name.'_')) === $name.'_'){ $nameAttributes[$key] = $value; } } // loop through all inputfields and set the value (if changed or not) back $time_values = []; foreach($nameAttributes as $nameAttr => $value) { $time_values[$nameAttr] = $value; } //add it to the object $this->value['hours'] = $time_values; return $this; } Now the values are also reachable in sleepValue() method and the sanitizeValue() method. ProcessWire\OpeningHours Object ( [data] => Array ( [hours] => Array ( [openinghours_mo-0-start] => 09:00 [openinghours_mo-0-finish] => 13:00 [openinghours_mo-1-start] => 14:00 [openinghours_mo-1-finish] => 18:00 [openinghours_mo-2-start] => 21:00 [openinghours_mo-2-finish] => 23:00 [openinghours_tu-0-start] => 09:00 [openinghours_tu-0-finish] => 13:00 [openinghours_tu-1-start] => 14:00 [openinghours_tu-1-finish] => 18:00 [openinghours_we-0-start] => 09:00 [openinghours_we-0-finish] => 13:00 [openinghours_we-1-start] => 14:00 [openinghours_we-1-finish] => 18:00 [openinghours_th-0-start] => 09:00 [openinghours_th-0-finish] => 13:00 [openinghours_th-1-start] => 14:00 [openinghours_th-1-finish] => 18:00 [openinghours_fr-0-start] => 09:00 [openinghours_fr-0-finish] => 13:00 [openinghours_fr-1-start] => 14:00 [openinghours_fr-1-finish] => 18:00 [openinghours_sa-0-start] => [openinghours_sa-0-finish] => [openinghours_so-0-start] => [openinghours_so-0-finish] => [openinghours_ho-0-start] => [openinghours_ho-0-finish] => ) ) ) Nevertheless the value in the DB is NULL :-(
  28. Hi @elabx, thanks for the suggestion. I finally came up with a solution combining the hook and special names in the template flags. So with my example from above, I add a tag with the name allowedonly4-basic-b to the template that should be allowed only in the sub directory of basic-b, but not in other sub directories. $wire->addHookAfter('ProcessPageAdd::getAllowedTemplates', function($event) { $pages = wire()->pages; $parent = 'sub' == $pages->get(wire('input')->get->parent_id)->template->name ? $pages->get(wire('input')->get->parent_id)->parent() : new NullPage(); if(0 == $parent->id) return; $templates = $event->return; foreach($event->return as $template) { foreach(explode(' ', $template->tags) as $tag) { if('allowedonly4-' == substr($tag, 0, 13) && substr($tag, 13) != $parent->template->name && isset($templates[$template->id])) { unset($templates[$template->id]); } } } $event->return = $templates; }); With this combination I now can create templates allowed only for one or two defined sub directories.
  1. Load more activity
×
×
  • Create New...