Jump to content

adrian

PW-Moderators
  • Posts

    11,176
  • Joined

  • Last visited

  • Days Won

    371

Everything posted by adrian

  1. Another alternative: https://github.com/adrianbj/ProtectedMode I haven't added it to the modules directory just yet. Official forum post: https://processwire.com/talk/topic/7723-protecteddevelopment-mode/ Modules directory: http://modules.processwire.com/modules/protected-mode/ The reason I built this, rather than using the Maintenance Mode module was: I didn't want the "Maintenance Mode" badge showing up on the site since it really is for development before a site has ever been live. I didn't want users redirected to the PW login page because I did want visitors to see the login page. I know the module has the option to redirect to a custom page, which you could use to make a front-end login form, but that seemed more complex than I needed (and I think other PW devs might also need). Because of the way this module replaces Page::render with the login form, visitors can be sent to any page on the site, and once they login that page will reload with its full content - no messing around finding the page again, and no need for sending page ids through the login process to redirect back. This module also lets you configure the message that is displayed along with the login form. I don't see this as a replacement for Maintenance mode at all. It has less options and is not really appropriate for scheduled maintenance time - it doesn't send a 503 - although Maintenance Mode doesn't do that either. If you try it, let me know how it works out for you.
  2. And in this: http://openexchangerates.org/api/latest.json?app_id=xxxxx (with your API key). What happens if you edit the module file: https://github.com/ryancramerdesign/ServiceCurrencyConversion/blob/master/ServiceCurrencyConversion.module#L293 to include a log of $rates and $toCurrency public function convertAdvanced($fromCurrency, $toCurrency, $amount, $markup = 0.0, $decimals = -1) { error_log(print_r($rates,true)); error_log("ToCURR:".$toCurrency); $rates = $this->getConvertedRatesTable($fromCurrency, $amount, $markup, $decimals); if(!isset($rates[$toCurrency])) throw new WireException("Can't find target currency."); return $rates[$toCurrency]; }
  3. It looks like the service doesn't support MXN. Check out the dropdown here: https://processwire.com/api/modules/cc-example/ Although weirdly it is in this list: http://openexchangerates.org/api/currencies.json So I don't know why it is not available
  4. Hi mikeroosa and welcome to PW. Both of those are optional. The leading underscore is simply a convention so you know those files are not actual template files, but rather php includes (files that get included into other files). This is also common outside of PW. The omission of the closing tag has several benefits. A quick google will help to explain why: https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=php+omit+closing+tag
  5. I haven't managed to test out this new module yet, so I am not sure, but I think it should do what you are looking for: https://processwire.com/talk/topic/6822-module-dynamic-roles-for-pw-246/
  6. adrian

    Hanna Code

    Damn it is embarrassing that I felt the need to Like that suggestion of Joss'. I used to be fine on a 15" laptop running 1920x1200. Seems like 40 really is the beginning of the end when it comes to small things and low light
  7. http://modules.processwire.com/modules/process-hanna-code/ will let you create the gallery using your own php code and the client can simply type: [[imagegallery]] Alternatively, check out PageTableExtended: https://processwire.com/talk/topic/7459-module-pagetableextended/
  8. $image = $page->images->get("name=picture.jpg");
  9. I know nothing about the multisite module, but that first error suggests that the subdomains field in the module's config settings hasn't been filled out.
  10. $modules->uninstall("ModuleClassName");
  11. I haven't been following this thoroughly, but does this help? Soma suggested this to me for something a while back and it works well enough. // generate pager navigation using dummy array $dummies = $pages->find("template=basic-page, limit=10"); echo $dummies->renderPager();
  12. Hey Joss, I thought you might appreciate this: http://www.dancingbearmusicfest.com/ And here is a photo of the "Dancing Bear", white patch, right in the middle of the Stawamus Chief: http://3.bp.blogspot.com/-BGfk41qTmrw/TmlOZo2bq_I/AAAAAAAAAB0/AuWMKVgn8H4/s1600/Chief.jpg
  13. Hey Joss, Have you tried WireMail with horst's or teppo's plugins to make use of SMTP, instead of mail?
  14. Glad it worked for you and that you sorted out the row width stuff. I haven't played with sortable callbacks for a while, but I think this is what you are looking for: http://api.jqueryui.com/sortable/#event-update
  15. The 100 versions are for the admin - if you have "display thumbnails in page editor" checked on the Images field Input tab.
  16. Or give up on RTE fields for images completely and use PageTableExtended for a content block type approach I have actually been removing the images plugin from CkEditor so that users can't be tempted I know that maybe sometimes this will be overkill to set up, but it is nice having complete control of how things will look. For simple sites, I bet ImageInterceptor will be very useful.
  17. Apparently I like both sides of this argument What about doing this to the classname? strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', $this->className()));
  18. Hi Mike, Off the top of my head: http://modules.processwire.com/modules/batch-child-editor/ And the 2.5 core PageTable fieldtype. $table = $this->modules->get('MarkupAdminDataTable'); $table->setSortable(true); function TableSortable($table) { if(!$table.is("tbody")) $table = $table.find("tbody"); $table.sortable({ axis: 'y', handle: '.InputfieldChildTableRowSortHandle' }); }
  19. Any chance it started happening after an upgrade to 2.5.1? There's a new setting for replacing existing files - not really sure, but might be worth a look.
  20. Try it without the spaces before and after the pipe ( | ) character.
  21. No problem at all - thanks for all the input and ideas!
  22. Thanks again! I just spent some time revisiting this a bit. It's a bit more complicated that just removing trailing, commas, spaces, tabs etc because it is possible that these might be intentional if someone wants an empty value for the last field on the row. I have implemented a bunch of extra checks to make sure fields/pages etc can't be created without a name, so you shouldn't ever get the unnamed field issue anymore. I have also tried to make sure that the first row has no leading or trailing misc stuff so that the fields get properly created. But with the subsequent rows I allow trailing commas with nothing afterwards in case it is meant to be blank. I just tested with this mess and it looks to be fine: , ,Title, Number of Beds>Integer, Number of People>Integer, Kitchen Facilities>Text ,Single, 1, 1, Fridge Only, Double, 2, 2, Fridge Only Suite, 3, 6, Full Kitchen , Would you mind trying again at your end to see if I have still missed something? Thanks Adrian
  23. Ryan is working on a very comprehensive changelog for 2.5 which will be published on the blog hopefully sometime next week when 2.5 becomes official. The current soft release of 2.5 will be superseded by 2.5.2 as the official stable version.
  24. Hi seedle, Firstly, 2.5 is the current stable version so you should grab that instead. As for page/pages: http://processwire.com/api/variables/page/ http://processwire.com/api/variables/pages/ I am not really sure what information you need, but to clarify, wire('page') is effectively the same as $page, but due to PHP variable scope $page is not available inside your own functions, inside PW modules, or on a script that is bootstrapped to PW. That is when you need to use wire('page'). Same goes for all the PW variables: wire('input'), wire('sanitizer'), wire('user') etc. If you are wondering what $page and $pages are actually for. Basically, $page gives you access to all the fields on the currently viewed page on your site, eg: $page->body $pages gives you access to all pages on your site - you can query the pages you want using selectors, which are Processwire's version of database queries. It sounds like you might benefit from reading through some of the new tutorials: http://processwire.com/docs/tutorials/ and of course the cheatsheet: http://cheatsheet.processwire.com/ Hope that helps!
  25. Thanks again Steve - great 2¢ suggestion I have set it up using your second option and I think it works great. I have also added a fix for the blank fields / extra commas issue. Please let me know if you find any problems with it.
×
×
  • Create New...