-
Posts
5,008 -
Joined
-
Days Won
333
Everything posted by Robin S
-
I use a slightly customised version of this useful module and found that the page list additions weren't looking so good in the new Tree dropdown menus, and they aren't needed there anyway. Solution was an early return if the 'noTags' option is set... public function addPageIdLabel($event){ $page = $event->arguments('page'); $options = $event->arguments('options'); if(!empty($options['noTags'])) return; // return if this label is for the Tree dropdown menus $event->return .= " <span class='helper-info'>($page->id, $page->template)</span> "; }
-
For those wanting more room for the tree dropdowns in the default admin theme it's easy as pie with a little custom CSS: /* Align tabs to left to make more room for tree dropdowns */ #masthead #topnav { float:left; margin-left:30px; /* just a little left margin to leave some space around the PW logo */ } @tpr, could maybe be an option in AdminOnSteroids? @Pete, the syntax highlighting in forum code blocks seems be broken for CSS - looks good in the modal, but no highlighting when the modal is closed.
-
Do you do design websites as well as develop them? If you do then my experience has been that there is plenty of work available from businesses and organisations who care about and understand the benefits of high-quality bespoke design and development. Yes, there are many out there who think that a $40 Wordpress theme is good enough and don't want to pay above the minimum - if job satisfaction is important to you, you don't want those people as clients. You'll hate the client, hate the finished website, and end up hating your job. You say you also work in the charity sector - I think that is a good sector to target as a specialisation and maybe you can make use of your contacts there to get started. Most of my clients are not-for-profits, mainly environmental organisations. I have found them to be excellent organisations to work with - friendly, sensible people, happy to take advice and willing to let you get on and do your work without a lot of interference. Another benefit is that these organisations often fund their projects from grants. This makes them less price-sensitive. To be clear, I'm not talking about gouging them on price - just that you can quote a fair price and they base their funding application on that and there's no grizzling and bargaining over cost like you can get in the for-profit sector. I live/work in the middle-of-nowhere rural New Zealand, I have never advertised or done any kind of promotion, and have been fortunate enough to always have a steady stream of work. And believe it or not, in the ten years I have been doing web work I have never had a client request a Wordpress site. I think positive word-of-mouth is key, and the great thing about it is that good people tend to know other good people so you generally avoid those Clients From Hell. To get good word of mouth you need to exceed expectations - set yourself high standards, have meticulous attention to detail, and deliver that bit extra. Best of luck with your career!
- 15 replies
-
- 12
-
-
Add export users hook to user list, page lister
Robin S replied to Mackski's topic in API & Templates
Not an answer to your question sorry and only useful for those with Lister Pro, but just wanted to note that you can export the filtered list of users with "Export Pages to CSV" action for Lister Pro. -
@MilenKo, it won't be a PHP issue if you can see the markup in your page source. Could it be that you do not have jQuery included in your template? jQuery is a requirement for the module according to the GitHub readme. Here is the module working with the "Blank" profile (note that I added jQuery to the head):
-
Module FrontendUser: login, logout and register users / members
Robin S replied to pwFoo's topic in Modules/Plugins
I've never used the module so not sure how it works, but it is not a requirement that the "email address" field of a user page be unique - only the "name" must be unique. Having another user with the same email address as your superuser account is not going to stop you from logging in with your username/password as normal. Maybe you simply had an incorrect password entered when you were trying to log in as superuser. -
Module FrontendUser: login, logout and register users / members
Robin S replied to pwFoo's topic in Modules/Plugins
But you log in in with your username, not your email address. Or do you mean you used your email address as your username? In which case I would suggest don't do that - it violates the allowed characters for the "name" field of a user page. -
Can ProcessWire do this? (User Management, Profiles, Search)
Robin S replied to Kai's topic in Getting Started
- 23 replies
-
- search
- user-management
-
(and 1 more)
Tagged with:
-
Module FrontendUser: login, logout and register users / members
Robin S replied to pwFoo's topic in Modules/Plugins
For next time, if you find yourself logged in as a user with limited admin permissions, just log out. -
Deleted Repeater and RepeaterMatrix Items to Trash
Robin S replied to gingebaker's topic in General Support
@gingebaker, I don't think there is a currently a way to trash Repeater items rather than delete them, but it would be useful if there was. Do you want to open a GitHub request for this so that Ryan sees it? -
You can also use timestamps in a PageFinder selector or anything that works with strtotime(): $zaehler = $page->children("einsatzdatum>=first day of January 2017, einsatzdatum<=last day of December 2017");
-
But are you positive you are actually connecting to the local site when you visit dev.example.com? If you haven't configured your hosts file correctly your browser may be attempting to connect to an online server where that address does not resolve to anything and hence the error. If you put a file "test.txt" in your local site root and visit dev.example.com/test.txt can you see your file?
-
It is weird and not worth spending time on I think. I thought it was some general error but it actually only happens on one page and relates to something I was testing with FieldtypeSelectExtOption and hooks. The field and hooks apply to several pages containing similar data yet I only got the panel error on one - I tried a few things to narrow it down but couldn't see the cause. Then I removed and readded the Select External Option field to the template and all is well now. So just one of those strange things that spontaneously resolves.
-
Captain Hook panel is working and removing the debug bar on the Form Builder template is also working. Thanks! However, there is a new panel error: ErrorException: A non well formed numeric value encountered in D:\Websites\__www\1testing\site\assets\cache\FileCompiler\site\modules\TracyDebugger\TracyDebugger\panels\ProcesswireInfoPanel.php:359 Stack trace: #0 [internal function]: Tracy\Bar->Tracy\{closure}(8, 'A non well form...', 'D:\\Websites\\__w...', 359, Array) #1 D:\Websites\__www\1testing\site\assets\cache\FileCompiler\site\modules\TracyDebugger\TracyDebugger\panels\ProcesswireInfoPanel.php(359): date('Y-m-d H:i:s', '2017-03-02 21:3...') #2 D:\Websites\__www\1testing\site\assets\cache\FileCompiler\site\modules\TracyDebugger\TracyDebugger\tracy-master\src\Tracy\Bar.php(153): ProcesswireInfoPanel->getPanel() #3 D:\Websites\__www\1testing\site\assets\cache\FileCompiler\site\modules\TracyDebugger\TracyDebugger\tracy-master\src\Tracy\Bar.php(108): Tracy\Bar->renderPanels() #4 D:\Websites\__www\1testing\site\assets\cache\FileCompiler\site\modules\TracyDebugger\TracyDebugger\tracy-master\src\Tracy\Debugger.php(266): Tracy\Bar->render() #5 [internal function]: Tracy\Debugger::shutdownHandler() #6 {main} If I log $val before line 359 I get this: $val: {"pages_id":"1054","data":"dreamstimefree_5848146.jpg","sort":"2","description":"","modified":"2017-03-02 21:39:29","created":"2017-03-02 21:39:29"}
-
It's those little things where you find some elegant, succinct way to do exactly what you want that make development so satisfying. The only frustrating thing is that unless you work in an office of fellow code nerds you don't get to share those "nailed it" moments. Like, in your home office you call your loved one over and gesticulate enthusiastically at the screen but they're all...
-
TLDR: Buy ProFields I don't understand why that brief list of fields is a "mess and a nightmare". I know the general advice given is to reuse fields where possible but I think people sometimes take this suggestion a bit too seriously. Create the fields you need and forget stressing about whether you have perfectly optimised the reuse of fields. If you have less than, say, 100 fields in your site you really have nothing to worry about. I think I saw a post recently where Lost Kobrakai was talking about a site of his with over 800 fields. But ProFields... You mention client editing experience, so I take that to mean you (like me) earn an income from developing websites. With that in mind here are some things to consider when making your decision whether or not to purchase ProFields... Have you thought about how lucky we developers are that we can earn an income with virtually no overhead costs? With so much fantastic open-source software made available to us at no cost we are in a very fortunate position. We could design and develop websites entirely with free software if we so choose. Hell, if we wanted we could go to the landfill and probably pick up a free old computer that would be perfectly adequate to develop a website on. Now think about the carpenters and dentists and all those other professions that must purchase real physical tools (that wear out) in order to earn a living. £100 doesn't go very far if you need to buy a table saw. On the topic of open-source, think about what Mr Ryan Cramer has provided us with in ProcessWire. People with his level of skill do not need to be contributing their time for free to open-source projects - they are in very high demand for all kinds of lucrative work. Purchasing a Pro module from Ryan is a way to show appreciation for the generous work he puts into PW. PW is not just great free software, it is great software full-stop. You mention previously having worked with Drupal and Craft CMS. Time is money, so think of all the money you have saved by the quick development workflow that PW allows vs Drupal. And Craft CMS costs USD$299 per website and is still not as powerful as the PW core. Ryan's Pro modules are insanely good value for money. The price that you can purchase a dev license that allows you unlimited use of the modules is more than reasonable. For comparison, here is one of the most popular addons for Concrete5: http://www.concrete5.org/marketplace/addons/block-designer-pro There is no unlimited license, and a license for 5 installations costs USD$276.25. And it requires "Block Designer" so that's another USD$120 for 5 installations, bringing the cost to USD$396.25. I haven't used it but it looks like it is basically the equivalent of Repeater Matrix. But probably not as elegant. And with ProFields you get another four modules bundled in. For unlimited use. For USD$129. Hope this has helped make the decision a little easier.
- 15 replies
-
- 17
-
-
@MilenKo, my tip is that if you want to really accelerate your learning of ProcessWire and PHP the single most important thing you can do is install Tracy Debugger and start dumping variables. Whenever you are confused or curious about something, dump it and explore it in the debugger. Installing Tracy also makes sure you are seeing PHP errors when they occur. If you dump $page->recipe_rating you will probably find out where you are going wrong.
-
In Soma's tutorial he covers the $options array - does setting 'forceDownload' to false achieve what you want?
-
I think your time would have been better spent persisting with FieldtypeRate, which seems to be exactly what you are looking for. I installed it to test it and it works straight out of the box, so not sure how you have been going wrong. Just echo the field as per the documentation: echo $page->my_rating_field; // of course change this to the name of your ratings field There is a small error in the module code that will generate a PHP notice but it is an easy fix - delete line 66 as it looks like it is an accidental leftover from the FieldtypePoll that the module is based on.
-
I think the error is down to the Windows directory separator thing that reared its head a while ago. If I json_encode and log $segments I see results like this: Not sure why there would be double slashes there instead of single slashes. If I change line 110 to be... $segments = explode(DIRECTORY_SEPARATOR, $path); ...then the panel error is fixed, although I notice that the 'wire' segment still looks a bit funky: Maybe there are other places where a hardcoded forward slash should be replaced with the DIRECTORY_SEPARATOR constant? I don't mean to get OT here, but I'm curious how you like to handle front-end forms if you don't use Form Builder. Do you use the forms API, or a third-party forms library like Nette Forms, or some other approach?
-
Thanks for implementing this so quickly. The template restriction works if I select a template such as "home" or "basic-page", but it doesn't work for the "form-builder" template for some reason. The debug bar still appears on the Form Builder page when it is loaded in an iframe and when the page is loaded directly. I'm also seeing an error in the Captain Hook panel which may or may not be related: ErrorException: Undefined offset: 2 in D:\Websites\__www\1testing\site\assets\cache\FileCompiler\site\modules\TracyDebugger\panels\CaptainHookPanel.php:111 Stack trace: #0 D:\Websites\__www\1testing\site\assets\cache\FileCompiler\site\modules\TracyDebugger\panels\CaptainHookPanel.php(111): Tracy\Bar->Tracy\{closure}(8, 'Undefined offse...', 'D:\\Websites\\__w...', 111, Array) #1 D:\Websites\__www\1testing\site\assets\cache\FileCompiler\site\modules\TracyDebugger\tracy-master\src\Tracy\Bar.php(153): CaptainHookPanel->getPanel() #2 D:\Websites\__www\1testing\site\assets\cache\FileCompiler\site\modules\TracyDebugger\tracy-master\src\Tracy\Bar.php(108): Tracy\Bar->renderPanels() #3 D:\Websites\__www\1testing\site\assets\cache\FileCompiler\site\modules\TracyDebugger\tracy-master\src\Tracy\Debugger.php(266): Tracy\Bar->render() #4 [internal function]: Tracy\Debugger::shutdownHandler() #5 {main}
-
Hi @adrian, Is there a way to tell the debug bar not to appear on pages with a particular template? The situation is that I'd like to be able to turn off the debug bar for the Form Builder template that is used when the form is rendered inside an iframe. I know there is an option to disable the debug bar in modals, but not for iframes I think? And it's often useful to have the debug bar in iframes so it would be great to be able to target templates rather than all iframes. Any thoughts on this?
-
This is true. It starts to get a little more complex but with a few more steps you can filter out the non-public pages: $field = $fields->get('my_options_field'); $table = $field->getTable(); $query = $database->query("SELECT data, pages_id FROM $table"); $results = $query->fetchAll(PDO::FETCH_COLUMN|PDO::FETCH_GROUP); // get multidimensional array of results $results_page_ids = array_unique(call_user_func_array('array_merge', $results)); // get all the unique page IDs in the results $public_ids = $pages->find(['id' => $results_page_ids])->explode('id'); // find out which ones are public $filtered_results = []; foreach($results as $option_id => $page_ids) { // remove any page IDs that are not public $filtered_value = array_filter($page_ids, function($value) use ($public_ids) { return in_array($value, $public_ids); }); // for each option, count the public pages it is selected on if($filtered_value) $filtered_results[$option_id] = count($filtered_value); } arsort($filtered_results); // sort highest to lowest $all_options = $field->type->getOptions($field); echo '<ul>'; foreach($filtered_results as $option_id => $count) { $option = $all_options->get($option_id); echo "<li>{$option->title} ({$count})</li>"; } echo '</ul>';
- 12 replies
-
- 2
-
-
- field type options
- options
-
(and 1 more)
Tagged with:
-
v0.0.4 released. Adds config option to remove clone button.
-
The thing about this approach where you foreach the selectable options (for an Options or a Page field) is that if you have 196 countries (for example) then that is 196 database queries. Not the end of the world or anything but also not very efficient. I like this code from Ryan that requires only a single DB query, and which can be adapted for an Options fieldtype: $field = $fields->get('my_options_field'); $table = $field->getTable(); $query = $database->query("SELECT data FROM $table"); $ids = $query->fetchAll(PDO::FETCH_COLUMN); $count_values = array_count_values($ids); // count the frequency of values in the array arsort($count_values); // sort highest to lowest // use the option IDs and counts as needed, for example: $all_options = $field->type->getOptions($field); echo '<ul>'; foreach($count_values as $option_id => $count) { $option = $all_options->get($option_id); echo "<li>{$option->title} ({$count})</li>"; } echo '</ul>';
- 12 replies
-
- 1
-
-
- field type options
- options
-
(and 1 more)
Tagged with: