Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/20/2016 in all areas

  1. Thanks to a new "community" member I just started using git and deployer for my main project happygaia.com it's soo nice and clean and million times faster to publish a new feature, fix or whatever..I'm still in development or more bug fixing phase so I haven't actually deployed to live stage yet but local to staging works like a breeze so far I already separated processwire deploy logic from project stuff to start a dedicated processwire recipe which looks like this so far <?php /** * Deployer ProcessWire Recipe * Version 0.0.1 */ require_once __DIR__ . '/common.php'; // ProcessWire shared dirs set('shared_dirs', ['site/assets']); // ProcessWire shared files set('shared_files', ['site/config.php']); /** * Symlinking assets and config.php from Deployers shared folder * * @note You have to put those files manually into shared folder before first deploy * To run this task automatically, please add below line to your deploy.php file * <code>after('deploy:symlink', 'processwire:symlink');</code> */ task('processwire:symlink', function() { run("ln -s {{deploy_path}}/shared/assets {{release_path}}/site/assets"); run("ln -s {{deploy_path}}/shared/config.php {{release_path}}/site/config.php"); })->desc('symlinking assets and config.php from shared folder'); /** * Main task */ task('deploy', [ 'deploy:prepare', 'deploy:release', 'deploy:update_code', 'deploy:symlink', 'cleanup' ])->desc('Deploy your project'); after('deploy', 'success'); As you might note the processwire:symlink task won't run automatically, you either call it manually or like mentioned in the phpdoc you hook into the deploy task and put it e.g. after deploy:symlink Reason for processwire:symlink is that at least happygaias assets folder is quite huge and it's not part of my git repo so it's not being deployed each time instead it gets automatically symlinked from deployers shared folder Side note: Images (for now) only being updated from live page so no need to upload in deployment process.. Nearly forgot to mention that it's not only about assets folder but site/config.php, too. So config.php is not part of my git repo so I place it in deployers shared folder once and it get's symlinked (like with assets) The plan right now is to "just" keep databse of live site intact (more or less) after I switch live to new version it'll update because of new pw version and module versions of course and I have to tweak some minor changes, manually e.g. exporting/importing templates but that's fine for now I might look into AutoExportTemplatesAndFields module soon as it sounds really nice I still have to figure some deployer things out, but as mentioned it seems to work fine for now Okido that's all for now, questions, comments, feedback everything is welcome and appreciated Uh it would be nice to get more ideas and testing whatever for the recipe so I could post it to the deployer repo soon ;-)
    5 points
  2. @horst How about this? $skipMinify = $config->debug || $user->isSuperuser();
    5 points
  3. Buchhandlung Scheuermann Today we have relaunched the site of a local bookstore, Buchhandlung Scheuermann. The site is based upon PW 2.7 and twitters bootstrap 3. It is fully customizable for the customer because we made use of: PageTables ALIF Croppable Images And the admin's sweeties are: Admin Custom Files Pageimage Manipulator 2 Pia - Pageimage Assistant ProCache Spex Wire Mail SMTP
    5 points
  4. OMG. I shouldn't post in the morning before the first cup of coffee.
    4 points
  5. you'd need to make some function to output the individual assets, for example when an admin is logged in.. (very basic example) if($user->isLoggedin) { listAssets($stylesheets); } else { echo AllInOneMinify::CSS($stylesheets)); } that's how i do it..
    4 points
  6. With my last attempt to croppable images I also had tried out some configurable settings. One of them was the background color for the thumbs, sitewide in the images module! No overhead, fully visual control for the admin, etc. Another point is, that the checkerbox (only) is much to hard in contrast. I had used a way more soft one. PNG with alpha transparency too. It should not dominate, it only should be a bit visible through the transparent parts. Using black white / medium gray is not very useful. I also don't want to switch around when I come to an images side. I want get my images presented in a less distracted way, that lets me focus on the relevant things just from the start. Now, as we are at it, there are some other parts that I really would see to be solved too: These are mainly the thumbs displayed in different sizes in regard of orientation and aspect ratio. Often the simplest solutions are the best. I suggest a solution like with css property CONTAIN in a given box (fe. 280x280). Following is a screenshot. Please tell me (or tell yourself) what information you get from the thumb overview. If you have no clue what may be of interest when screening 100 images, think about: pixel dimensions or min height / min width image format? (png jpg gif) Another question: Which one distracts you more from the images? first or second? --------------------------------------------------------------------------------------------- Here is another comparision. Which one is more distracting and which one guides you visually faster to the relevant information? This one is without any question Keep in mind that we are talking about the last 10% to become nearly perfect ( for all cases ). <= is this possible? for all cases? I'm not blaming anything, I'm fighting for the last 10%.
    3 points
  7. Thanks @szabesz , link corrected
    3 points
  8. Sounds great, but one technical note: instead of exit or die, most of the time you should be using $this->halt(). This way ProcessWire can still shutdown as expected.
    3 points
  9. As another variant it can be a slider the same as zoom slider. I dont think that it would make redundant cognitive load beacouse ther look almost the same. Recently I often run into such a problem. With Matrix filed it is much easier to implement lending builder etc. and there users use a lot of png icons. Also I made small research how other cms deals with it. CraftCms It does not have any switchers or so, but checkerboard background of png images is a little bit darker. OctoberCms Light gray background and blue hover effect Concrete5 No background, but hover effect ModX No background, but light blue hover effect Opencart, Cockpit, Joomla No background and no hover.
    3 points
  10. I assume you are speaking of the default admin thumb? If yes, there is no way I know about to avoid this with image fields. It is a requirement to display each image in the admin. But if you don't need the thumbnails, just a list with filenames, you can use a file field instead of an image field. The image field is based upon file field, it only has additonal methods and properties related to images.
    3 points
  11. Hi guys so currently am writing a detailed tutorial about creating Modules, I have never created a module because i don't know all the classes and interfaces required, so this is like a detailed research for me, this is how i learn things by writing articles. However I might make some mistakes so i decided to make it on Google Docs to get comments and feedback, before posting on my website and Processwire tutorial site, this is going to be one heck of a detailed tutorial. Here is the link I will be updating it https://docs.google.com/document/d/1VA_WK-5qbnq3Ux_EOW3p92IcjbAcVZJ0aewIiFxmv2Q/edit# However I wanted to get a clear picture of the following Process Class and ConfigurableModule i noticed some modules require it and some don't My interpretation is that Modules with admin setting pages uses ConfigurableModule and Process are modules who require access to $this->pages and that sort Thanks all
    2 points
  12. There is no need for processwire:symlink task. Just use the built in deploy:shared task instead: <?php /** * Deployer ProcessWire Recipe * Version 0.0.1 */ require_once __DIR__ . '/common.php'; // ProcessWire shared dirs set('shared_dirs', ['site/assets']); // ProcessWire shared files set('shared_files', ['site/config.php']); /** * Main task */ task('deploy', [ 'deploy:prepare', 'deploy:release', 'deploy:update_code', 'deploy:shared', 'deploy:symlink', 'cleanup' ])->desc('Deploy your project'); after('deploy', 'success'); And not sure config file has to be shared. Of course it is bad practice to store you db credentials in the VCS, but this file is quite essential for the PW site.
    2 points
  13. 2 points
  14. Sometime after 3.0.21, PW had modifications that has messed up how PW's "Markup" field renders descriptions with HTML in them, which also affects MenuBuilder. I've created an issue on the PW Github: https://github.com/ryancramerdesign/ProcessWire/issues/1932
    2 points
  15. I'm not fond of the hover solution, because you would need to hover all items when you are searching for an image. Anyone steroids?
    2 points
  16. The pull request is up now, bypassing my software and working on the GitHub Site directly. Let's see how that worked. I think the quality of the German files is very good already (thank you guys) - so I want to address only a few things that I stumbled upon: I wonder what you want to do with the "Denglish". I believe that you are right not to translate everything. For Devs, working with the backend, it is often clearer to leave certain English words (like html tags, "hover", as they are). I well remember the over-translated Dreamweaver from my past. But they could be set in quotes (or single quotes)? Same as examples for input and results - like 'null', '0', '1'? Have you set up some catalogue already somewhere about certain words and translation you prefer to use, in case there are more possibilities? Like choosing between "Anmelden" and "Login" or "Log-in" (Duden recommendation) which basically means the same and are all ok to use in Germany? (It would be a consistent language within the application - especially in a multi-translators environment.) If that list does not exist, I could try to build a small one, when working further with the files - the list could be part of the repo.
    2 points
  17. @pwFoo Nope. It's a function of the TemplateFile class and only works in files included by its render function.
    2 points
  18. Did a quick intercoolerJS test... I love it First test: Main layout / template <!doctype html> <html lang="de"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script src="https://code.jquery.com/jquery-1.10.2.min.js"></script> <script src="https://intercoolerreleases-leaddynocom.netdna-ssl.com/intercooler-0.9.7.min.js"></script> <title>IntercoolerJS Processwire</title> </head> <body ic-get-from="<?=$page->url?>" ic-trigger-on="load" ic-push-url=true></body><!-- async intercoolerjs call --> </html> A simple autoload module output this main template (PW class TemplateFile is used) above and stops PW execution with php "exit". After initial page load you see an empty page body, but after page loaded the intercoolerjs ajax call will be triggered and load the current page ("$page->url") content. The test was successful and at the moment I write a small module to handle initial (sync) page load (add layout / base template) -> hookAfter Page::render ajax updates with history support -> PW template file just return the current page content sub template support (PW TemplateFile) add / handle css / js (maybe async add / replace css / js with jquery...)
    2 points
  19. Nette Forms: I have a very beta module of it. It doesn't have a UI to build forms and I don't plan to add such so it may not suit for everyone. I can send a copy to check, though as I wrote it's not quite ready for production.
    2 points
  20. This is a beta release, so some extra caution is recommended. So far the module has been successfully tested on at least ProcessWire 2.7.2 and 3.0.18, but at least in theory it should work for 2.4/2.5 versions of ProcessWire too. GitHub repo: https://github.com/teppokoivula/ProcessLinkChecker (see README.md for more techy details, settings etc.) What you see is ... This is a module that adds back-end tools for tracking down broken links and unnecessary redirects. That's pretty much all there is to these views right now; I'm still contemplating whether it should also provide a link text section (for SEO purposes etc.) and/or other features. The magic behind the scenes The admin tool (Process module) is about half of Link Checker; the other half is a PHP class called Link Crawler. This is a tool for collecting links from a ProcessWire site, analysing them and storing the outcome to custom database tables. Link Crawler is intended to be triggered via a cron task, but there's also a GUI tool for running the checker. This is a slow process and can result in issues, but for smaller sites and debugging purposes the GUI method works just fine. Just be patient; the data will be there once you wait long enough Now what? For the time being I'd appreciate any comments about the way this is heading and/or whether it's useful to you at all. What would you add to make it more useful for your own use cases? I'm going to continue working on this for sure (it's been a really fun project), but wouldn't mind being pushed to the correct direction early on. This module is already in active use on two relatively big sites I manage. Lately I haven't had any issues with the module, but please consider this a beta release nevertheless; it hasn't been widely tested, and that alone is a reason to avoid calling it "stable" quite yet. Screenshots Dashboard: List of broken links: List of redirects: Check now tool/tab:
    1 point
  21. Hi everyone I´m creating an AdminTheme based on Semantic UI framework. Here is the beta version. I 'm fixing bugs. Github here Changelog: 0.0.1 --- Fixed background color / image.
    1 point
  22. Hello, in one of my current projects, we have a test and production stage with their own ProcessWire installations, and we regularly want to migrate template/field configuration to the next stage without migrating content as well. ProcessWire supports this via the import/export functionality in the admin GUI. However we (and some others) would like to do this as part of an automated process. There seem to have been some discussion on this topic and two existing modules that get pretty near our requirements: https://github.com/mindplay-dk/SystemMigrations/blob/master/SystemMigrations.module https://github.com/LostKobrakai/Migrations However, they try to solve more then we need and for mindplay-dk's module, development seems to have discontinued. At that point I decided to build a more simple module with reduced scope that basically just makes ProcessWire's import/export automation-ready. Thanks in advance for trying this out and any feedback! About this Module CAUTION: This module is incompatible with repeater fields and ProFields. The module enables you to transfer template and field configuration from one processwire installation to another in an automated way. Changes to templates or fields are exported to the file system immediately (so they can be added to source control together with changes in the template files) The import script is designed to run from the command line (so it can be invoked from your build/deployment tool). On invocation in import mode, a DB backup is created template/field changes from the persist directory are imported into the DB In restore mode, the import script can restore any of the DB backups previously saved How to Use Make sure the module is installed in the source and destination ProcessWire environments. After installation of the module, you should check if the module's default persistDirectory configuration setting fits your requirements. The module will automatically export all fields, fieldgroups, and templates to JSON files in the directory specified by that setting. Note that the same setting is used by the import script as well, so if you change it, make sure you change it in all affected ProcessWire environments. The JSON files can be transferred to the destination ProcessWire environment. Running the import script from the command line will import template and field data in the destination ProcessWire environment. Manual Installation Caution: Beta software - do not use in a production environment without prior testing and regular back-ups. Caution: This module is incompatible with repeater fields and ProFields. In case automatic installation does not work, get the code at https://github.com/jaromic/pw-autoexport-tf/ and follow the instructions in README.md for manual installation. Manual Uninstall Delete the following files and directories from your module directory: AutoExportTemplatesAndFields/ AutoExportTemplatesAndFields.module Download Install from the module directory, clone the repository via GitHub, or download ZIP.
    1 point
  23. Hi Gazley, Sorry I missed your post. Thanks for the suggestion, I'll add this to the next version so you are safe when you upgrade the module! Edit: Just saw that your post was pretty new haha Cheers
    1 point
  24. Here are a few background links on SmartyPants, if that will be of any help: https://daringfireball.net/projects/smartypants/ https://michelf.ca/projects/php-smartypants/ https://michelf.ca/projects/php-smartypants/typographer/
    1 point
  25. Hi @Wanze, Many thanks for providing this fantastic module! I have just installed the module but immediately hit a problem that is not of your making in any way, but a code change in TemplateEngineTwig.module would make my life very much easier and possibly other future users of the module! Basically, I already use Twig for some TemplateFile rendering (Field level templates) using my own custom module. I've decided to use your Controller/View approach for my regular ProcessWire templates but when trying to install your module, I get the following error: "Cannot redeclare class Twig_Autoloader". Obviously, this is because my module has already loaded this class and TemplateEngineTwig.module is trying to do the same thing again. The following code change at the top of TemplateEngineTwig.module will not hurt anyone else, but will help me enormously. If you could modify the module to make this check, I'd really appreciate it! if (!class_exists('Twig_Autoloader')) { require_once(__DIR__ . '/vendor/twig/twig/lib/Twig/Autoloader.php'); } Many thanks indeed
    1 point
  26. Something along the way public function init(){ if($this->config->ajax && $this->input->InputfieldMyAjaxBomb){ // handle your ajax request header('Content-Type: application/json'); echo "{'yo':'yo'}"; exit; } } .. in your Inputfield init(). Then you can make a post or get AJAX request to any backend or public url the current url containing the key InputfieldMyAjaxBomb=1. Edit: Originally I didn't really mean that there's "no need". Well, of course a hidden admin ProcessPage bundled with your module is also good and honestly maybe even the more correct way. But It's easy to implement and test things out too.
    1 point
  27. @Soma Hi, It would be cool if you could add this module the Directory too.
    1 point
  28. @LostKobrakai Actually it's some specific rights(?) problem with the git tool I use (git-tower.com). Submission failed somehow - Nothing to discuss here in public I think. I just need to look further to my setup and maybe contact the software-developers. But thanks for helping, anyway.
    1 point
  29. I've just added a Snippet about reversing the functionality of the build-in (or custom) MigrationTypes. https://github.com/LostKobrakai/MigrationSnippets/blob/master/Reverse_Template_Migration_Type.php
    1 point
  30. @flydev In "Download the zip file at Github or clone directly the repo with git clone and skip the step 2." the link points to your Bootstrap profile. You might want to fix this. Thanks for this profile anyway, I'm gonna take a look at it in the following days.
    1 point
  31. Looking forward to it, thanks in advance!
    1 point
  32. My conditional is: $skipMinify = $config->debug || $user->isSuperuser() ? true : false;
    1 point
  33. Unfortunately there's not enough docs at the moment. Isn't that why you are writing docs? . Joking aside... 3 Tips Due to the paucity in documentation most (all?) of us learned by looking at other modules. Simpler core modules, custom modules such as Batcher, Trashman, etc. The module Blog creates fields on the fly during installation. Have a look at the code here. Also have a look at ProcessBlog phpMyAdmin: have a look at the table fields. You will see a list of all the installed fields. Look at the column 'data'. All field settings are stored in there as JSON as key=>value pairs. Why is this important you ask? All (?) the keys in the strings correspond to the field properties that can be set...e.g. $field->description, $field->derefAsPage, etc. Also have a look at the column 'label'. The trick here is to open a field for editing and add and remove settings and save while keeping an eye of the field's 'data' column to observe changes. In respect of templates, same trick can be used on the table 'templates' http://kongondo.github.io/ProcessWireAPIGen/dev/class-Field.html
    1 point
  34. Visible bg color control is something that over 99% (my estimate) of image fields do not require. It would be poor ui design to have it always visible. That is very edge case scenario you are solving (white transparent images) so it shouldn't cause any overhead to other use cases (or even code) that image fields are used for.
    1 point
  35. @benbyf: I have used to look into the fields exporter to find out some things and found it very quick and nice method. I created a few fields with all settings I'm interested in, select it in the exporter and looked to the json data: So, this alone is not enough, but after seeing a compact list of possible properties I can pickup one of interest and run a search for that in the inputfield class in my editor. <kidding>Don't wail about uncomplete docs or missing tuts. Instead search, find and learn, - we are waiting for you to contribute new tuts!</kidding>
    1 point
  36. The easiest way to find those properties is to enable debug mode and hovering over the "collapse" icon of those options, when editing the field. This will often show you how those properties are named. Also the php docblocks of those modules are geting better and better in stateing those as well. Use them just like that: $this->min = 1.
    1 point
  37. $event->object->filename should work I guess.
    1 point
  38. Thanks, v034 should fix this. The default admin theme is a bit of a stepbrother because I don't use it so such bugs may come up more frequently there. I also got rid of a z-index renumbering issue coming from sass but this doesn't mean there will be no more z-index issues There are some other CSS fixes regarding the layout for the default theme, hopefully I haven't broke anyting. The loader animation should be vertically centered too.
    1 point
  39. @SoccerGuy3, I'm not sure you've seen this, in the Tab Settings, right under 'Pages selectable in menu'? There's also a note on line #486 to the same effect. The normal practice is not to directly edit modules. Your 150 will get overwritten next time you upgrade Menu Builder and all will not be well . What you want to do is to use Page Auto Complete or Asm Select and add limit=150 to the setting above ('Pages selectable in menu')
    1 point
  40. @Juergen To setup a cronjob is really easy, but you have to understand some basics first. The cronjob past has nothing to do with ProcessWire. It is a separate program running on your server which is able to run commands at a certain time. It is either configured in your hosting admin panel (easiest, ask your hosting provider) or you can set-up it yourself through the command line. You can follow this example if you're running a Linux based server. You need to understand that you can execute a PHP file from the command line. Teppo has provided us with such a script that will activate the link checker. The file is "/ProcessLinkChecker/Init.php". This is the one the cronjob needs to run. If you are unsure what the correct path is you can ask your hosting provider or login into the shell and navigate to the "ProcessLinkChecker" folder and type "pwd". That will give you the current path. It will be something like: /srv/username/apps/appname/public/site/modules/ProcessLinkChecker/ Combine the path with your new knowlegde from the tutorial and you can set it up. p.s. If you are on Windows you need to create a "Task" in "Windows Task Scheduler". p.s. 2 You don't have to wait to test if the link is working since you can test the script by running: /usr/bin/php /path/to/site/modules/ProcessLinkChecker/Init.php >/dev/null 2>&1 p.s. 3 this whole timing stuff can be pretty confusing so use a tool like crontab.guru. p.s. 4 after proofreading this post now it seems pretty hard , but believe me after a few times you can set it up in a few minutes.
    1 point
  41. It is a caching problem. You have copied cache values (directory pathes) from one computer (your online) to another computer (your local), and file_last_modified timestamps too. But this stored ones from your online mostly will not match to your locals. So you need to clear caches and have to refresh the modules lists. (Maybe better 2 times than only once ) After all the caches are refreshed and the filecompiler builds all fitting to your local computer, all settings in DB should work again. The second thing in your case is the SessionHandlerDB. SessionHandlerDB is an alternative handler fro session management. Now, after you have disabled it the hard way, PW switched to the default session management via files, located under site/assets/sessions/. If you like, you also can switch back to SessionHandlerDB after all other caches (also minor one!) are working perfect again. To switch back, please go to modules and install it via the interface, as you have done when using the first time. (Don't modify the modules table!! this only works the other way round!) ------ --- ------ To avoid those caching issues, you could use the SiteExporterModule, but this would not give you an exact copy of your online site. So, in your case you have done most things right. Only thing what you may try next time could be: make a copy of all site/... files to your local PC modify the site/config.php to point to your local DB get a mysql dump from your online DB modify the mysql dump: remove all entries of the tables "caches, sessions", but only the data value entries, not the table definitions! import the modified mysql dump into your local DB login into admin, go to modules and hit the refresh button one or two times
    1 point
  42. Try this: foreach($albums as $album){ // if there's no thumbnail no need to do anything if(!$album->thumbnail) continue; // save srcset tag to a variable $srcset = $album->thumbnail->srcset('thumbnail', 'lazyload my-class inline-block', array('quality' => 80)); $out .="<a href='{$album->url}' class='item {$album->thumbnail->tags} {$album->thumbnail->orientation}'>"; if($album->images){ $out .="<img $srcset alt='{$album->thumbnail->Alt}'>"; } $out .="<div class='item-info'><h3>{$album->title}</h3><h4>{$album->thumbnail->tags}</h4></div>"; $out .="</a>"; } It's written in browser so double check the syntax.
    1 point
  43. Plus you check for $album->images and then use $album->thumbnail, so one if them may be invalid. You may also check for $album->images->count() if there can be more than one image in the field (and the field name may be "thumbnail").
    1 point
  44. What variables are you missing? The function seems OK to me. Do you have a return $out at the end? Or do you have an error when running this?
    1 point
  45. Hi, I've never experienced this, but the forum seems to be "full of" the issue, so you might find the answer with this search: https://www.google.hu/?client=safari#q=site:processwire.com%2Ftalk+"appears+to+be+forged" Edit: also, this message should be dealt with, I suppose: "Field: Fieldtype 'FieldtypeAdminCustomPagesSelect' does not exist"
    1 point
  46. we should add caddy example file for processwire I think
    1 point
  47. I fixed the image upload issue and think I shouldn't post it here... I take a closer look... Nothing in the caddy error log, access.log shows me the 500 error code. Look into the PW error log... Error: Call to undefined function ProcessWire\mb_strtolower() (line 378 of /home/caddy/public_html/wire/core/WireUpload.php) Then ... no, it was more like Solution (CentOS): yum install php-mbstring Upload works fine. It's NOT a PW or Caddy bug! Just a missing PHP package Done some more testing (add / edit fields, edit content, upload images, insert images, ... works fine But frontend edit doesn't work. Nothing happend during click the "Save" button. Also no log entry (access, error or PW).
    1 point
  48. children() can also have a selector. In fact it's using a find behind the scenes.
    1 point
×
×
  • Create New...