Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/22/2017 in all areas

  1. So, finally got some time to get back to setting up new backup services and it turns out from > 3.0.42 (latest stable) fixes the Filecompiler issues I think Ryan made some changes regarding the file compiler a while ago. For now I've changed: FTP with TLS/SSL support Dynamically loading of ProcessWire bases on the current folder I have sent a pull request.
    3 points
  2. Have been doing some work on v2, Currently, the new manager looks like this the image below. Descriptions: I've opted to show the optional descriptions underneath the source, and there will also be an option to not show them if it starts looking too cluttered. Originally, I'd said that they should be shown to the side of the source, but that makes it difficult and tedious to prevent datatables from running of the side of the page. With that said, my recommendation is to only use descriptions where they are really necessary -- like if you need to use the description for the purposes of searching a large data-set and you can't remember the source. At the end of the day, this feature won't be used my many and, for those who don't use it, it won't get in your way. Parameter Highlighting: You'll also notice that parameters in the jumplink destinations are now highlighted - this makes it easy for those who don't know 100% what's going on (like someone who has taken over a site) to learn quickly (tooltips provided). This feature can be disabled, though I'm not sure if it should be disabled by default. Please vote in reply -- if there's no feedback, I'll leave it enabled by default. Lastly, I don't think it's necessary to highlight source parameters (too flashy), but I do plan to add a slight underline to those for the purposes of tooltips, which will only really be handy for aliases such as segment. Slug alias: Speaking of aliases, I've added a slug alias, which strictly captures parts of a URI that are slugs; that is, a word, optionally followed by a single hyphen, rinse, repeat. Segment, however, is not strict and allows any amount of consecutive hyphens. In the new documentation, I'll recommend the use of slug.
    3 points
  3. This isn't actually an installable profile though - you can explore the template files but without the database from the demo site it's not as useful as it could be. @ryan, could you please make an exported profile of the demo available?
    3 points
  4. <?php // on endorsement subpage $thatRelatedDealsPage = $pages->get("show_on_endorsements=$page"); if($thatRelatedDealsPage) { echo $thatRelatedDealsPage->title; // etc ... } Something like this? I assume: On the deal page you select the endorsement in a PageReference field - and then on the endorsement page/template you can just search which page has "this page" (= $page) selected in that field. hope that helps
    2 points
  5. Just want to give a big thanks you to the processwire team! And all the hard work that has gone into the PW this year! Really grateful for how well this project has been developing and how much thought and handwork goes in behind the scenes. I am really looking forward to those native import / export features! As far as JavaScript rest $page API's goes you might also want to look into a GraphQL implementation, it seems like an ideal way to cut down on the network chatter for headless CMS's, and is becoming an emerging standard. also see:
    2 points
  6. The Fotomediale is a annual festival of photography for children's and youth photography in Freiburg, Germany. This small website provides information about the festival and its workshops. Because of the topic, this site is very picture heavy. Almost every page contains it own set of images displayed in the background. The images cycle through automatically, but you can also use the buttons on the edges (or if you want arrow keys on your keyboard ). If you want to see the images, you can collapse both the navigation and content area. The transitions between pages were made with Ajax and pushState, but you can also access them directly via their URL. To handle the large image backgrounds, all of the images are lazy loaded using lazysizes. The registration form was created using the API. www.fotomediale.de Modules used: ProCache Markup Sitemap XML Email Obfuscation (EMO) Tracy Debugger Regards, Andreas
    1 point
  7. You could also simply add a notification on your homepage, where you suggest users an link to their browsers language instead of forcing a redirect on them. Then you'd only have to get a different language for the notification and everything else can stay automatically translated.
    1 point
  8. You cannot rename the default language's name, just the title.
    1 point
  9. I spent way too much of my spare time with trying to produce an overly complex site backup module. Anyway - it is here in a pre-release state. I somehow have to get rid of the monster. Features: Use Storage Providers There are two base classes for Storage modules and three reference implementations: Remote Storage Driver This is a baseclass for construcing plug-in modules that allow to send data to a remote storage. You need to extend all abstract functions: connect, disconnect, upload and getConfigFieldset Implemented Examples Storage Mail Sends a backup as mail attachment. If the file size exceeds a set limit it will get split. It uses PHPMailer library as WireMail does not support attachments. @todo: For now this mails all in a single smtp session - maybe thats not so safe? Remote Directory Driver This is a baseclass for construcing plug-in modules that allow to send data to a remote storage and list and delete old files. You need to extend all abstract functions: connect, disconnect, upload, find, size, mdate, delete and getConfigFieldset. Implemented Examples Storage FTP Allows to connect to an ftp server and upload, list and delete files. Uses standard php ftp functions. Storage Google Drive Allows to connect to google drive server and upload, list and delete files. Uses the php google api. You have to create a Service account with the google developers console and add the key file to the plugin directory (or another directory if you specify a relative or absolute path to that file). s. https://developers.google.com/identity/protocols/OAuth2ServiceAccount#creatinganaccount I don't use the OAuth token process because it is not more secure. Once there is a renew token (which is necessary to avoid user interaction) it is as powerful and insecure as a keyfile. It is just more complex as it needs a callback url for registering. @todo? In case you can prove otherwise I will implement the callback registration. Run from the web or the command line It's allways better to have a regular cron job running. But sometimes you might need webcron Command Line You just need to call backup.php with the id of a backup job and it will be run Web Cron There is a token that starts the backup job from the web if passed as a url parameter. You can specify whether you want logging the http stream or not. You can also specify whether you want a job to be repeated within a certain timespan. This is for using unreliable webcron services by hitting the backup multiple times. @todo Consider integration of cron.pw @todo I use the init function of an automatically loaded module as a hook. This seems a bit strange. Is there better ways to do that? Log to mail, file and admin You can recieve logs by mail (on success or failure), log to a file and see log in a an admin page: Configure I built a admin interface that - besides the log viewer - features a list of jobs: and an editor for the job (which is too extensive to be described in detail): Dicussion I am not too sure on how to solve the issues indicated with @todo. My main concern are the hooking (init of an autoload module for the moment) and locking (none, no singleton for the moment). As for hooking I only know of the alternative of using a page where one would have (afaik) to use a special template as the admin template is secured or hook into the security functions (which would probably call for a singleton module). Concerning the locking issue I think it might be good if the Admin Class would lock if it is updateing something. For the moment this is the same class that runs the backups thus it would also lock the admin if there is a backup running. And it would lock the whole site if it is on autoload (as I use the init hook). Lastly I should reconsider the logging and maybe try to better integrate it with processwire logging. I would appreciate comments and suggestionsn on these issues. I appreciate your test results. Don't be took frutsrated if something goes wrong, this is at an early stage but afaik it should be running. Please find the modulle on: https://github.com/romanseidl/remote-backup
    1 point
  10. That would be a nice addition, though in my particular use case, I think I'd need support within the selector itself, e.g. something like one of these: $pages->find('...etc...,sort=title', ['sortmethod' => NATURAL_SORT]); $pages->find('...etc...,sort=title,sort.method=natural'); ...otherwise, I'd only be sorting the returned PageArray, and not the entire set, so it couldn't be used for pagination.
    1 point
  11. It seems to me that PW's sort() could support PHP's sort_flags - then you could specify something like: $pages->find($selector)->sort("fieldToSortBy", NATURAL_SORT); I just did a quick hack of WireArray.php and on first glance it all seems to work fine. The NATURAL_SORT flag does require PHP 5.4.
    1 point
  12. No, it is not possible out-of-the-box but there are workarounds: http://www.mysqltutorial.org/mysql-natural-sorting/ https://www.copterlabs.com/natural-sorting-in-mysql/ https://chrisjean.com/mysql-natural-sort-order-by-on-non-numeric-field-type/ If we are talking a potentially huge result set, I would consider a SQL solution (see links above) to update that field for each page in the result set.
    1 point
  13. Welcome to the forums @TJB. You seem to have made that page's template a system template. You cannot delete system resources like that. You would need to do it using the API. An example here:
    1 point
  14. I have pages that have children whose name/title is just a number. echo "<pre>" . print_r( $page->children()->sort("name"), true) . "</pre>"; echo "<pre>" . print_r( $page->children("sort=name"), true) . "</pre>"; The above gives me //echo "<pre>" . print_r( $page->children()->sort("name"), true) . "</pre>"; ProcessWire\PageArray Object ( [items] => Array ( [2] => /parent/1/ [0] => /parent/3/ [3] => /parent/5/ [4] => /parent/11/ [1] => /parent/15/ [6] => /parent/31/ [5] => /parent/33/ ) ) // echo "<pre>" . print_r( $page->children("sort=name"), true) . "</pre>"; ProcessWire\PageArray Object ( [items] => Array ( [0] => /parent/1/ [1] => /parent/11/ [2] => /parent/15/ [3] => /parent/3/ [4] => /parent/31/ [5] => /parent/33/ [6] => /parent/5/ ) ) Seems like this is not possible as mysql can't sort results that way. http://stackoverflow.com/questions/153633/natural-sort-in-mysql I think that's why the ways of sorting i posted above are different, first is sorted by php that can natural sort and second is sorted by mysql which can't natural sort/
    1 point
  15. @mel47, Please see this note on how to call a menu in a multi-lingual environment: If that doesn't resolve your issue, try refreshing your file compiler cache.
    1 point
  16. Would it be possible for someone to bundle up the skyscrapers 2 profile with relevant install/modules? I'm brand new to ProcessWire and I've made a couple of attempts without luck. It'd be great to test out the new site and hopefully learn something whilst breaking it! Thanks.
    1 point
  17. Based on the fact that you do not have URLs in the link hrefs I guess this menu is for navigating to blocks of content within a single page. Rather than hardcode this menu into the template and translate it using __() you could consider using a Repeater / Repeater Matrix for your content blocks and add a title field to your repeater items. Then you can create translations for the titles in Page Edit and generate your menu dynamically. Seems like it would be easier to maintain that way.
    1 point
  18. If you want pages where a field is not empty you don't need to deal with the fieldsets/templates at all. Just: $count = $pages->count("title!='', has_parent!=2");
    1 point
  19. Using a primary category in a parent-child relationship has some benefits: Visitors can see the relationship demonstrated in the URL and breadcrumb navigation The site structure is intuitive as visitors "drill down" through the page hierarchy to more specific pages There is some SEO benefit Finding a page in the admin page tree may be easier for site editors But this type of page structure is only possible (or only sensible) when a child page will belong exclusively to a single category of that type. So in the case of the skyscrapers demo it works for the city relationship as a building can only ever be in one city. But it wouldn't work for the architect relationship as it is conceivable that a building could be designed by more than one architect. And you wouldn't want to have duplicated building content under two ore more different architect parents. In the case of a turtle, you could for example use the taxonomical hierarchy in parent-child relationships: Trachemys scripta can only ever belong to a single genus, and so on up the hierarchy. But you wouldn't want to use "Native to" in a parent-child relationship as this would be both Mexico and the United States. @webhoes, matching to a page object / page ID like this is very reliable, but in most cases your Page field (habitat) will be limited to a single template and/or parent and the the titles of allowed pages will be unique. So you can cut out a step and do: $swampAnimals = $pages->find("template=animal, habitat=Swamp");
    1 point
  20. There's not really a way to reliably detect an overall first visit to your website. You could however use the session and store some key or really anything by which you can differenciate between first visit (redirect) and later visits (no redirect) while the session remains active. Or you could use a cookie, which could even outlive the session of an user.
    1 point
  21. This week's version of ProcessWire expands upon our markup regions support introduced last week, and also contains various minor fixes and tweaks. In addition, it adds a $urls API variable which is simply a shortcut to $config->urls. But since this is so commonly called upon, the shortcut can be useful in reducing verbosity in some template files. Meaning, if you want the URL to /site/templates/, you can now use the shorter $urls->templates rather than $config->urls->templates, if you'd like. This also adds consistency with our recently introduced urls() function that's part of the optional Functions API. https://processwire.com/blog/posts/processwire-3.0.50-core-updates/
    1 point
  22. If you just want a notification that a page is currently being edited by another user (like the default behaviour of Page Edit Soft Lock) then the optional core System Notifications module also has that feature. But if you want a "hard lock" option then I think Page Edit Soft Lock is the only option currently.
    1 point
  23. Order of input and label should be changed because of css seletor based on checkbox state (checked / unchecked) like this. input[type=checkbox]:checked + label:before {} I used this markup to get font awesome and css styled checkboxes work. <div class=field> <input class=input> <label class=inputfieldheader>Field three</label> </div> It would be awesome if modules like inputfields and form api would be written for frontend usage, but it's optimized for admin backend use only.
    1 point
×
×
  • Create New...