Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/29/2016 in all areas

  1. This week has been busy! We've got updates to our demo site, a new functions API, and other core additions that you may find useful in template files. https://processwire.com/blog/posts/processwire-3.0.39-core-updates/
    7 points
  2. Sounds like an interesting idea. The multi-instance support may be able to do this in the future according to Ryans blog post, so I guess secure authentication / communication between two apps will be something that has to be solved at some point. Maybe you can look at using an Oauth solution. The Oauth2 server from the PHP league seems to be highly recommended https://oauth2.thephpleague.com/ and they also have an Oauth client… http://oauth2-client.thephpleague.com/ Laravel recently integrated this Oauth2 server and called it Passport, to make doing authentication very easy. It’s explained here: https://laravel.com/docs/5.3/passport
    3 points
  3. A small site relaunched for a cultural sponsorship association: Freundeskreis Ludwiggalerie
    3 points
  4. I just pushed fixes for the issue identified by @Zahari Majini Please update to v0.2.0 or later if you want to use this field in repeaters.
    2 points
  5. The size you're seeing is most often the size of the image in a compressed filetype (essentially everything except uncompressed .tif). For resizing those images do need to be fully load in memory, which means the image is being uncompressed and therefore it's quite a bit larger. But in case of such big images it might be better to change the workflow. Even just uploading files of such a size via a simple html form is bound to be error prone (timeouts, network or memory issues).
    2 points
  6. Filterbox pagination workaround sneak peak (filter with ctrl-right, ctrl-left):
    2 points
  7. I've just posted a Fieldtype and Inputfield module combination that support the use of MySQL time fields in ProcessWire. Ryan's Datetime module is great but I needed something that dealt specifically with times for a scheduling system and this is one of the results. For 24 hour clock format ('HH24MM') you now get a clock-picker pop-up by default... ...but you can inhibit it if you don't want it... Although the input time format is selectable, as this is stored as a MySQL time field, you currently need to specify values in selectors in full "H:MM:SS" format. So if you wanted to get all events starting on or after 9am you'd do something like this... $events = $pages->find("template=events, starts>=9:00:00")->sort("starts"); This is definitely a beta module as I've not tested every single input format yet. Currently does not support negative time-periods or fractions of a second. FieldtypeTime on Github FieldtypeTime in the Module Repository Releases Version 0.2.0: Adds support for the use of this input field in repeaters and repeater matrix types. Version 0.1.0: Adds clock picker.
    1 point
  8. Not sure about someone's life but certainly a few human follicles lol. ---- Javascript : function RecordStats(id, field) { //alert("id="+id); // alert("field="+field); $.ajax({ url: '/site/<insert your PHP file path here>', type: 'POST', dataType: 'json', ///data: JSON.stringify({id: id, field: field}), data: {id: id, field: field}, cache: false, success: function(result) { //alePerSrt("Fire up Modal"); //alert(notice); //alert(result); //alert("Ajax call made"); }, error: function (xhr, ajaxOptions, thrownError) { alert(xhr.status + ' ' + thrownError); } }); Notes : 1) DataType is json, type is 'POST'. 2) Notice I have a blank function call (Explained in bold later) 3) Not sure if cache:false is needed. 4) In my URL I was pointing to recordstats.php which is listed below. PHP: recordstats : $id = $_POST["id"]; $field= $_POST["field"]; if (!IsNullOrEmptyString($id) && !IsNullOrEmptyString($field)) Stats::Record($id, $field); echo json_encode("{ok: 1}"); Notes : 1) Note I'm using $_POST to retrieve parameters 2) You HAVE TO RETURN a JSON object if I'm using JSON to receive parameters as per AJAX Specification. This is the part where I pulled a few follicles out. Stats : static function Record($id, $field) { //https://processwire.com/talk/topic/12158-how-to-make-a-simple-visitor-counter-for-your-page-in-pw/ $stats = wire(pages)->get("/stats/, include=all"); $key = $field.$id; if(!wire(session)->$key) { $stats->of(false); $stats->$field++; //$stats->save($field); $stats->save(); wire(session)->set($key,1); $stats->of(true); } } IsNullOrEmptyString :
    1 point
  9. Just updating this thread in case anyone thinks I've ignored @cstevensjr - I haven't; we are communicating via PM, trying to sort out a problem.
    1 point
  10. Making a minimalist site with Processwire is pure pleasure. Here is one for my photography. http://www.mikael.siirila.net/ Enjoy
    1 point
  11. Oh, I have tried and loved larger formats. But one has to focus. I totally enjoyed the Hasselblad 500CM and Mamiya 7 and also explored larger 4x5 format with a Japanese wood camera. But I am restricted by a home bathroom-darkroom. Since my photography makes no money I prefer the costs of 35mm (both materials and darkroom equipment). Also all my photography is candid or with minimal interference making larger cameras and slower shooting an issue. The Leica M is my friend. Darkroom photography is on the rise again. Get over the longing and re-build your darkroom!
    1 point
  12. @fbg13 ok, I'll have a look! @kongondo thanks :), I surely remember the invaluable Wayfinder snippet, I am eager to test the Menu Builder
    1 point
  13. nav#kotm should get rid of the padding-right 62.5px and everything should be fine. BTW it's in Chrome too.
    1 point
  14. Congrats! but the main nav bar looks a bit weird in Safari.
    1 point
  15. @Zahari Majini Ok, that's unexpected. My local install (3.0.36) has it working in normal contexts as well as repeater-matrix contexts. Did you overwrite the InputfieldTime.module file with the new one? Any chance you can PM me login details to allow me to try and trace what is happening on your installation? Regards, Steve
    1 point
  16. Looks like you're running PHP 5.3 on the live system. You could fix this error by replacing the short array notation [...] used throughout the module with its verbose notation as array(...), but you should really think of switching to a more current PHP release.
    1 point
  17. This fix is now included into the module. Thanks @teppo and @ceberlin. //Jasper
    1 point
  18. @microcipcip https://processwire.com/blog/posts/processwire-2.6.7-core-updates-and-more/#new-core-files-for-site-hooks
    1 point
  19. Another alternative would be using what you (probably) already have: it's more than likely that you've got logging enabled for Apache, and the Apache log file will no doubt include the URL of each viewed page. See where I'm going with this? The benefit of this approach would be that you reap all the benefits of ProCache: the bulk of the requests are served static files, and PHP or MySQL (or Redis or whatever) won't need to be triggered at all. The obvious downside is that parsing the logs requires a bit more work than simply fetching the data from a table.
    1 point
  20. Looks like I have made the following patch locally: - if ($page->isChanged('status') && $page->is(Page::statusUnpublished) && $page->publish_from) { + if (!$page->isNew() && $page->isChanged('status') && $page->is(Page::statusUnpublished) && $page->publish_from) { Possibly related
    1 point
  21. Hey guys, Just launched a new project called Fabricius: fabriciusstrasse31.de Fabricius is a new building thats being built in Hamburg (Germany), that offers modern living comfort in a green environment. I developed the whole brand strategy and visual identity for the website and some printing materials. The logo mark is derived from the silhouette of the building, which is surrounded by trees (circular shapes) and green areas. More details here The website is build with PW 3.0 and uses Modules like Map Marker, Pages2PDF (to generate the apartment exposes) and MarkupSrcSet. Thanks for the awesome support here and the development of PW and the modules!!
    1 point
  22. You could also use a hook. $this->addHookAfter('ProcessPageEdit::execute', function(HookEvent $event) { // Get page being editted $page = $event->object->getPage(); // Only use on pages with the product template if ($page->template != 'product') return; // Set the title & you also have access to all $page fields $title = "New title"; // Overwrite the processBrowserTitle $this->wire('processBrowserTitle', $title); }
    1 point
  23. The pages views IMHO aren't really in a critical range if you have halfway decent hardware, though if you're really trying to squeeze milliseconds out of the system and be prepared for spikes in page hits, a (carefully tuned) redis approach might be the best option. As an intermediate solution, you may also consider storing hits in a (non-pw-field) InnoDB table (entry id with auto increment, page_id, timestamp, plus arbitrary non-key columns) to avoid file level locks and repeated seek()s to the end of a potentially large log file. I'm using the InnoDB approach for our intranet with > 50.000 page views / day. In a nightly cron job, I switch the stats table for a new one (create table stats_new like stats; rename table stats to stats_[timestamp], stats_new to stats) and process the data from the then idle table.
    1 point
  24. Your true is probably being converted to an integer 1. The second parameter of json_encode is $options and it expects an integer representing a Bitmask of JSON constants.
    1 point
  25. I know this is possible. And I also considered using a similar solution in such cases. But … That’s exactly what I don’t want. I don’t want to sort of reinvent the whole URL handling in ProcessWire – which is basically what any of the mentioned solutions is, even if it is only for a certain part of the page tree. As a front end developer I simply don’t want to have to take care of URL handling. That’s the CMS’ job. And ProcessWire does this job very well. I don’t want to completely separate the page tree structure from the URL creation. I’d just like to have an intuitive and easy to use way to skip one page tree level in the URLs if required. But probably this is no good idea at all. In most cases I can ether live with the extra level in the URL path, or I can structure my page tree using some “folder” pages and the multi-sort module, so that the most of the URLs are as short as I want them to be, while the page tree is still quite neatly arranged.
    1 point
  26. i think using this sort of structure is going to be inevitable on a lot of projects, especially where you don't need/want the users to even interact with the page tree - for example a shop or product catalog; in those situations, you may use a bucket approach, putting all of the products into a 'folder' and then when the user creates a new product they need to set it up from the editing screen - meaning they may need to specify a product type, family, category, or even a combination of those things. Product categories may be just options that need to render lists of items in those categories. In Ryan's CMS critic case study, he demonstrated a hook to rewrite the path of any page based on it's template. I use that method, but depending on how complex the setup is, it may have a series of cascading implications that need to be accounted for system-wide, such as page title, section, breadcrumbs, and the actual page that is supposed to be rendered. I setup a WireData container ($config->segmentData) where i can set those items so that the system can work with whatever virtual page needs to get rendered based on the request. So in the end i was able to get a complete URL routing system by 1) adding the page paths in a hook in ready.php for the relevant templates 2) adding a custom WireData() ($this->wire("config")->segmentData = new WireData();) in ready.php 3) setting up some blank vars in that $config->segmentData in the template init, like $config->segmentData->page = ''; 4) setting up a router template which handles the segment requests, and setting a page in the tree to use that template. 5) i also use a getVirtualPage function that simplifies the code in the router there are a couple of other concerns depending on how you render the content, but nothing that difficult...
    1 point
  27. Your web server should be configured to have a single canonical domain to avoid fragmentation of SEO and analytics, and your sitemap should use it. If the "www" version of the domain is canonical, requests for sitemap.xml will be redirected to that domain and the generated links should match. The module simply uses the value of $page->httpUrl. ProcessWire's .htaccess file includes directives for Apache to set a canonical domain, but they are commented out by default. Look around line 123: # ----------------------------------------------------------------------------------------------- # 13. OPTIONAL: Redirect users to the 'www.' version of the site (uncomment to enable). # For example: http://processwire.com/ would be redirected to http://www.processwire.com/ # ----------------------------------------------------------------------------------------------- # RewriteCond %{HTTP_HOST} !^www\. [NC] # RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    1 point
  28. I think this one little upgrade is worth being mentioned in the blog post. If I get it right, we are finally able to address page save and field save events for the page in one hook! Wow!
    1 point
  29. @mscore: Haha, really, this is old-school: Tri-X and Rodinal! Great. So, in 35mm format, I ended up with the T-max films, (around 1985-1995). But I don't like(d) the big grains that much. Therefore I early switched to greater film formats: 6x6 & 6x9cm, 4x5inch, 13x18cm. But my last darkroom experiences with positives are 20 years back, iirr. Films (E-6 dia positives) I regularly developed with a JOBO ATL-3000 (the biggest drum contains 14 35mm films at once) until 2010. (between 2005 / 2010 only for the large formats 4x5inch and 13x18cm). All other and since then is/was direct digital. Are you not interested in larger formats? The costs for good equipment is very cheap since all in the pro sector is requested direct digital. PS: your site at instagram is very nice too. My favourites there, besides all the beautiful motives, are the "one breasted lover", the "seal dryer" and the "archival system". Seeing all this, I get longing!
    1 point
  30. Oh this is seriously on-topic. I am old-school. Tri-X 400 + Rodinal 1:50 (20C, 14min). For most recent work etc check https://www.instagram.com/mikaelsiirila/.
    1 point
  31. Don't we have a Moderator around? @horst is speaking alien language which is seriously off-topic
    1 point
  32. I want to add my 2 cents too. @Soma: yes it maybe error prone, and yes some of these steroids should belong into the core. In the past we have had some small modules that tweeked a single thing in the admin, fe add more button functionality for pages directly in the page tree overview, your "page is edited reminder" to avoid accidentaly leaving a page without saving, and others. Over the time, many of this was included into the core. And I believe not all would have benn incorporated without becoming a module first. So, besides all the good steroids stuff here, there are two things I additionally like on AdminOnSteroids: 1) that it collects many usefull parts into a single collection, avoiding to deal with 10+ small modules, and 2) to have the ability to see (and early use) what all can be possible. Ah, there are more: 3) for Ryan it can be a good way to just try out things, and, hopefully incorporate some into the core than. 4) I can decide for every single feature to en- or disable it. I even can install AOS and have the unchanged default admin theme. So, if there is an error (CSS/JS) I simply can disable a feature or the complete module.
    1 point
  33. Well, we love it or not, this is how WordPress works. For those interested, here is a (guess what...) new plugin to clean things up: https://wordpress.org/plugins/wp-asset-clean-up/
    1 point
  34. Well I just tried to make changes to a WP site to speed it up. I was literally out of curses because the site was built on a theme which was trying to achieve everything through the admin, no coding required. The result was downloading about 10 google fonts, many of them duplicates, and Js files were about 640 kbytes altogether, just to mention a few things. There was even a cache plugin in duty but didn't help much. We also tried to move the whole thing to a faster server but it loaded hell slow there too. This was a nice example of 'wp devs' who set up something which seemed like being a website but actually a piece of crap. If I were the client I weren't pay money for this. It's also interesting that there are such low quality themes allowed. Anyway, the site may be rebuilt in PW in the future, just to have a happy ending here
    1 point
  35. Here's a tip for making your global settings / global options page easily accessible in the admin, without having to create a custom process module or going to the page using the pagetree. Let's say the page name of your settings page is called "settings" and it's directly under home. Now, create a *new* page under the admin page in ProcessWire. Use the "admin" template. Call this page "settings" as well. After saving, it will now give you the option to choose which process module this admin page will utilize. Choose "ProcessPageEdit". Now you will have a link in the main navbar to this Settings page, but when you go to it, it will error saying "Unknown page" + "the process returned no content". What you need to do is make this page load the /settings/ page you originally made. Using the special "/site/ready.php" file (create ready.php if it doesn't exist), you can add the following line of code to it: if($page->template=="admin" && $page->name=="settings") $input->get->id = $pages->get("/settings/")->id; Now go to the Settings page in the navbar. Nice, easy and "official" feeling.
    1 point
  36. @clsource It currently provides two implementations of thread-safe counters. The first uses PHP file locks in blocking mode and stores the counters as files on local disk (under your assets folder). This allows the counters to be migrated alongside your application code if needed. The other, faster, implementation uses Redis as the counter storage engine leveraging its atomic increment and decrement functions and atomic LUA scripting. The neat thing about the Redis implementation is that the counters can be shared between multiple instances of your application (or even different applications) running on different servers. This really allows things to be distributed. It does, however, require some extra configuration work to get the Redis server set up in the first place (but that's actually pretty simple under debian and ubuntu at least.) Both implementations have mechanisms built-in to allow recovery from the deletion of (or simply forgetting to migrate) the underlying counters. I hope to have this module available for sale over the coming weekend on my first native PW shop site and I'll post more about it then.
    1 point
×
×
  • Create New...