Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by joe_g

  1. Hello! I'm wondering what components best to use to build the following (it's for a semi-extensive application process): - sign up new account - login - a multistep form including uploading multiple files - Say, 5 screens/steps, with save data in between steps (save on 'next' or previous) - possibility to logout and login later and continue filling in the form - preferably with the zurb foundation form-styling Would form builder be good for this? How would be the best way to get about doing a thing like this in PW? Can form builder save state? thanks! J
  2. Hey hey, Is there an easy way to make a page available like it's published, but only for logged in users? I'm trying to make a preview function. These two doesn't seem to work so well: http://modules.processwire.com/modules/process-preview/ http://modules.processwire.com/modules/process-page-draft/ The only way I can see now is to make a 'hide unless logged in' check box then litter the site with ->hide_unless_loggedin, is there a better way? tx j
  3. Thanks! It's 2.4.0 eh.. ops, forgot to finish the title!
  4. Hi, I got this error happening sometimes (I only notice it in the logs, and I can't see any problem on the site) 2014-11-21 03:59:00 guest http://subdomain.domain.com,domain.com,www.domain.com/http404/ Error: Exception: Method Page::localUrl does not exist or is not callable in this context (in /home/domain.com/public_html/wire/core/Wire.php line 320) I'm not sure where/how to debug this since I don't know when or where it happens. The error sends an email, othewise I wouldn't have noticed. Is there a way to get a full stack trace for this error somehow? j
  5. heyhey, here is something off topic: Are there any MEAN/node devs here? Just a general question, I'm interested in nodejs, but what's holding me back is that to get to the same level of slickness of an admin interface as processwire seems to be very hard work. It seems easy enough in both RoR and Django, for example, but with node, not as easy. Making admin interfaces is such an incredible drag, this is one of the reasons why I love PW. Clients love that slick custom admin they get to work with. Just curious to hear if anyone had any experience with writing an admin interface based on MEAN/node, from a processwire perspective. - CRUD with - relationships (like pages in PW) - users - access levels / groups - access rights - multilingual (very important) I should mention that I'm not looking for any presentation layer (templates/views, etc). Only a way to handle the data (with some custom data model) in a client-friendly way. cheers, J
  6. Hi there, Locally I can only be logged in to one PW install at a time. It's becoming a bit cumbersome, since I'm juggling about five different project at a time (all PW installs), so every time i switch project I need to login again. Is there any way to avoid this? thanks!, J
  7. I could do this I guess, and then the name will be calculated? $default = wire("languages")->get("default"); $p->title->setLanguageValue($default, 'blablabla'); thanks, j
  8. Hello, this works: $user->language = wire("languages")->get("default"); $p = new Page(); $p->parent = $pages->get('/things'); $p->template = $templates->get('mytemplate'); $p->title = 'blablabla'; $p->save(); ..but this doesn't (in pw2.4): $user->language = wire("languages")->get("english"); $p = new Page(); $p->parent = $pages->get('/things'); $p->template = $templates->get('mytemplate'); $p->title = 'blablabla'; $p->save(); i get Can't save page 0: /en/things/: It has an empty 'name' field any ideas how to get around this? J
  9. I solved it like this: https://processwire.com/talk/topic/2598-fatal-error-cannot-redeclare-class-sessionloginthrottle-on-update/ I deleted the /wire folder, then pasted in the /wire folder from a different (totally unrelated) project the difference in my case was that it was happening locally
  10. thanks, deleted sessions on both sites, no effect tho j
  11. Hello, I get this error after copying a v2.4 site (from /xx to /yy) Somehow the copy have a reference to the old location. So on the new site (/yy) i get: Fatal error: Cannot redeclare class FieldtypeTextLanguage in /Applications/MAMP/htdocs/xx/wire/modules/LanguageSupport/FieldtypeTextLanguage.module on line 17 This error message was shown because site is in debug mode ($config->debug = true; in /site/config.php). Error has been logged. What can I do to make the new copy (/yy) forget about the old location? - I tried deleting the module cache. - .htaccess is identical in both cases, there is no reference to /xx - $config->httpHosts = array('localhost:8888', 'localhost'); // also identical - deleted the sessions on both /xx and /yy
  12. I tried looping through the repeater values and publishing them for all languages, but no luck so far: (site is 2.4) $pages->setOutputFormatting(false); $pps = $pages->find('has_parent=/processwire/repeaters/for-field-116/'); foreach($pps as $p) { foreach($languages as $lang) { if($lang->isDefault()) continue; $p->set("status$lang", 1); echo "set status$lang" . $p->title . ' <br>'; $p->save(); } } die;
  13. I ran into this issue again, and ryans file works, but only for new entries (after fix is applied). I've got a project with lot of repeater data that I can't enter all over again. Is there a way to loop through all repeaters and publish them for all languages?
  14. Hello again, This solution isn't 100% working yet: - an url /page redirects to /maindomain/nl/page/ instead of /nl/page/ I can see how this will give problems in the long run when the wrong url get indexed by google - also with 404's - it still redirect to /maindomain/nl/404page/ - and also the admin is running on the wrong url /maindomain/processwire/ It does feel a bit hacky to set $config->urls->root = '/'; I suppose the most reliable thing is to make sure the site runs in it's own webroot? j
  15. ahhh yess! I somehow missed the $config->prependTemplateFile thing ProCache AND correct URL thanks!!
  16. I can't get the combo to work - maybe because my site is multilingual. I suppose the /nl/ or /en/ redirect happens before anything else, to the $config->urls->root = '/'; should happen just before that? On top of my templates, might be already too late? If I put it on line 196 in index.php the url is correct, but ProCache doesn't like that..
  17. Thanks! Indeed it works, but this trick seems incompatible with ProCache :/ If I do this, ProCache stops serving cached results. But then it gets weird: With ProCache I don't need this trick! BOTH the right and wrong URL's work fine, so I guess I just have to make sure the wrong URL never gets used by string-replaceing, or something like that...
  18. Thanks! They are all commented out (like your example). But I've tried RewriteBase / RewriteBase /maindomain/ RewriteBase http://subdomain.maindomain.com/maindomain/ RewriteBase /maindomain (error) RewriteBase maindomain/ (error) no luck so far... But after looking around in the forum I should check that the server allows overrides (i think?) <Directory "/"> Options All AllowOverride All </Directory>
  19. Hi there, I have a hosting/path issue: I have a website running on, say subdomain.maindomain.com when I go there, processwire redirects to subdomain.maindomain.com/maindomain/, instead of staying on subdomain.maindomain.com/ $config->urls->root is "/maindomain/" but should be just "/" $config->paths->root is "/home/someotherdomain/public_html/maindomain/" According to my host this is a comon problem and I recieved som instructions how to fix this for wordpress, but I can't decipher how to fix this for PW: instructions from host: Options + FollowSymlinks RewriteEngine On RewriteRule ^ / * (* [^ /] [^.]) $ Http (+ /.): //% {HTTP_HOST} / $ 1 $ 2 / [L, R = 301] - Open the database of your WordPress installation - Open the table 'wp_options' - Top Click 'Explore' - Adjust the following fields 'option_value' on - Siteurl: the url of the website - Home: the url of the website I have in my config.php: $config->httpHosts = array('subdomain.maindomain.com'); Anyone have a clue whats up with these urls? thanks! J
  20. Hi, is there a way to get the backend search function to search the titles of all languages instead of just default? And equally (if possible) I'm using the PageAutocomplete module, and if that one could also go through all languages instead of just default? thanks! J
  21. thanks! didn't know about the date archiver module.
  22. Hi, is there a faster/better way to do this? With events containing startdate (mandatory) and enddate (optional) - I'm looking up what years has one or more events: The result is a list of years that contains events. It works fine, but it's a bit slow. <?for($i=2014;$i>=1980;$i--) { $date_start = new DateTime(); $date_end = new DateTime(); $date_start = $date_start->setDate($i, 1, 1); $date_end = $date_end->setDate($i+1, 1, 1); $date_start_ts = $date_start->getTimestamp(); $date_end_ts = $date_end->getTimestamp(); $e = $pages->get('/event')->numChildren("enddate!='',enddate>$date_start_ts,startdate<=$date_end_ts"); $e2 = $pages->get('/event')->numChildren("enddate='',startdate>$date_start_ts,startdate<=$date_end_ts"); $tot = $e+$e2; if($tot>0) { echo $i; //print year since it has events } } ?> tx, j
  23. Heyhey, Writing entirely isomorphic (http://nerds.airbnb.com/isomorphic-javascript-future-web-apps/) websites with processwire is not possible. But are there any steps that could be taken in that direction? I write a lot of double code (both and client and server) because I want to use PW, but control what parts gets loaded where with ajax. Currently I use crossroads for client side routing. It's a bit of a mess with the double logic. Maybe the idea might be a bit outlandish, but I kind of would want to export the inclusion logic (what get rendered where) to javascript so I only have to write the server including in one place (x->render() in page y, etc). But maybe there are better ways to approach this. I figure I'm not the first to run into this issue. I'm hoping there would some tricks to make this a bit easier, or at least a bit more DRY, without abandoning PW. J (This is an attempt to rephrase an old question (https://processwire.com/talk/topic/6436-ajax-and-caching-structural-problem/) in a better way
  24. To conclude my lengthy rant: 1. Any ajax page combining parts of html fragments must be re-done server side. I guess there is no way around that everything has to be done twice (both server and client side). The alternative seems to be node (but then missing all the processwire goodness): http://stackoverflow.com/questions/20588865/node-framework-to-render-on-both-ends 2. Then my other problem I had is that any html fragment used for ajax loading can't have conditionals combined with caching (if ajax then), but that's quite obvious really. cheers, J
  • Create New...