Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/06/2016 in all areas

  1. <?php if($tab_size == 'too big') { use \CSS; $to_change->it(); } else { $it_looks = 'stupid'; } ?> When pasting code indented with tabs into the forum the indents are too large. It's simple to fix with a bit of CSS: pre { -moz-tab-size: 4; tab-size: 4; } Could someone with the necessary access add this? The big indent bugs me so much I usually find/replace the tabs with spaces when posting code. And as is universally agreed by all quality coders: tabs are much better than spaces
    5 points
  2. I couldn't help myself to release a new version that contains a cool feature: preview some changes real-time on AOS module config page. Only checkboxes are involved, so checking items like Sticky header or Autohide sidebar will be previewed instantly. Items that require Js won't work but even with this limitation it's quite useful. Users can see the effect instantly and I can also see if something's not right Note that the module needs to be saved to apply changes. This was quite easy to add because many features are controlled by classes added to the html tag, and these classnames are part of the ID of the checkboxes.
    5 points
  3. When you need a simple count is it preferred to use: count("selector") versus $pages->find("selector")->count() since count("selector") method is way faster.
    4 points
  4. Updated to v0.0.2. This version simplifies the module somewhat and you no longer need to select templates in the config.
    4 points
  5. Thanks, all done in v0996: Edit: please check if the hover action buttons are working in ListerPro if you happen to have it.
    3 points
  6. Looks like you might be defining $config->imageSizerOptions in your config file, but missing the "sharpening" option. Add that and you should be fine.
    3 points
  7. I tried it on both Firefox and Chrome and got the same result. But then I discovered it's caused by the LastPass extension that I have installed on both. If I log out of LastPass it works normally, so problem solved. Thanks.
    2 points
  8. That shouldn't happen - I wonder if it's a browser autofill thing perhaps?
    2 points
  9. I just made it compatible with both PW 2.5+ and 3+ http://modules.processwire.com/modules/fieldtype-yaml/ https://github.com/owzim/pw-fieldtype-yaml
    2 points
  10. It is better to deploy all the shared resources after the initial deploy with deployer script, as all the folders needed are already created then. I wrote a couple of tasks right there in deployer file to upload the resources. Something like: /** * Upload ProcessWire assets folder */ task('upload_assets', function () { upload('site/assets', '{{deploy_path}}/shared/site/assets'); }); You actually only have to run it once via cli when in production, but could be handy while developing or on a semi-static site. In the latter case you can even include this task in the main deploy task. P.S. I actually decided to include config.php and the wire folder to my version control as @Wanze once suggested. It makes it much easier to deploy (and a proper composer way probably will not come any time soon). So my configuration now is more defined comparing to these vague thought described here - I put everything but the assets folder and the compiled static assets (I use gulp workflow, so only frontend sources are version controlled) in git. As I (for now) always deploy from the local machine. I compile frontend assets locally as a part of deployment process and upload them to the server in a task similar to one presented above. I even managed to make tasks for database upgrade. But it is not really useful as I can't simply upgrade db on production this way. I hope to master @LostKobrakai's Migrations one of these days and include them to the workflow.
    2 points
  11. Thanks guys - this is really motivating that the module is useful to you! I want to say thanks to my parents, my workplace allowing me to work on AOS in my freetime (even though its not that evident to them :)), the coffee machines I get in touch during the day and all of you here kicking this module forwards As the module grew the combination of features got so complicated that I can't test everything. My theme of choice is the Reno theme so Default theme fans are somewhat put in the shade but I try to support that too where it doesn't involve unnecessary complications. @Robin S Thanks, I was lazy to test in other browsers than Chrome thoroughly. Now the jumplinks and the outline it should work in FF, IE11 too. @adrian Most of your bug reports are fixed in v0994, except the mini scrollbar one you mentioned (I'll skip this for a while, no idea how to solve). The two-column layout was present in Reno too but only on screen width greater than 1900px. Now I removed the columns entirely, partly because it was causing issues in Chrome and partly because the new config jumplinks makes it easier to find them, even the page is much taller this way. I think it's better this way, textareas are easier to edit and there's no jump when a fieldgroup goes to the next column when its height is changing. The Reno theme issues are interesting. There is a few of them that you can improve with AOS like the empty sidebar (NavItems) or change the logo (using custom Js/CSS), others would require deeper modifications that AOS can't solve I think. And some of them are cosmetic which AOS could fix, I'll check them if they start to frustrate me as well
    2 points
  12. True I've looked at almost "all of them" also tried out a lot, but the most (css) beginner friendly vs feature rich is http://materializecss.com/ Materialize CSS can be actually used by only the means of vanilla css overwriting its rules if one does not want to fine tune it by using Sass at all. The same is true for Chrome, probably others too. But we should not forget that simulation is never the/a real thing.
    2 points
  13. Thanks, Adrian! I pulled the values out of the config.php in wire, and used those, with some tweaks, and the errors went away! I'm so delighted with ProcessWire I could just dance a jig. Peter
    2 points
  14. a css framework like bootstrap or foundation can make your life easier with menu-toggle and responsiveness. As far as testing across devices is concerned, safari has built-in support for viewing your site across devices.
    2 points
  15. ConnectPageFields Allows the connecting of two related Page fields so that changing one updates the other. Purpose of module An example: suppose your website is about movies. You have a template "movie" with Page field "actors". For each movie you add the actors that appear in the movie. All good, but what if you want to find results like... the 10 actors who have appeared in the most movies actors who haven't appeared in any movies since 1990 You cannot retrieve these pages with a single efficient $pages->find() query, and must load a large PageArray into memory in order to iterate or filter it. For the sake of making these types of queries more efficient you could structure your templates/fields so that movies are added to actors instead, but this may be a less comfortable workflow and can run into equivalent problems (e.g. "find the 10 movies with the largest cast"). The solution is to have a two-way relationship so that movie pages have an "actors" Page field and actor pages have a "movies" Page field. This module will keep these two Page fields in sync so that adding "Ryan Gosling" to "Drive" automatically adds "Drive" to "Ryan Gosling". Also, you can select the same Page field in both Page field A and Page field B. For example, create a "Related" Page field for related pages. Choose "Related" for both fields in a pair in the module config. Now when you add "Orange buffoon" to Related for "Donald Trump", "Donald Trump" is automatically added to Related for "Orange buffoon". Usage Install the ConnectPageFields module. If you haven't already done so, create the two Page fields you want to connect and add them to templates. In the module config select the two Page fields in a "Connected field pair" row as Page field A and Page field B. You can add rows as needed using the "Add another row" button. Troubleshooting Make sure you have set the "Selectable Pages" settings for each Page field correctly: The settings for Page field A should allow pages using the template(s) that Page field B has been added to. The settings for Page field B should allow pages using the template(s) that Page field A has been added to. http://modules.processwire.com/modules/connect-page-fields/ https://github.com/Toutouwai/ConnectPageFields Module config: Demo showing how changing one Page field updates the other:
    1 point
  16. Dynamic Selects Released 27 July 2016 Dynamic Selects is a commercial module that enables the creation of dynamically related/dependent ajax-driven chained dropdown lists (aka cascading selects) for display and storage of multiple types of data. The module can be used both in the front- (display only) and backend (display and storage of data). Setting up Dynamic Selects is very easy. With minimal effort, site developers can set up simple or complex chained selects. By making a selection in a trigger dropdown, via ajax, values are fetched and dynamically populate options in the dependent select. In turn, making a selection in the now populated select triggers the same action further down in a dependent select. The module only uses/stores ID references to selected options in the selects meaning the most current/up-to-date data will always be displayed in the selects. Currently only ProcessWire managed data are supported. If there is enough demand, we may incorporate external data sources (typically JSON). The module consists of 4 modules ProcessDynamicSelects MarkupDynamicSelects FieldtypeDynamicSelects InputfieldDynamicSelects Video Demo: https://youtu.be/wkhx8xQ5ue4 Documentation: http://dynamicselects.kongondo.com/ Shop: https://processwireshop.pw/plugins/dynamic-selects/ Requires: ProcessWire 2.5 or newer and jQuery if using the frontend module (MarkupDynamicSelects) Features Easily create powerful ajax-driven cascading/chained selects/dropdowns Unlimited number of select dropdowns per field Data-mapping made easy thanks to multiple possible combinations of data relationships, triggers and sources Mutlipe data relationships to chose from ID-based data referencing ensures your data values always stay fresh Remote and local caching to speed up data access and reduce ajax-requests to server User-friendly, intuitive and easy to set up IMPORTANT Before using this module in the frontend, you will need to thoroughly read the security section in the documentation.
    1 point
  17. 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 ;-)
    1 point
  18. This is a very beta version of the separate functions I use to generate srcset/bgset markups. There's some similar functions floating around in the forum but this one is a bit different because you can set "named image sets" which you can use easily site-wide. It's definitely work-in-progress so use it at your own risk. MarkupSrcSet Generate srcset and bgset markup for lazysizes. Features generate srcset/bgset markup for lazysizes set image sizes in JSON array add required JavaScripts automatically (optional) fallback to smallest image size if JavaScript is not available Usage Image sets JSON (in module settings): { "hero": [ [640, 210], [1080, null], [1920, null] ], "featured-image": [ [360, 240], 1.333, 2.667 ], "gallery-thumb": [ [240, 120], [480, 300], [800, 576] ] } Image methods $image->srcset(): <img <?php echo $page->featured_image->srcset('featured-image'); ?>> $image->bgset(): <div <?php echo $page->images->first()->bgset('hero'); ?>>Lorem ipsum</div> https://github.com/rolandtoth/MarkupSrcSet
    1 point
  19. @Robin S - I forgot to report those notices - they do go away if you save the AoS settings page, but should still be fixed. My code change makes the "Hide template edit action" functionality work in ListerPro.
    1 point
  20. Thanks for adding the Lister hover action buttons - something I've been wanting for a while. It's working for me in Lister Pro, but I do see some error notices too - not sure if this is what @adrian is referring to above. PHP Notice: Undefined variable: listerType in ...\modules\AdminOnSteroids\AdminOnSteroids.module:759 PHP Notice: Undefined index: in ...\modules\AdminOnSteroids\AdminOnSteroids.module:759 PHP Notice: Undefined variable: listerType in ...\modules\AdminOnSteroids\AdminOnSteroids.module:761 Would it be possible to activate the hover buttons for Lister Pro independently from the other Lister tweaks? The reason being that I'd rather set the columns for the Find and Users lister in Lister Pro and the AOS Lister columns feature interferes with this. Edit: what I mean is could there be checkboxes to activate the AOS Lister columns feature rather than the columns feature being active by default when "ListerTweaks" is checked? Not an AOS problem as it happens when the action buttons show on click too, but the columns jump around as the hovered row changes:
    1 point
  21. They are also documented here: https://processwire.com/api/selectors/#or-groups
    1 point
  22. Not the module, but PW. Just hook into form processing / user registration and generate the needed value before the user object will be saved. The module methods are hookable too.
    1 point
  23. You can use selectors inside children(), eg. $entries = $page->children("limit=10, sort=-sort"); $pagination = $entries->renderPager(); echo $pagination;
    1 point
  24. This looks quite cool although I personally only ever seem to use bourbon/neat for grid and a few helper things. Never used a full blown framework as I just write the sass as I go along. One thing I like about bourbon/neat is that you don't end up with stuff like this: // materialize <div class="col s7 push-s5"> What's this div for again? </div> // bourbon/neat .news-item @include span-columns(6 of 12); <div class='news-item'> Ah, sanity restored. </div> just my opinion of course.
    1 point
  25. You are on the right track. You need to add some additional logic to your template. You can read more about pagination in ProcessWire here.
    1 point
  26. It wasn't there in 3.0.15, but it is in (at least) 3.0.39. Thanks @ryan, minor fixes like these really improve the overall user experience.
    1 point
  27. Before I came to PW, I wrote my websites in simple text-editors, finally with notepad++, which is a great help even for HTML, CSS and PHP. So I'm familiar with HTML-tags and CSS-syntax. I like to keep things simple to realize fast loading and good care. Therefor I did not yet use any framework or even a WYSIWYG-generator. And that is why I like PW: I have the freedom to write and control my own code. But I'm shure, I have to learn much more about all the convenience this program can give to me. Thanks to You all.
    1 point
  28. Instead of putting your content in body field, create fields for each section in your page template. Then render each section in its own HTML section. <section id="sec-a"> <h2><?php echo $page->title; ?></h2> <?php echo $page->sectionA ?> </section> <section id="sec-b"> <h2><?php echo $page->title; ?></h2> <?php echo $page->sectionB ?> </section> <section id="sec-c"> <h2><?php echo $page->title; ?></h2> <?php echo $page->sectionB ?> </section>
    1 point
  29. https://github.com/adrianbj/TracyDebugger/issues/6 As noted in the issue, we discovered it is due to the use of LIVE dumps that I introduced as default for bd() a few weeks ago. I was hoping for a workaround because it is so much more efficient, but as you'll see if you read the linked posts, I might have to wait for that pull request to be finalized. I might have to revert to normal dumps until then. I'll investigate a little more in the next couple of days and fix one way or the other. For right now, you can instead use /Tracy/Debugger::barDump() inside your hook and you should be fine.
    1 point
  30. It looks like you have some filters set in the Users lister. Does the error still occur if you remove the filters? Also, the title of your post is a little unclear - you have added "user-admin-artist" as a permission and not the name of a role, right? Just to confirm, you followed a procedure like this... Installed user-admin permission: Access > Permissions > Add New > Install predefined system permissions > user-admin Installed user-admin-all permission: Access > Permissions > Add New > Install predefined system permissions > user-admin-all Installed user-admin-artist permission: Access > Permissions > Add New > Install predefined system permissions > user-admin-artist Gave user-admin and user-admin-artist permissions to a role: Access > Roles > artist (or whatever) > checked 'user-admin' and 'user-admin-artist' Welcome to the forums BTW
    1 point
  31. Hello @tpr now I think it is the time to say thank you to you in the name of all "Admin on Steroids" users, because you make our life much easier. "Admin on Steroids" has grown incredible since the beginning. I was a little bit sceptic if I should use this module in the beginning, but now I am totally convinced. So thank you for your enthusiasm, your time and your patience with all our wishes! Best regards
    1 point
  32. Yes, there is a way ...there has been for a while actually. It's called OR:groups $search = $pages->find("template=post|project, (categories=one|two|three), (tags=yes|no|maybe), (connectedClient=1065), id!={$page->id}"); That should find results if any of the selectors in the brackets find a match AND the template='blah blah' and id!=1234 are also true .
    1 point
  33. v0993 is up, incorporating bernhard's suggestions, including the github readme link and jumplinks to each submodule's configuration fields in the submodule "panels": The latest PW dev (3.0.40) has changes in some CSS classses (dropdown -> pw-dropdown) and AOS was adjusted for this. If you find that somewhere it's not working as it should, please report.
    1 point
  34. I actually thought you meant something different to @kongondo - who knows, but here goes, just in case: $page->count("template=v2-bs-demandes-recrutement, optionsfieldname.label=option 1, include=all"); This will count the number of pages that has "option 1" selected in the "optionsfieldname" options field.
    1 point
  35. Welcome to the forum and ProcessWire! If you're trying to ask if you can replace your custom CMS with ProcessWire, well.. the answer depends a lot on what kind of features you're looking for. In most cases I'd say "yes", but it may require some changes in your development process. Every CMS has it's own way of doing things, and once you get used to the way ProcessWire works, it can indeed be extremely flexible and powerful. If you're just getting to know ProcessWire, I'd suggest visiting our docs section: tutorials are always a good place to start, but if you've already got a project you'd like to use ProcessWire for, you may find the cheatsheet and API reference more useful To answer your question: no, ProcessWire is not based on CodeIgniter. ProcessWire is a CMS and a CMF, meaning that in a it's really a framework itself. Edit: Right, @Ivan Gretsky beat me to it, and looks like I misunderstood the bit about custom CMS If the question was whether you should start building your own CMS or choose an existing one like ProcessWire, then the answer is that you should definitely go with ProcessWire. Building your own system may feel tempting, but it's a massive amount of work, and you'll more than likely run into both technical and security issues sooner or later.
    1 point
  36. Hey darkmesaia! (it is so enjoyable how you can welcome people with such names without a doubt on Internets ) Welcome to the forums! If you need a customizable CMS - ProcessWire is certainly one of the best. Go ahead and try it. You can change almost everything on the frontend and a lot in the admin area. Give it a try. ProcessWire is not based on any of the general purpose php frameworks. But it has a set of features built in you would expect from a framework. And you can always extend with community modules or composer packages. I would say ProcessWire would save quite some time comparing to building a CMS from scratch. Feel free to ask further. Or just dive in and try building something with the help of the tutorials.
    1 point
  37. You can use Tracy Debugger for catching emails (Mail panel). https://processwire.com/blog/posts/introducing-tracy-debugger/#mail-panel
    1 point
  38. Okay I figured it's probably my fault but couldn't try it until today.. So @Ivan Gretsky's recipe is working fine..some might already know, but for the shared files/dirs to work you need to set up the correct file structure within shared directory, so you're shared folder needs to look like this -shared -site -assets -config.php
    1 point
  39. How about this for page IDs in the page list? I wanted something that is always visible but still less obtrusive.
    1 point
  40. Just uploaded v068 which adds template edit link tooltips to the main pagelist items plus has some CSS improvements to a few CKE plugins (some seem to be written at least 10 yrs ago :)). And also see the ProcessPageList.js attached that was modified to enable opening collapsed pagelist items when hovering over them during drag-and-drop. It's still not perfect but it's still much better than the original imo - please feel free to modify the code (see line 1035, "change" property of "sortOptions"). The file's location is "/wire/modules/Process/ProcessPageList/". The main problem is that I check the next item after the placeholder (.PageListSortPlaceholder) so expand-collapse occurs only when moving the placholder above on item and not directly on it. I think this could be improved somehow. The reason I uploaded this here is because AOS v068 contains a few lines of CSS that modifies the appearance of dragging. Of course it works without AOS too. Here is what it looks now: ProcessPageList.js
    1 point
  41. 1 point
  42. 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.
    1 point
  43. Because it is maybe interesting for others I will answer a question I got in the personal messenger: Does the module have the capability to run from a standard cron job? Yes. The Backup is triggered by the hook function cronBackup() expecting a HookEvent as single argument, which is in fact not needed. If you want to trigger the backup from anywhere, just create a HookEvent object and call the cronBackup() function. Done. $event = new HookEvent; $modules->get('CronjobDatabaseBackup')->cronBackup($event);
    1 point
  44. @rot, thanks a lot for this module! I've tested both the FTP and Google Drive options for a site of mine hosted on a Digital Ocean VPS, and it worked flawlessly. It took less than a minute to create the backup files and upload the 650 MBs ZIP to Google Drive, which is quite impressive. I must say that setting up the Google Drive option was hard due to the lack of documentation, but since it's a pre-release, that's expected.
    1 point
  45. @kixe I forked your repo and made a few tentative commits. The results are here. Changes include more options for the backup period and a hookable filename generation method. I haven't submitted any pull requests as I unified the indentation and line endings first and you might not want those changes.
    1 point
  46. So I think I'm going to change MarkupSEO back to creating "real" fields. This will allow multilanguage and has some other benefits as this module is used by a lot of you lately.
    1 point
  47. Andi, nico has build an SEO tool not an encyclopedia.
    1 point
  48. There's no fieldtype or module for this, because PW already has all the things you need to do flexible and powerful tagging. Using page reference and the powerful inputfields it offers is the way to do it in PW, it's not an "alternative" way, it IS the way. It is far more flexible and powerful than what you have in MODX and most other CMS'. Everything else that stores tags in a textfield comma separated isn't going to give you the power you usually need with tagging. You won't easily be able to use that in selectors and so on. If you're building a new fieldtype, inputfield for tagging, you don't really understand what PW offers already and you will using the same approach at the end anyway. There was already lots of discussions and people were trying to come up with modules or fieldtype for it, but none of them really is a better solution. You can now install the Autocomplete module that comes with PW and use that to search and create tags on the fly. It has even improved from Ryan's blog profile, to create new tags without saving the page. The interface is simple and clients have no problem with it. As mentioned before, I also mostly use ASM select and the Autocomplete feature. Takes couple minutes to setup and can flexibly be used to later expand and use the tag pages for different stuff like listings,sorting and filtering etc. The page find selectors are there to do powerful stuff with page fieldtype already. Further you can use the tag pages later on to expand it with additional fields for and image or description. Possibilities are endless and a feature I love the most in PW (one of the big reasons I love to use PW).
    1 point
  49. Ah that's something different. You could try something like this: 'item_tpl' => '<a href="{redirect_url|url}">{title}</a>' Then it will take the redirect_url if it's populated.
    1 point
×
×
  • Create New...