Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/11/2017 in all areas

  1. Hello fellow ProcessWarriors. https://supertiny.agency Just a minute ago I've launched a new instalment of the SuperTINY website. It's hard to believe the first version is almost 2 years old now. So here are some highlights on this one: Powered by v3.0.84, which is delightful; Https and way more SEO conscious; Added Portuguese language; No frontend framework, all hand-made, avoiding even the slideshow plugin I normally use and trimming down libraries to the minimum; New blog, where we'll regularly (hopefully) post not so technical stuff directed at the companies the hire people like us; Modular content in the portfolio and blog articles, using the repeater + type options approach I've mentioned in other threads; Other than that, a really simple installation, with AIOM+, MarkupSEO, MarkupSitemapXML, Imagick, and that's about it. In due time I'll re-release the old version in an archive so I can later pour myself a scotch and remember the old days.
    7 points
  2. Hi @dst81, Welcome to ProcessWire and the forums. I don't have a direct answer to your queries. I have found some topics though, that may be of interest to you. Deployment Docker Git Quote from ryan
    7 points
  3. This is no different from using a CMS like WordPress or Drupal given their architecture. I'd recommend looking at the approach of Roots.io. More specifically reading their Twelve-Factor WordPress App series and adapting it accordingly with your preferred set of tools: https://roots.io/twelve-factor-wordpress/ #6 addresses file uploads: https://roots.io/twelve-factor-06-processes/ Relevant module: Hope this helps!
    4 points
  4. Hi, Just an idea, you could create a new role, e.g. "cron-role" and assign to this role the permission "page-view". Then you add a new user, e.g. "cron-user" and assign to this new user the new role "cron-role". Now you add the role "cron-role" to the template you want to access the email field via "Template > Access". And in your bootstrapped script, you could write something like: <?php namespace ProcessWire; include_once ('/path/to/pw/index.php'); $cronuser = wire('users')->get('cron-user'); // get the user "cron-user" if($cronuser instanceof User) wire('users')->setCurrentUser($cronuser); // if found, set the current user to "cron-user" else die('bad user'); // not sure about the die() call but whatever its an example if($cronuser->hasRole("cron-role")) { // check if the role is assigned echo wire('pages')->get('/mysekretpage/')->sekretemailfield; // get the sekret field } else { echo 'access denied'; }
    2 points
  5. HAHA I knew it! Ask 50 people to test, and everything's ok, then someone comes along from some third world country to ruin the fun. Let me get an IF statement there somewhere. EDIT: JK there with the third world bit. Canada is cool.
    2 points
  6. Hear you hermano, I've always lived in informal economy. Don't have a cent for pension/retirement. PHP/ProcessWire in my country, serves me well for small to medium sized solutions which is basically what I do right now a quarter of my time, and have a deal with an agency that serves "PW products" to US/Canada which does most of my income. But in a local company (and with this I include big international business with offices in Mexico) it would be easier to get paid in any other language, PHP have this really bad rep. Also, the US tech scene defines a lot of this, cause most top talent in Mexico ends up in US and if not, a lot of companies have their dev teams outsourced here and haven't heard much about PHP technology being used, at least from the people I know that have migrated/freelance for US companies. Talking about overall tech skill, I've seen working with methodologies like Agile things get you on higher wages. My bet on that started with ProcessWire and until now, ups and downs but overall, great success! haha
    2 points
  7. Hi @horst, thank you so much sir! Now its working perfectly
    2 points
  8. I'm not entirely sure about this, but what about hooking after Pages::save rather than saveReady
    2 points
  9. As the readme say, you have to only upload/merge the SDKs folder which reside inside the Duplicator-SDKs folder. After downloading and opening the Duplicator-SDKs ZIP archive, you have this tree :
    2 points
  10. Thanks for the feedback @jacmaes! I just tested and uploaded the SDKs for Amazon and GoogleDrive. Its available for download at : https://github.com/flydev-fr/Duplicator-SDKs
    2 points
  11. @flydev The FTP issue that I was having a few versions back has been resolved with the recent updates. Thanks!
    2 points
  12. So true all what you've said @horst It is insane that we are sort of forced to adhere to google standards and not to common sense. However, I still find that content is king, so I do not push it too far optimizing things to google's liking. Instead, I tell my clients to write frequent news/blog posts. That works
    2 points
  13. Add Image URLs A module for ProcessWire CMS/CMF. Allows images/files to be added to Image/File fields by pasting URLs or using the API. Installation Install the Add Image URLs module. Configuration You can add MIME type > file extension mappings in the module config. These mappings are used when validating URLs to files that do not have file extensions. Usage A "Paste URLs" button will be added to all Image and File fields. Use the button to show a textarea where URLs may be pasted, one per line. Images/files are added when the page is saved. A Pagefiles::addFromUrl method is also added to the API to achieve the same result. The argument of this method is expected to be either: a URL: "https://domain.com/image.jpg" an array of URLs: ["https://domain.com/image1.jpg", "https://domain.com/image2.jpg"] Example: // Get unformatted value of File/Image field to be sure that it's an instance of Pagefiles $page->getUnformatted('file_field')->addFromUrl("https://domain.com/path-to-file.ext"); // No need to call $page->save() as it's already done in the method Should you have an issue using the method, please have a look at the "errors" log to check if something was wrong with your URL(s). WebP conversion The core InputfieldImage does not support images in WebP format. But if you have the WebP To Jpg module installed (v0.2.0 or newer) then any WebP images you add via Add Image URLs will be automatically converted to JPG format. https://github.com/Toutouwai/AddImageUrls https://modules.processwire.com/modules/add-image-urls/
    1 point
  14. Glad you do. Each content block there is a reusable "module" that can be repeated and sorted as it's fit. I may later on add more if future case-studies require it. I've also made a little JS thingy that detects if an element comes into view as you scroll, adding an `is-visible` class. Then that's used to trigger an appearance transition that varies according to the element type. Really simple but makes it look nice and polished.
    1 point
  15. I really like the project pages!
    1 point
  16. No, it's minimal design at its finest I like the site btw (webGL'd here :))
    1 point
  17. Goddady's PHP version: 5.4. Good news: Google Drive works flawlessly on my VPS. This is great, thanks @flydev !
    1 point
  18. This seemed to have done the trick, Tom! Thanks!
    1 point
  19. Don't forget about us non-webGL folks! Otherwise a blank page is definitely a sign of a very tiny agency
    1 point
  20. Also... https://www.nngroup.com/videos/jakobs-law-internet-ux/
    1 point
  21. Currently I'm lucky enough to be able to pick whatever technology I want in order to deliver the end results and that is why my goals regarding web development are not learning something specific but to focus on the tasks I'm "assigned to". As long as everybody is happy with my work, I'm happy too There is always room for improvement but that's what keeps me interested anyway...
    1 point
  22. That book is GOLD, its content made such an impression on me that I also instantly took that advice and never listen to music again when coding/designing/drawing. It's the closest I have to a Bible.
    1 point
  23. Defy convention at your own risk... http://www.telegraph.co.uk/cars/classic/austin-allegro-how-the-worst-car-of-all-time-came-to-be-made/
    1 point
  24. Maybe you want to consider other ways to get some funding. A quick idea is "croudfounding". I'm not suggesting using such a service because as far as I know they cost money, so maybe a dedicated PW forum thread under the topic Beer Garden will do. We send you money the cheapest way possible (bank transfer?) and you update the first post of the thread announcing who sent what. You can assign a random ID to each donator and that way only you and the donator can identify it (in order to keep this info private.)
    1 point
  25. No we use https://github.com/bobthecow/mustache.php (installed via composer) in PW, along with some custom Mustache loader and a custom autoloader for our controllers. Controllers are of different types like Template, Components, and Elements all extending WireData. So a mustache view can have its own controller class to handle the data but doesn't have to. The PW page template extends our Template controller class and is used to generate the contents of a page. We use some special mustache file for content items that acts like a switch for all the different component to know which partial to include, so we can simply say that this content item gonna use this or that mustache component. It's simply stacking components one after another. At the end, the whole strategy on this setup was that it works pretty much the same on the patternlab side (data as json) and on the PHP side (data as objects, methods, properties and arrrays), or even JS side (json). The patternlab prototype is found here https://opernhaus.ch/prototype/public/ (currently seems a little broken) but it's not at all the typical style guide or in the strict fashion of atomic design, it's used as a prototyping system to create the content items components and dummy pages in a well-defined structure. We build the different page types right in patternlab as much as needed. Each component can have it's own CSS and JS. (Additionally we also use terrificjs as a helper to make modular JS components).
    1 point
  26. I have read some good posts here that make a lot of sense to leave pw with it's api, php and jquery. It was then the main reason why so many moved from evo to processwire. The forum was vibrant and newbies came in every week for the no nonsense, making so much sense functionality of processwire. To me it is always the same story: people just can't leave their hands from something that is working perfectly good. It just has to be stuffed, cranked, pimped or changed in some way or another. Oh "it is evolution" I hear you say "we have to go with the latest stuff that is going around". We'll why not change the use of php for ruby on rails then, that would be something cool, right ? Not ! Please don't crank the core and leave the back end with jquery. Instead we should put our energy in processwire marketing it's - no nonsense, making so much sense functionality.
    1 point
  27. Hi dragan, unfortunately not. I need to do a complete rewrite of the module. As i need it for all my projects it is on top of my todolist for the next year. I'm still not sure if I should release it free or as a pro module... But I hope I can release something around march 2018...
    1 point
  28. would be awesome if core natively supported dependent selects in repeaters!
    1 point
  29. Here is the text, in a gitbook; hopefully nothing too controversial... https://outflux3.gitbooks.io/why-choose-processwire/content/ If anyone wants to edit, feel free; Also, i want to add some images – screenshots of admin, some gtmetrix scores of really fast sites, and icons here and there (that are in the original but didn't make it to the gitbook).
    1 point
  30. I will try to find the time this week @szabesz Also, if you got 5 minutes and you still have the 1&1 host account, could you test duplicator on it ? I just built a package successfully on 1&1
    1 point
  31. Yep, ignore it! Bunch of google ass. My sites load well fast enough, google says otherwise of course. But my target audience is usually in the UK where people have quickish internet.
    1 point
  32. Module updated to version 1.1.6, I fixed what we discussed here and included various small fix in ProcessDuplicator and GoogleDrive.
    1 point
  33. Please do! Not a bad idea either. I've usually relied on a few bullet points, so not sure how a "book" about this would look like, but I would love to see that
    1 point
  34. Thanks for your solution @Macrura. I found that the reason why dynamic function is not working. This is because the class of the select field are amended by the repeater so the jquery is not able to select the DOM correctly. What we should do is to fix it by targeting the correct DOM by changing the selector. I can get it to work with already saved repeater page but not the newly added one. I think a listener is needed to attach the on change event to newly added repeater item when we press Add New. EDIT: The newly added repeater item surprisingly fires the js again. It is working fine now. A small bug is that the old repeater items will fire more than once if there are more than one newly added item. Below is the amended JS file for InputfieldPage in quick EDIT: The bug is fixed. I have submited a pull request. Hope we could see this feature in the core soon!
    1 point
  35. I needed the same thing so i used Selectize inputfield single for the master select and then a select multiple on the dependent select, then i initialized the 2nd one using Selectize JS; the JS is not so hard, but you do need to have a custom select multiple that has a data-parent attribute on each option; those are filtered to match the selected option in the 'parent' select. Eventually this will make it into InputfieldSelectize somehow, but for now it's just done by adding JS, courtesy of AdminCustomFiles.. In the screen capture, you will see the left select, which may or may not have child pages; if it does, then the right one shows the children:
    1 point
  36. I went "crazy" quite a few times over all frontend churn as well, FOMO, etc. At the end of the day, use the best tool for the job. Right now, practically all of my needs are met with the following stack: ProcessWire UIkit3 (it's so good; but, but the horror of using UIkits classes in your HTML!) Some PW premium modules: ListerPro ProCache (it's become my build process tool; you can build UIkit3 with it perfectly fine; I'm dumping Node, Webpack, and whatever the "latest" way to do things is) FormBuilder Pulling in whatever packages I need via composer VueJS if needed (loading it via CDN, oh my god the horror!) Digital Ocean for hosting (manually configuring their Ubuntu LAMP 16.04 droplet... takes only a few minutes) If your clients want to use some crappy shared host, switch them to DigitalOcean; it's practically the same price. I develop all my sites on Windows (but technically it's Linux thanks to WSL). No VMs, no Docker (again, the horror of what happens if my server ends up being PHP v7.0.23 and my local machine is 7.0.22!). Simple and reliable 99.99999999999999% of the time. I deploy with a simple shell script (horror! not using Capistrano, Ansible, whatever the latest tool is). Sure, your site won't be able to handle all of earth's traffic if everyone were to visit your site at the same moment, but it'll be fine for 85.7% of the sites you most likely take on. I've built very complex sites with just those tools and I move extremely rapidly while keeping the site client-maintainable! Even if you became Mr. Expert on the latest frontend tools, it's going to change significantly by this time next year and the year after that. Perhaps sit on the sidelines for a bit. End rant.
    1 point
  37. @horst Google is Google... not %100 certain but strongly suspect G adds meta to jpgs it optimizes and so gives higher scores even if the original was fully optimized first. Even so, still regularly getting GSPI scores on mobile 75%+ and desktop 90%+ with PW, Procache etc and with careful coding so no errors on https://validator.w3.org/ . Can only do what I can do. I use the PW site results as comparisons to WordPress site performances to show my clients that PW is the way to go. For me, it's not about getting upset with G, it's more about proving how well PW performs
    1 point
  38. For now, a simple else for the !is_string() check in sleepValue() will get rid of it. It will mean, though, zeroes saved to DB for any blank values. if(!is_string($languageValue)) $sleepValue[$dataname] = number_format($languageValue, $precision, '.', ''); else $sleepValue[$dataname] = NULL;// or '' or 0
    1 point
  39. Small new feature that some of you may find useful. It is disabled by default so you will need to turn it on in the ProcessWire Info panel config settings section. Goto Page By ID which is available in the PW Info panel: It allows you to enter a page ID and click "View" or "Edit to be taken to the appropriate place. This was requested by a friend who is getting into PW development and I can see it being quite useful on sites where you reference key pages by ID in your template files and want quick access to view/edit them without browsing or typing a full URL, especially when you can't actually remember what pages they actually are
    1 point
  40. This is a minor change, but I am actually really excited by it The Console panel now supports running just the selected code. I often find myself using the Console panel to test variations of code to see which is faster / more efficient. The time and memory usage is displayed after each request, but it's often a bit of a pain to keep commenting out some of the code, testing it, and then uncommenting that and commenting out the other, etc. Now you can have multiple functional bits of code and just run one at a time. You can see in these examples that I am selecting different chunks of code to be run and I can clearly see which one uses more time and memory.
    1 point
  41. My personal opinion is that database layers like dibi tend to make some things a little easier while making corner cases complicated and taking clarity away by re-using existing keywords in a sometimes non-intuitive way. Then, they don't support application features like PW's multi-language fields or status flags, so one has to reign in expectations. And, often overlooked, PW already has a nice extension to the DB layer in the DatabaseQuery* classes. Perhaps that should be put into the spotlight a bit more (and added to the API docs)? A working example: <?php $q = new DatabaseQuerySelect(); $result = $q->select('templates.name') ->select('count(*) as inuse') ->from('pages') ->join('templates on templates.id = pages.templates_id') ->where('templates.name != :tplname') ->groupby('templates.name') ->bindValue(':tplname', 'admin') ->execute(); echo $q->getQuery() . PHP_EOL; foreach($result->fetchAll(\PDO::FETCH_ASSOC) as $row) { echo $row["name"] . " => " . $row["inuse"] . PHP_EOL; }
    1 point
  42. Thanks for sharing this! Btw., you could save a few characters where you check if the language in the loop is the default language by simply calling $language->isDefault(), and perhaps also eliminate doubled code. // Lines 85...89 $dataname = $language->isDefault() ? 'data' : 'data' . $language->id; if(!is_string($languageValue)) $sleepValue[$dataname] = number_format($languageValue, $precision, '.', '');
    1 point
  43. Shouldn't this be $value->$languageName in the assignment in the loop in sleepValue?
    1 point
  44. I think if the site works for you with no issues, the dev tag is completely irrelevant. I use the dev branch on a lot of sites that are live, ProcessWire has always been very stable, which is why it is my CMS of choice.
    1 point
  45. Or better yet, under API & Templates? Some sections have subsections like Modules/Plugins -> Module/Plugin Development It would be great to see: API & Templates - Bootstrap - Zurb Foundation - UIkit - Others
    1 point
  46. Hi, does @ryan or anyone else have anymore progress or opinion on this, as i think it is a somewhat polarising subject. I believe having lots of different stores would be bad for processwire (as im not very keen on using the https://processwireshop.pw/ store). It would be preferable to have a one stop shop for all modules including premium IMO.
    1 point
  47. This is a great idea (better than mine) if nothing in the module needs to work on the frontend, but one thing to note - if you change the autoload from true to template=admin you will need to do a Modules > Refresh to have the change take effect - I remember pulling some hairs in my early days of module development wondering why it wasn't working
    1 point
  48. Alternatively you can have your module autoload only in the PW admin. Then the hooks you add in init() won't apply to API code you use in a template file. public static function getModuleInfo() { return array( 'title' => 'My Module', 'version' => '1', 'summary' => "Module summary.", 'autoload' => "template=admin", ); }
    1 point
  49. Nobody? Ok, since the tags introduced to the image field is just a plain text field, there's no other way than to loop all pages that have images loop all images to grab all tags, parse them to array and merge them. This gets you there but doesn't scale well. (Would those tags be page relations it would make it very easy to output all tags. I'm more of a fan of using page fields for tagging, but there's no image field with page tags and I use different image system if there's a lot of images with tagging and galleries. My ImageManager is one of the tools to have a page as image and you can attach as many fields to the image template to get those things done.) I often thought about what would be the best ways, with words in text fields all over the site, to collect them and I think you have two possibilities. Raw SQL query, or the above loop all pages and make that a markup cached snippet, if the amount and time to generate the list takes long, that runs every other day or hour. Also have as many restrictions, for template or parent, as you can get to make the query a little more efficient. To show what would be the API way you already got a good start and intuition with 2 foreach. The following collects all tags and makes a unique array to create a link list. EDIT: You can use url segments or GET parameter for the links. Since PW urls doesn't allow special chars there's a workaround inside the code now. /** * collect all tags * ====================================== */ $alltags = array(); // container $use_urlsegments = false; // find all pages that have images with tags $parray = $pages->find("template=basic-page|gallery, images.tags!=''"); // loop pages found and collect tags from images foreach($parray as $p) { // find all images that have no empty tags, yeah you can // also use find on Pagefiles array! $images = $p->images->find("tags!=''"); // loop them and add tags to array foreach($images as $im) { $tags = $im->tags; // convert "," and "|" to space and create array using explode if(strpos($tags, ',') !== false) $tags = str_replace(',', ' ', $tags); if(strpos($tags, '|') !== false) $tags = str_replace('|', ' ', $tags); $tags = explode(' ', $tags); // convert tag value to a page name using beautifyer, ü => ue, ö => oe // since special chars are not allowed in PW urls foreach($tags as $tag) { $alltags[$sanitizer->pageName($tag, Sanitizer::translate)] = $tag; } } } /** * generate links with tags as urlsegment * ====================================== */ // make the array unique and create a tags nav from it // add tags to the url of the page to later read it and // render a list of pages echo "<ul>"; foreach(array_unique($alltags) as $key => $tag) { if($use_urlsegments) { echo "<li><a href='{$page->url}$key'>$tag</a></li>"; } else { echo "<li><a href='{$page->url}?tag=$tag'>$tag</a></li>"; } } echo "</ul>"; /** * find all pages with the supplied tag * ====================================== */ // enable url segments on the template if using url segments if($input->urlSegment1 || $input->get->tag){ if($input->urlSegment1) { $tagvalue = $input->urlSegment1; // get the original tag value text from the cached array $tagvalue = $alltags[$tagvalue]; } if($input->get->tag) { $tagvalue = $sanitizer->selectorValue($input->get->tag); } // find pages with images having the requested tag $pa = $pages->find("images.tags~='$tagvalue'"); if(count($pa)) { echo "<h2>Pages found</h2>"; echo "<ul>"; foreach($pa as $p) echo "<li><a href='$p->url'>$p->title</a></li>"; echo "</ul>"; } } What was the other question again? And of course also found in my ever growing gist archive https://gist.github.com/somatonic/5808897 I'm too lazy to brew a SQL that does the collecting part. But there's people more clever than me that can help.
    1 point
  50. I think that traditional version control with Git or the equivalent is great for template files, front-end development files and your own custom modules. When it comes to defining the templates and fields on the admin side, it's better to do this from the admin rather than migrating SQL queries or the like. So someone in your team should be the gatekeeper for these administration resources.
    1 point
×
×
  • Create New...