Jump to content

Recently Updated Topics

Showing topics posted in for the last 7 days.

This stream auto-updates

  1. Today
  2. I thought pagination was not meant to work on the backend but I just tried and it seems to work just as expected. I didn't do any settings regarding url segments... https://github.com/baumrock/PaginationDemo
  3. The latest site of the week reminded me of https://senderkataster.rtr.at/ that I built with a friend some time ago and that I want to share. Tech: ProcessWire (obviously) https://getuikit.com/ (also quite obvious 😄 ) https://tabulator.info/ for all kinds of filters https://leafletjs.com/ for the map https://basemap.at/ using an Open Government Data License Some GDAL command line magic to transform the overlay source data into PNGs that are stored in ProcessWire pages and can then be queried and correctly placed on the map. ProcessWire has been a great platform for that project! If you need help with a ProcessWire project that needs some geo-magic or powerful web maps drop me line 🙂 I'm not responsible for the red background 😅 Show details of a tower Choose a program by name or type and show its radio coverage (not in the screenshot): Expert mode for nerds:
  4. Yesterday
  5. Just a quick update this week, as yesterday was a holiday here and it becomes kind of a holiday week with kids out of school. On the core dev branch, the built-in PageFrontEdit module has been updated to support the new InputfieldTinyMCE rich text editor module. In addition. The $sanitizer->email() method has been updated with several new options. These include support for emails with Internationalized Domain Names (IDNs), UTF-8 local parts and an option to validate the DNS of the email domain. Currently all of these options are off by default but can be enabled with a new $options argument. These options will likely be translated to configure options for email fields (FieldtypeEmail) in the next week or so. In addition, a new version of the ProFields Combo has been released and this version also adds support for the new InputfieldTinyMCE module. I'm also working on updates for ProFields Table and Textareas for support of InputfieldTinyMCE as well, but those updates aren't quite ready to post just yet. If you opt to use TinyMCE with PageFrontEdit or Combo, make sure you grab the latest version of InputfieldTinyMCE, as it also received related updates this week. Thanks for reading and have a great weekend!
  6. I don't know if this is a bug or a feature, but I discovered when trying to @import (optional, inline) '/path/to/some/file.css' The code from the css file is brought into LESS but the relative url references do not get adjusted (thus they break). A standard LESS @import of css happens like any other type of import. I was trying to consolidate my css. So as an example, I'm trying to import a css that declares a font-face: @font-face { font-family: 'Acherus Grotesque'; src: url('acherus_grotesque_-_regular-webfont.woff2') format('woff2'), url('acherus_grotesque_-_regular-webfont.woff') format('woff'); font-weight: normal; font-style: normal; } The css file resides in a subdirectory with the font files - pretty typical. It works fine when I run it as @import (optional), but when I bring it inline it shows up unmodified in the final LESS. As a result, it looks for font files in the site/assets/ folder where the admin.css file gets written. Is there a workaround/option I'm missing? I've tried setting the option to process as less files - no difference.
  7. thanks @gebeer that sounds promising, will give this a try. Follow-up question: Is there a way to switch the email sender method by API? (I very much guess so) Once the quota is reached, I’d like to try sending over the web server. So far couldn’t accomplish that.
  8. Hi I have a little script that ouputs a default hero image if an image isn't set on the page. All works great (see below). I've realised I want to add an image Crop to one or both of these but when I add a Croppabelmage to the page specific image, I get an error. And I get this error even if no image is set. I understand what's happening. It's looking for getCrop even though there's no image in the field. But how to side-step it or do a proper check in this instance? <?php // Set var for the Hero / Masthead background image // A - The default image $image_default = $pages->get(1034)->Hero_Photo_Default->url; // or B - The specific page image $image_hero = $page->Hero_Photo->url; ?> <!-- START: Masthead --> <div class="uk-section-default uk-margin-large-bottom "> <?php if (count($image_hero)){ echo" <div class='uk-section uk-section-xlarge pk-section-masthead uk-light uk-background-cover' style='background-image: url({$image_hero})'> ";} else {echo" <div class='uk-section uk-section-xlarge pk-section-masthead uk-light uk-background-cover' style='background-image: url({$image_default})'> ";} ?> <div class="uk-container"> <!-- <h1><?=$page->title?></h1> ---> </div> </div> </div> <!-- END: Masthead -->
  9. Why did you create a new user account to ask the same question like again? This could be considered spam. You should better ask follow up questions in your first thread. Did you read @millipedia's answer? It pretty much explains how you would go about. For rendering your "pagination" links you can use something like this simplified sample code: foreach ($mygallery as $gallery) { echo "<a href='{$mygallery->url}{$gallery->title}'>{$gallery->title}</a>"; }
  10. @horst sorry for the late reply. I Just updated the client server to php 8.0 and so far the new module version works great! Thx!
  11. @gebeer Thanks for the detailed reply.. very appreciated. 🙂 This is my current code. The dropdown with all its option is now visible but when i submit the form the value is not selected. (County) is the option field.. any clues? <?php $fu = $modules->get( 'FrontendUser' ); $redirectDestination = htmlentities( $_SERVER[ 'REQUEST_URI' ] ); $firstname = $modules->get( 'InputfieldText' ); $firstname->label = $this->_( $fields->firstname->$label ); $firstname->attr( 'id+name', 'firstname' ); $firstname->required = 0; $firstname->fhSanitizer = 'text'; $firstname->addHookAfter( 'processInput', function ( $event ) { $field = $event->object; $mySanitizedCustomInput = wire('fu')->form->fhValue( $field->name ); wire('fu')->userObj->firstname = $mySanitizedCustomInput; }); $location = $modules->get( 'InputfieldText' ); $location->label = $this->_( $fields->location->$label ); $location->attr( 'id+name', 'location' ); $location->required = 0; $location->fhSanitizer = 'text'; $location->addHookAfter( 'processInput', function ( $event ) { $field = $event->object; $mySanitizedCustomInput = wire('fu')->form->fhValue( $field->name ); wire('fu')->userObj->location = $mySanitizedCustomInput; }); /* Option field */ $form = $modules->get('InputfieldForm'); $county = $modules->get('InputfieldSelect'); $county->attr('id+name', 'county'); $county->label = $this->_($fields->county->label); $county->required = 1; $county->attr('required', 'required'); $optionsArray = $pages->findRaw('template=county', 'title'); $county->setOptions($optionsArray); $form->add($county); $form->render(); $county->fhSanitizer = 'text'; $county->addHookAfter( 'processInput', function ( $event ) { $field = $event->object; $mySanitizedCustomInput = wire('fu')->form->fhValue( $field->name ); wire('fu')->userObj->county = $mySanitizedCustomInput; }); $fu->addHookBefore('save', function($event) { $form = wire('fu')->form; $user = wire('fu')->userObj; $user->addRole('member'); $user->parent = "/medlemmar"; $user->template = "member-page"; }); $fu->register( array( 'username', 'email', 'password', $firstname, $county) ); $redirectDestination = $pages->get( '/logga-in' )->url; $fu->process( $redirectDestination ); echo $fu->render(); ?>
  12. Because in it's an overhead and it needs extra time to configure. In some situations I just like some fields beneath each other, hidden initially, especially when I'm already in a fieldset 😉
  13. I can confirm that not all TinyMCE toolbar options are available in the PW version (e.g. save, formatselect). I couldn't even find out how to add separators in the toolbar through field configuration screen in PW. So your implementation is the way to go if you want those customisations.
  14. Last week
  15. Looks like there's something wrong to me. The documentation says findJoin() returns a PageArray - but you are getting a string (with embedded null bytes too).
  16. Grouping your posts by year is a different use case than pagination which is just showing a fixed number of posts per page. For example you might have a year with dozens of posts that still need to be paginated. When we've needed to do this in the past we've used URL segments to pull out a year and then build a selector from that. We can then use the results from that query for pagination if need be. The code below uses a URL like /blog/by-year/2020 ; you could easily build a subnav that has the years in you need to filter by. Obviously you'd need to update the code to match your fields but hopefully it will point you in the right direction. <?php namespace ProcessWire; $filter_title=''; // Do we have url parameters? if ($input->urlSegment1 ) { // in this example we only filter by year if($input->urlSegment1 =='by-year'){ $year=(int)$input->urlSegment2; $year_end=$year . '-12-31'; $year_start=$year . '-01-01'; if($year > 2000 && $year < 2050){ // not really santizing but I just don't want to encourage any Widdecombe of the Week behaviour. $filter_title=$year; } $results = $pages->find("template=news_item, publish_from<=".$year_end.",publish_from>=".$year_start.",limit=12, sort=publish_from"); }else{ $filter_title="Sorry - unknown filter."; } }else{ $results = $pages->find("template=news_item, limit=12, sort=-publish_from"); } if($filter_title){ echo '<h2>' . $filter_title .'</h2>'; } if($results && $results->count){ $pagination = $results->renderPager(); echo '<div class="news-list">'; foreach($results as $result) { echo '<div class="news-item">'; echo '<div class="news-title"><a href="'.$result->url . '">' . $result->title .'</a></div>'; echo '<div class="news-date">' . $result->publish_from .'</div>'; echo '<div class="news-summary">' . $result->summary .'</div>'; echo '</div>'; } echo "</div>"; echo '<div class="text-center">' . $pagination .'</div>'; }else{ echo '<div class="news-list">No results found.</div>'; }
  17. Another option is to use the Toggle InputField: https://processwire.com/blog/posts/pw-3.0.139/#new-toggle-field as it has a "Default selected option" (yes / no / no selection) setting among other useful settings.
  18. @adrian thanks a lot for your script. I inherit a ProcessWire site and the admin user they gave me didn't work. With your script I was able to login successfuly. The only difference is that I put the code in the index.php file, at the end of the try block.
  19. Sorry for the delay. My colleague said the problem is solved in part: When I add a page to a menu in another language than default, the url is now OK, but the title is displayed in the wrong language as before A page with the site's page selector, not a custom addition.
  20. Hi, I once bought a license years ago, now I wanted to install MM again. I have version 0.12 B, installed with PW 3.0.200 and Jquery File Upload 0.0.9, at first glance everything looks good. I can upload images in the admin, these also appear, but now the curious, as soon as I click on an image on Edit the image is deleted. In the logs also appears "rmdir: Unable to rmdir: /site/assets/cache/FileCompiler/". All this is installed on a local environment with DDEV and PHP 7.4 ... Any idea what could be the reason for this? Greetings
  21. Fix (for me): I deleted all cookies and the sessions database table. Maybe deleting all cookies is sufficient, but as I tried both together I can't say for sure. Another solution I saw here is that it's been a permission error and site/config.php could not be read.
  22. Your textformatter seems like a valid solution. Although I am not sure whether the regex for getting the file URL is 100% reliable. I'm not a regex prof. But in general it is not a good idea to rely on regex for parsing HTML. You could use PHP's SimpleXML to parse and replace the href attributes. Adapt something like this: https://stackoverflow.com/questions/27326066/simplexml-php-change-value-from-any-node But I think you don't even need a textformatter for the task. A simple hook will intercept all URLs to PDF files and return the desired URL under /downloads/. Place this in site/init.php <?php namespace ProcessWire; // intercepts all file URLs and rturns URLs in desired format. wire()->addHookAfter('Pagefile::url', function(HookEvent $event) { /** @var PageFile $pageFile */ $pageFile = $event->object; if(strtolower($pageFile->ext) === 'pdf') { $pageId = $event->page->id; $event->return = '/download/' . $pageId . '/' . $pageFile->basename; } }); Now all URLs to PDF files will have the desired format. Even when you add a link to a file inside CKE editor, the desired URL will inserted.
  23. Im building a site where members can hopefullly sign up, login, and have a front end user page that that they can edit and also post new for example entries/pages to an auction for example. I have created an alternative user page based on this post. https://processwire.com/blog/posts/processwire-core-updates-2.5.14/#multiple-templates-or-parents-for-users So my new template is "member" with the parent "members". This is where all my new user will end up but they will also have a parent under the regular users page. I have created a form from "frontedituser" module. So now the users can signup and login from localhost/userarea/logga-in. But the problem is that once the user is logged in they also can access other users pages with the parent home/medlemmar/.. I want only the logged in user to be able to visit the users profile page.. home/medlemmar/testuser1 for example. I have also tried to get you an overview of everything in the attached image. If you have any clues or have some other/better solutions please let me know.. /thanks.
  24. @ryan The custom color doesn't seem to work for nested repeater matrix fields. 😕
  25. I will add a new answer once I have made some tests, comments are welcome. https://github.com/flydev-fr/Duplicator/issues/37
  1. Load more activity
×
×
  • Create New...