Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/16/2018 in all areas

  1. Like the last few weeks, most efforts this week focused on resolving issue reports at GitHub and preparing the master version. We are at a point where I think our dev branch is far better than our previous master (3.0.62), in every way, stability included. So there's no reason to delay further—3.0.96 is our new master version. This post covers all the details: https://processwire.com/blog/posts/pw-3.0.96-master/
    18 points
  2. If you're looking to do an elaborate a page builder with ProcessWire and don't want to pull your hair out, I highly recommended viewing this video: A couple notes: with the css grid specification, you can assign multiple blocks to the same grid-area but they will overlap each other. I've "overcome" this by combining multiple blocks into a parent div and assigning that instead. pretty easy to do. i didn't demonstrate it, if your blocks have a grid structure within them (like built with flexbox), you can still assign that block to a grid-area. so if your blocks themselves have a grid structure, that's ok. for example, if your css grid layout is 6 columns, but you have a block that has a grid inside of it (built with like uikit's grid that's 5 columns), you can assign that block to the grid-area. with the css grid specification, the flow of the blocks does not have to match the flow of the grid-areas. this is insanely powerful. Enjoy.
    14 points
  3. Since all good things come in threes, here's another responsive blog profile for PW3: Editorial Travel Blog Template Like the previous two, it builds upon @kongondo's Blog module and uses @justb3a's Simple Contact Form. It also makes use of @Pete's XML Sitemap and @ukyo's Font Icon Picker. Features: Responsive Slide-in sidebar Homepage with picks and last posts, 3-column layout Selectable widgets, e.g.: Recent posts Recent comments Current month calendar with links to posts per day User-switchable sort order for lists (ascending/descending) Configurable list pagination An online demonstration can be found here. And again: all feedback is welcome!
    10 points
  4. Great job, @ryan! It was really astounding to watch the commits roll in and the open issues melt over the last few weeks, and there are so many new features too! I've been using latest dev versions extensively, and the few minor bugs I stumbled upon were solved before I could report them I even used some of the newly implemented features without realizing it This year already rocks!
    9 points
  5. And here's another site profile, again based on a free template from html5up.net: Download link: Strongly Typed Travel Blog Template (Responsive) GitHub Repo Features are much the same as in: Additionally, the sidebar can be aligned either to the left or right, and navigation is cached for 24 hours using MarkupCache. As always, I'd be happy about any feedback. Mobile Screenshot:
    5 points
  6. My experiences in 15 years with PHP on windows told me to not make any (platform) differences with filesystem related stuff. Simply use the / forwardslash for everything as long as you can achieve all operations with PHP internal functions! (copy, delete, ZIP!, etc) The one and only rule where you need to convert forwardslashes to backwardslashes on windows is, when you do calls in the commandline via exec() or system(). All other stuff is handled well from PHP internallly across all platforms. So, on windows you should not use functions like realpath() or dirname() without to convert backslashes to forwardslashes afterwards! Thats the only rule I followed all the time. (locally detect windows = convert \ to /)
    3 points
  7. Really, really nice! What do you think of packing this into a fieldtype? Would be nice to have all the logic, files and fields packed into a module and to only have to add your field in the template editor I'm also working on a site with matrix content builder and using field rendering makes the code very clean: My matrix field is called "content" and all my items are included via WireRenderfile(). Then it's as easy as placing a file with the markup in /templates/matrix (here 2columnlayout.php).
    3 points
  8. Haha, I might as join in too I use the Logitech G600 MMO Mouse exclusively. Why? Because of its programmable feature, you can program your most go-to keyboard shortcuts into it. It takes a little time to program it in, and more time to find a layout that suits you but just take your time with it. It's definitely worth it IMHO as you can eliminate all keyboard shortcuts making you more efficient. https://www.logitechg.com/en-us/product/g600-mmo-gaming-mouse The best thing is you can upload someone else's mouse profile and use it so if anyone is interested in my PHPStorm layout, give me a shout. Before the MMO mouse was released, I used a Logitech G13 Keyboard for the same. http://support.logitech.com/en_us/product/g13-advanced-gameboard
    3 points
  9. In terms of adding markup to admin themes, the following hookable methods are common to all admin themes: AdminThemeFramework::getUserNavArray Allows you to add items to or remove items from the "user" dropdown menu (Edit Profile, etc). AdminTheme::getExtraMarkup Allows you to add markup to the following regions of the admin template: head notices body masthead content footer sidebar For example... $wire->addHookAfter('AdminTheme::getExtraMarkup', function(HookEvent $event) { $regions = $event->return; $regions['masthead'] .= '<p>hello</p>'; $event->return = $regions; }); So not every place in the admin theme markup is covered (I don't see how it could be), but it allows for simple additions to the admin theme. No doubt you would need some custom admin CSS to position and style whatever markup you add. Other approaches... Manipulate the rendered markup string For some cases this might do the job. For example... $wire->addHookAfter('Page::render', function(HookEvent $event) { $page = $event->object; if($page->template == 'admin') { $out = $event->return; $out = str_replace('<div class="uk-navbar-right">', '<div class="uk-navbar-right"><p>hello</p>', $out); $event->return = $out; } }); Copy your preferred admin theme module from /wire/modules/AdminTheme/ to /site/modules/ Make whatever changes you need to the copied files, perhaps by including a separate PHP file at the right place in the template markup. That will make it easier to update the admin theme module from the core version when you choose to.
    3 points
  10. c) take some drugs & ProcessWire and see what happens ?
    2 points
  11. I can definitely supports ML (although, it depends a bit if you also take into regard backend-usage... labels, fields - perhaps if you install an "exotic" language pack, some labels etc. are maybe not translated. But you can edit those yourself like in the PW-backend). But as far as handling ML content - yes, it supports all that.
    2 points
  12. I can only speak by my experience with them, so: ProCache: 100% support ProDrafts : 100% support FormBuilder: almost all fields support, but Options and Select fields. But there's a workaround. ProFields: I think only Table won't accept multilanguage fields. The other profields work fine. ListerPro: I didn't use it yet, but I think it fully supports ML's as it is a extension of the basic lister.
    2 points
  13. Sorry @kongondo - me again I am noticing that the renderMarkup() method is called many times on the currently edited page and it's also called on page reference fields on the page being edited. This makes for a lot of calls to this method that don't seem necessary as far as I can tell. Do you think this can be improved? As an example, I put: bd($page->id); at the top of that method and saw this: I am currently editing page 1100, but there are a few page reference fields which are also showing up in that list. Thanks for taking a look!
    2 points
  14. Excellent! I've been toying with the idea of shipping the Blog Module with one of this free blog templates but never got round to it. that's exactly what I've been told about my websites!
    2 points
  15. I see, thanks for your input. At this moment, Its working in the way : unix to unix ok unix to windows ok windows to unix, testing it right now
    2 points
  16. The grid-template-areas field might want to sport a monospace font for better alignment of those single letter area names
    2 points
  17. I'm not aware of any crossplatform differences with the internal PHP ZIP functionality. What is the issue you are speaking from? Also, I have (re)written a ZIP library in pure PHP that is only one single file. But this was in the times as the included ZIP in PHP wasn't available on many hosts.
    2 points
  18. Hello guys, just to let you know that I am working on the module. @Karl_T As i need the module working on windows ASAP, I tested your fix on my Windows 2008 r2 server / PHP 7.0.28 and it throw error on $zip->close(); with an error : "No Error" ? Which version of Windows and PHP you are working on please ?
    2 points
  19. This is awesome, @Jonathan Lahijani!!! Great work!! For those eager to learn CSS Grid, I recommend this excellent (and free) course by Web Bos: https://cssgrid.io
    2 points
  20. Hey @teppo - no idea why, but logins are now showing fine in Chrome. It's weird because yesterday it wasn't just my login attempts that were showing JS disabled and no flash info. I'll keep an eye on it. Sorry to bother you!
    2 points
  21. Hi everyone, I know we'd all like to see ProcessWire grow in popularity (maybe not hugely, but just enough that more people know about it which can help to convince clients to go with it). It strikes me as strange that the ProcessWire Github repo still has less than 300 stars - I'd like to see us well over a thousand which should be an easy task for the forum members to achieve. I see so many other projects with lots of stars but for some reason it doesn't seem like it is something we tend to do around here, despite being a very active, friendly, and supportive environment. I also think that starring your favorite modules doesn't hurt either - I think that will also help to increase the visibility from PW and also help out module authors a little as well. If you can show your Github project has a decent number of stars it shows that you are building things that people want which can help you land a job and helps you to convince the client that you and ProcessWire are a good mix. Anyway, if you have a minute to do some starring of PW and your favorite modules, hopefully it will benefit us all a little. Thanks!
    1 point
  22. UPDATE 2022 Simple and powerful - put this at the end of your config.php file: $localConfig = __DIR__ . "/config-local.php"; if (is_file($localConfig)) include $localConfig; Then put all local settings into config-local.php (same concept for DEV/STAGING/PRODUCTION): <?php namespace ProcessWire; /** @var Config $config */ $config->debug = true; $config->advanced = true; $config->dbName = 'db'; $config->dbUser = 'db'; $config->dbPass = 'db'; $config->dbHost = 'db'; $config->userAuthSalt = '1234'; $config->tableSalt = '1234'; $config->httpHosts = ['xyz.ddev.site']; // this prevents logout when switching between // desktop and mobile in chrome devtools $config->sessionFingerprint = false; // RockFrontend $config->livereload = 1; // RockMigrations // $config->filesOnDemand = 'https://your-live.site/'; $config->rockmigrations = [ 'syncSnippets' => true, ]; // tracy config for ddev development $config->tracy = [ 'outputMode' => 'development', 'guestForceDevelopmentLocal' => true, 'forceIsLocal' => true, 'localRootPath' => '/Users/xyz/code/yourproject/', 'numLogEntries' => 100, // for RockMigrations ]; $config->rockpagebuilder = [ "createView" => "latte", ]; -------------------- OLD POST from 2018: Have you ever come across the situation where you needed to change your config.php file for local development? Have you ever come across this warning? Say goodbye to this little annoying tasks Some of you might know that you can have a separate config-dev.php file for local development. This is nice, but also needs some setup (for example excluding this file for git upload) and there is still some danger of uploading this file to a place where it should not be... The other option was to keep the database settings for your live and dev server in sync - also not easy and maybe not the best... My solution is as simple, fast and I think it should be even safer than the other options. Just put these lines at the end of your config.php file: if(strpos($config->paths->root, 'C:/www/') === 0) { $config->dbUser = 'root'; $config->dbPass = ''; $config->httpHosts = [$_SERVER[HTTP_HOST]]; $config->debug = true; } elseif(strpos($config->paths->root, '/var/www/vhosts/') === 0) { $config->httpHosts = []; $config->dbUser = 'XXX'; $config->dbPass = 'XXX'; $config->debug = false; /** * Redirect to HTTPS * ATTENTION: This will NOT work with ProCache enabled! Use .htaccess instead */ if(empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == "off"){ $redirect = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; header('HTTP/1.1 301 Moved Permanently'); header('Location: ' . $redirect); exit(); } } else die('wrong config.php'); Having a separate config-dev.php file also makes it necessary to keep both files in sync. That was my first idea: To include the original config and then overwrite settings. But it's just simpler the other way round: Using the default config.php file and overwriting settings there.
    1 point
  23. Yep, well took a bit longer reading the doco, experimenting etc and my site was already live. Now I know how to do it, will only take 15 minutes next time. Steps: Create your icons. I only had up to 256x256px. That's old hat. Now you need up to 1024x1024px. Decided to go with my existing website/app icon set anyway. Go to http://www.manifoldjs.com/generator and fill in the blanks Generate the files, download the kit, edit the files and/or your PW template(s) required and upload to the root directory, not /site/ directory, of your ProcessWire site Woohoo!!! Works great with a couple of provisos: The online builder does not work for Mac, iOS and Windows 10 devices, only everything else. Found it somewhat ironic it lacks Windows 10 support as this is a Microsoft product. No surprises there! For Mac, iOS and Win10 you have to use the PWABuilder CLI, almost formerly ManifoldJS CLI as it's going through a name change. Would be ever so grateful to anyone who can tell me how to do that. Followed the instructions to the letter, and also multiple variations, and could not get the CLI version to install/work and I definitely have the latest versions of Node and npm. PWABuilder delivers a manifest.json file and a couple of basic service workers, without all the fuss associated with SPAs, REST APIs etc, for small, informational websites. Watched a video recently that amongst other things, stressed PWA != SPA. Took me a while to get that. (Tip: skip the ads) While not yet perfect, PWABuilder was a good introduction for me to PWAs for ProcessWire.
    1 point
  24. Nah, ProcessWire is enough of an addiction
    1 point
  25. How about changing to this? If doesn't help, try to check that the file you try to include has the correct path. include_once(__DIR__. "/_strings.php");
    1 point
  26. Hehe. The yearly hey fever hit me over my holiday week, so I could a) dose myself up with that anti-allergy stuff that makes me too tired to do anything (including going out) or b) stay inside without drugs and find the time to spend a few hours every day doing fun things on my computer Choosing b wasn't difficult. The lacking choice of nice blogging templates in PW was something that has been nagging me for quite a while, so this was the perfect opportunity. I do hope so!
    1 point
  27. Not sure if I understand what you are talking about. PW will never be as "mass used" as Wordpress, but this doesn't make Wordpress a better tool. Then you are comparing PW with e-commerce tools. I don't need e-commerce tools most of the time. But I once had a job to code a complete website with Magento. It is more or less usable for the e-commerce part, as long as you don't need anything "special", but for developing the rest of the website, it is a nightmare imo.
    1 point
  28. Can you please elaborate a little more and better explain what you are talking about? If you could provide some examples about PW's inabilities, that would be very helpful.
    1 point
  29. Update: there's now a preview available here.
    1 point
  30. @adrian I know Jumplinks. I use it, I like it and I recommend it. Somebody else using my Process404Logger module had problems interacting with ProcessRedirects. To test and fix this I needed to fix the bugs of ProcessRedirects first.
    1 point
  31. I'm not sure. You could add some htaccess/rewrite trickery to avoid redirects, but that would mean that all template settings have to be identical. If somebody changed the trailing slash setting for just one template, that would fail even worse (like end in an endless redirect loop). It might be possible to avoid his kind of error if the backend issued a redirect with a 307 status code instead of 301 for slash url redirects, as that would preserve the request method and POST data for the repeated request, but there has been a lot of back and forth about 307 and308 methods, browser implementation details, compatibility with older browsers and possible security issues which I haven't been following up on. Perhaps @ryan himself might be able to say whether redirecting with 307 would be an option.
    1 point
  32. Just came across this need for the SEO module as well. I have posted this request: https://github.com/processwire/processwire-requests/issues/170 Until there is some progress on that, here is my hacky solution. I am sure it could be improved, but it works for now. $this->addHookBefore('ProcessModule::executeEdit', function($event) { if(!$this->wire('user')->isSuperuser() && $this->wire('input')->get->name !== 'MarkupSEO') { throw new WirePermissionException('You do not have permission to configure this module.'); } }); $this->addHookAfter('ProcessModule::executeNavJSON', function($event) { if(!$this->wire('user')->isSuperuser()) { if($this->wire('input')->get->site === '1') { // note \/admin\/module\/ - if your site admin is at /processwire/, then use: \/processwire\/module\/ $event->return = '{"url":"\/admin\/module\/","label":"Modules","icon":"plug","list":[{"url":"edit?name=MarkupSEO","label":"MarkupSEO","icon":"gear"}]}'; } else { $event->return = null; } } }); That results in this - Modules > Site contains just the SEO link and all the others are empty. Thanks @Robin S for the headstart on this!
    1 point
  33. Came back to say that the regex example I gave can also work without regex, because we're not actually using its power. So, if you just add "map" and "carte", one per line, on the URL Segment field, in the template settings, it will also work. Regex is more appropriate when you have cases like these: //to get segments like /export-json or /export-xml regex:^export-(json|xml)$ //to get segments like "2018/episodes" regex:^\d{4}/episodes$ //to get segments like "category/ebooks/". I used this when there's no category pages associated with the template, just options of a Options field. regex:^category/[a-z]+$
    1 point
  34. 1 point
  35. Unless you will be storing the result of an initial check (e.g. in a session or cache), you will have to check for the existence of the file. That aside, do you really need a hook for this? If I got you correctly, couldn't you do the check in the template file itself or that would mean repetitive code? If you did the check in init.php, you wouldn't need to have the same code check in different template files. I don't know if I am making sense, so on to an example. If you had this in init.php (assuming you are using delayed output). $templateName = $page->template->name; $customTemplateFile = $config->paths->templates . 'fields/content/' . $templateName . '.custom.php'; // if user is superuser (or user of your choice) AND we have a readable template file (e.g. home.custom.php) // ... we include it if($user->isSuperuser() && is_readable($customTemplateFile)) { include($customTemplateFile); } // else, include normal template file for this page else { include("./basic-page.php"); }
    1 point
  36. Fresh install of PW 3.0.62, I'm getting this error when installing the latest version of Recurme: Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in /var/sites/t/X/public_html/wire/core/Modules.php on line 3921 Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in Unknown on line 0 Never seen this before and I'm a bit stumped... Any ideas? Edit: Increased memory limit with ini_set on the module to see where this goes and got a 30s execution time error. Can't figure this one out, there must be a loop somewhere as increasing that came back to a 800MB memory limit! Edit 2: Solved! I'll send you an e-mail with details.
    1 point
  37. Brain dumping here, but on one end of the spectrum, we have good-ole' templates, which is what ProcessWire is all about. Then on the other end, we have these infinitely configurable, drag-and-drop page builders. Popular ones include: webflow.com (arguably the most elaborate) grapesjs (looks like open-source webflow clone that they encourage CMS's to integrate) yootheme pro (a wordpress builder; Yootheme is the company that makes UIkit, so their approach particularly appeals to me since I'm all in on UIkit); it's interesting to see how a pure, truly inspired uikit builder would be imagined, and yootheme pro is it other wordpress builders: gutenberg, divi, beaver builder, + a million others Of course, if you have a site that has highly relational data and templates, PW is perfect, but then there's those one-off pages, or sections within templated pages, that need the flexibility of a builder so the non-coder editor who's editing the page can do what he needs to do. I think these builders need to take the end-user into consideration... with too much flexibility and an editor without a strong understanding of how they work, it's more likely the resulting builder page that has been created is going to be sub-par. The images might be way too big, the fonts may be off, spacing, etc. etc. Honestly, even when I as a web developer use those builders, it doesn't feel right, but perhaps that's because I'm totally biased. I feel having a strong set of components/blocks that each have a bit of flexibility to them via various options is the better way to go if it makes sense for a site. RepeaterMatrix does this perfectly and because it's through RepeaterMatrix, you can use PW's API to query things if need be. The trade-off is doing column layouts is a bit trickier (not impossible), it's not 100% visual/drag-and-drop, and you have to create a defined list of blocks/components/matrix-types (which is another way of setting up some expectations of what is and isn't possible).
    1 point
  38. I've been using this field and appreciated the string of page IDs for PW pages. I'm wondering if instead of converting the ID to a URL before returning it, how about returning an object? So, Instead of $page->AssistedURL returning just a string "/mypage/" (internal) or "http://www.anothersite.com/" (external), it returns the object: // Internal PW page { 'id' => 1234, 'name' => 'mypage', 'url' => '/mypage/', 'httpUrl' => 'http://my-processwire-root.com/mypage/' } // External link { 'id' => 0, // 0 or null 'name' => '', // blank or null 'url' => 'http://www.anothersite.com/', 'httpUrl' => 'http://www.anothersite.com/' // url and httpUrl are the same for external links } // Accessing the data $page->AssistedURL->id $page->AssistedURL->name $page->AssistedURL->url $page->AssistedURL->httpUrl For backwards compatibility, could $page->AssistedURL by itself be a magic method to return the URL as it currently does? By returning relative and absolute links, the same field could be used in multiple situations (eg, on an internal menu, and in an email template).
    1 point
  39. This has been my experience with a site I inherited (wordpress) that was using the Oxygen plugin. There are template partials stored under the plugin menu that you "call" from the visual builder (ie once you go to edit a page). It really became a nightmare on finding what parts were being used, and where all of this data was being housed in the backend. Giving the client/user a way to drag/drop content seems nice, especially when you know the project is over. However, when you come back to it for any updates, the project has turned into a tangled mess with no map. I do apologize if this has became a rant on Wordpress, as I still enjoy wordpress for blogs. It really comes down to having a nicely structured backend where it all "just makes since".
    1 point
  40. Or use SettingsFactory for your settings page if it can support the fields you need.
    1 point
  41. Good day, @flydev! I am trying to transfer my work (done locally on windows 10) to a production linux server. But after package got extracted with the installer, I got this instead of the file structure; (filenames = what should be paths) When manually extracting I get the same result. It seems like archiving does not work as expected on windows. Am I doing something wrong, forgetting something?
    1 point
  42. I'm using mod_rewrite to link to files on the live system if they are not found on the development systems: # file: .htaccess <IfModule mod_rewrite.c> RewriteEngine On # Get all asset files from remote if localy not available RewriteCond %{REQUEST_FILENAME} !-f [NC] RewriteCond %{REQUEST_URI} ^/www/site/assets/files/ RewriteRule ^(.*)$ https://www.live.com/$1 [L] </IfModule>
    1 point
  43. CSS grid is „just“ new CSS technology which bootstrap will most certainly adopt in the future - just like the newer frontend frameworks are using flexbox now. It allows some pretty neat and clever layouting. CSS grid, just like all other CSS (flexbox, float, etc, etc ...) is the underlying technology the frameworks rely on. It is roughly a matter of „will readymade feature X / Y / Z of bootstrap easen the development of the project“ and „which browser versions do I need to support at reasonable effort“ to decide on using frontend frameworks. https://gridbyexample.com/examples/ https://css-tricks.com/snippets/css/complete-guide-grid/ cheers
    1 point
  44. I've been developing on Ubuntu and Debian for years now. It's simpler I don't do much bash scripting, but wanted to share this with you all. I know we are always trying to find the best workflow and always modifying how we do things to make our development more stream-lined. #!/bin/bash #---------------------------------------------- # I WROTE A SIMPLE SCRIPT TO: # - RSYNC A DUMP SQL FILE TO REMOTE SERVER # - THEN EXPORT A BACKUP SQL FILE # - THEN IMPORT THE DUMP SQL FILE # - THEN REMOVE THE DUMP SQL FILE #---------------------------------------------- # This work is licensed under a Creative Commons # Attribution-ShareAlike 3.0 Unported License; # see http://creativecommons.org/licenses/by-sa/3.0/ # for more information. #---------------------------------------------- ## CD INTO LOCAL WORKING DIRECTORY ## this is where I keep my local dump SQL files. ## the most recent one is always named dump.sql cd ~/www/website.dev/DB ## RSYNC LATEST DUMP.SQL FILE TO REMOTE SERVER rsync -avzP dump.sql _USER_@111.222.333.444:/home/_USER_/website.com/backups wait ## SSH INTO SERVER ssh _USER_@111.222.333.444 /bin/bash << EOF echo "**************************"; echo "** Connected to remote. **" echo "**************************"; echo ""; ## CD INTO REMOTE WORKING NON-PUBLIC DIRECTORY ## where the dump.sql file was rsynced to cd website.com/backups wait sleep 1 ## RUN MYSQLDUMP COMMAND ## save the SQL with date stamp mysqldump --host=localhost --user=root --password=_PASSWORD_ _DATABASE_ > `date +%Y-%m-%d`.sql; echo "***************************************"; echo "** `date +%Y-%m-%d`.SQL has been imported. **" echo "***************************************"; echo ""; wait sleep 1 ## IMPORT DUMP.SQL COMMAND mysql --host=localhost --user=root --password=_PASSWORD_ _DATABASE_ < dump.sql; echo "*********************************"; echo "** DUMP.SQL has been imported. **" echo "*********************************"; echo ""; wait sleep 1 ## REMOVE DUMP.SQL FILE rm dump.sql echo "********************************"; echo "** DUMP.SQL has been removed. **" echo "********************************"; exit EOF
    1 point
  45. wow. That's a powerful script. I am going to use it. I had been running poor man's backup with these lines as cron. 0 0 * * * mysqldump -uusername -ppassword databasename | gzip > /var/www/backups/sql/sql_$(date +\%m-\%d-\%Y).sql.gz 0 0 * * * cd /var/www/backups/files && zip -r files_$(date +\%m-\%d-\%Y).zip /var/www/docroot/site/assets/files 0 0 * * * find /var/www/backups/sql/ -mtime +7 -delete 0 0 * * * find /var/www/backups/files/ -mtime +7 -delete The first two back up the database and files folder at midnight. The last two remove backups older than a week.
    1 point
  46. I believe he meant what he has said: " Keep in mind that include=all will include a lot more than just unpublished pages." If it currently is working for you with include=all instead of include=hidden as suggested by @LostKobrakai, you only need to wait until the first page in your trash will match the selector too.
    1 point
  47. And one more: function n($singular, $plural, $count) { echo t(_n($singular, $plural, $count)); } This handles translations of singular/plural nouns, using the earlier introduced "t" helper. Of course strings have to be listed in "_strings.php" to be translatable in the admin. (I had to use "echo" instead of "return", probably because the template engine I'm using) Usage: n('minute', 'minutes', $page->count_of_something) Using "/*!" instead of "/**" will prevent addition of stars when hitting new lines in IDEs: /*! Intentionally commented out GENERAL _x('minute', 'General'); _x('minutes', 'General'); SEARCH _x('Search site', 'Search'); _x('No matches', 'Search'); *******************************************/
    1 point
×
×
  • Create New...