Jump to content

SteveB

Members
  • Posts

    214
  • Joined

  • Last visited

Everything posted by SteveB

  1. I'm trying this module out and could use some troubleshooting tips. Java and Elastic Search are installed. I'm forwarding port 9200 through to the virtual machine. I ran "sudo /etc/init.d/elasticsearch start" and if I try to access the site's domain using port 9200 I do get a response: {"status": 200, "name": "Conquest", "cluster_name": "elasticsearch", "version": {"number": "1.5.1", "build_hash": "5e38401bc4e4388537a615569ac60925788e1cf4", "build_timestamp": "2015-04-09T13:41:35Z", "build_snapshot": false, "lucene_version": "4.10.4"}, "tagline": "You Know, for Search"} I went with the default module settings for host and port and chose a template which has just 10 pages. When I click to index all pages I get this error: Error: Maximum execution time of 30 seconds exceeded (line 617 of /web/elastic/wire/core/Page.php) I'd think 30 seconds would be quite adequate for 10 pages so I'm wondering what I can do to diagnose the problem. Tried it with the max execution time at 60sec and it timed out again. Error: Maximum execution time of 60 seconds exceeded (line 622 of /web/elastic/wire/core/Page.php) FYI: I'm using the dev branch (2.5.26) running Ubuntu 14.04.1 LTS (GNU/Linux 3.13.0-39-generic x86_64) in a virtual machine on my PC. Thanks!
  2. Got it. A solution like mine above, using jQuery and the Service Pages module, should work just as well for what you're doing. You'd just change the query string (url) that's sent to Service Pages so it selects pages based on that asm select field you are using to tie, for instance, destinations to countries. Conceptually it's the same as using the parent/child relationship.
  3. Maybe my coffee hasn't kicked in but what's the use/case for that? Without nested parenting of the pages how is the UI supposed to "know" what to fill the next level select with?
  4. SteveB

    jQuery Not

    If you gave all those containers (except the one with the ASMSelect data) a certain classname, you could use a jquery selector targeting hidden containers with that classname to remove the containers (and their contents).
  5. In answer to my own question I came up with a solution using good old jQuery and the Service Pages module. Use it to choose any node in a tree that ServicePages will let you access. Here's a quick video of it in action: Demo (.avi) Could use hover to reveal the selects but that won't help people on touch screens. The PW pages used here are like you find in typical PW category schemes, just the default fields. Reasonable conventions for ids and classes so no problem using more than one at a time and styling them alike or differently.
  6. Just caught up on this thread. I think you are all several steps ahead of me on this but I'd like to help. Documentation matters. I like what's been said about automated docs and streamlining that process (apigen, webhooks, etc.). I like that people are recognizing how useful different types of docs are.. Some observations: JQuery docs site is pretty good as a quick reference for syntax, methods, etc. and has good simple examples nearby. The PHP docs have always been a pretty good function reference (and there are so many!). How they handle comments is interesting. There are good and bad comments but it's great having them, especially for quirky version specific and environment specific stuff. Over they years they've tried various ways to organize and filter that content. Currently they have up/down voting but that has the effect of pulling posts responding to earlier posts out of their context, making them somewhat ambiguous. I'm particularly keen on using a PW web site to tie things together (eating our own dogfood). I'm just spewing coffee fueled ideas here, don't be too harsh, but somehow we should be able to use automatically managed tags, categories, etc to facilitate jumping around between tracing through code in apigen, seeing relevant "recipes", locating relevant posts (some curating and crowd sourced up/down voting here), Github issues and updates, etc. I'm imagining some kind of all-knowing sidebar navigation generated by PW and with AJAX, RSS and minimal intrusion could be be tacked on to things like the cheat sheet, apigen, this forum, etc.
  7. Tangentially related to the above... Anybody have advice on how best to implement, on the front end, a set of dependent selects which allow you to traverse a tree of pages? The point is to be able to pick any single thing in the tree (get a page id). They should be able to drill down as far as they want but not have to go all the way to a leaf. Imagine minimal pages (title and id) something like: stuff/ tools/ hand-tools/ pliers/ locking/ power-tools/ saws/ drills/ finishes/ paints/ On a form, starting from nothing, user sees a single select of the immediate children of stuff. They pick one of those and (this part via AJAX) we use that page's id to get children to populate a second select. Actually, my preference is to use one select and once a choice has been made the label for that choice becomes an LI tag, We end up displaying a path using UL and LI inline and as we click around on those the clicked one becomes a select, the ones to the right go away. If we show the form and already have a page id the thing should initialize itself and show the path to that page. Seems like this wheel has to have been invented several times already. I did something just like this, but not PW and the JS was a bit ugly, several years ago but I'd think there must be slick and well tested UI library solutions now. Just can't seem find them. Jquery Option Tree (demo #6) is close but not quite right. Easy enough to setup PW to handle AJAX requests by sending back JSON of the child page's ids and labels. The rest can be jQuery events and functions. Should I be thinking of it as a FieldType for a Page field or just PHP/JS to throw into a template file? Pros and cons? Thanks.
  8. Whoops. My fault entirely. I didn't type what I thought I'd typed and my selector made no sense.
  9. FYI, PageAutocomplete seems to only work for pages with a common parent. That's not going to help.
  10. The names of the pages are not terribly useful but PageAutocomplete is probably fine for the back end. On the front end side of things, special users will have a page where we do this selection but they will need to be browsing them as thumbnails. I have something AJAXy in mind for that combining navigation and thumbnails with the "transfer" idea of SelectMultipleTransfer so they can browse around and collect the ones they want.
  11. I'm looking for a good way to manage a page field which needs to select a small number of pages (usually fewer than 5) from a large number of available pages. There are about 10,000 pages to choose from and they are organized as children of about 1000 parent pages. I have those parents organized by A to Z if we want to do this with three levels. Dependent selects almost works. I tried having a select for the parent and, dependent on that, a SelectMultipleTransfer to choose child pages but when you change the parent selector it clears everything you've selected so far. That's not going to work. Maybe there's a trick involving options/mods to the jquery widget? Any thoughts? There has to be something more efficient and user friendly than a single paginated list of 10,000 items. Thanks
  12. SteveB

    other CMSs

    An automagic solution I like to use in cases like that is to have a filename convention which indicates the desired image parameters (PW does this) and have a PHP page setup as 404 handler. If the image doesn't exist the script runs. If the image request is plausible make it, save it, send appropriate headers and the image content, quit. Yes, there's a pause while this happens but once the page exists you're all set. There's a bit more to it. You must protect against floods of requests!
  13. Interesting but I don't see anything in there to actually carry out add/delete of PW pages. How's that supposed to work?
  14. Try this: if (! $homepage->id) { echo $page->title; }
  15. Craig, have a look at: https://github.com/conclurer/ProcessWire-AIOM-All-In-One-Minify/issues/17#issuecomment-47402040
  16. Dazzyweb, thanks for posting this. Are you finding the "build your own component library" features to be as good as the built in support for Bootstrap, Foundation, etc? I get a lot of mileage out of using developer tools' Inspect tool in the browser along side my editor but Pinegrow makes that seem so primitive.
  17. He's right. It's working for me in my application. Thanks Stikki.
  18. The other one I see surprisingly often is peak instead of peek. You climb peak. You take peek at a website.
  19. Nice one Pete. Eventually I'll revamp my website and sign up. In the disclaimer on the /developers pages, "innaccuracies" only needs one n. Kind of a shame to fix such a nicely ironic typo though.
  20. Just FYI: Noticed this error when installing DiagnoseModules.module on 2.5.10dev today though it seems to be working just fine. DiagnoseModules::getModuleConfigInputfields() or DiagnoseModulesConfig->getInputfields() did not return the expected value (InputfieldWrapper) MySQL Collation: Also have a question about warnings regarding MySQL Collation. Does this account for the fact that you can set collation at the Table level as well as at the Database level? It looks to me as though it ignores the settings on the individual tables. Do a query like " show table status from my_database;" to see them. Often the database is set Latin-1 (mysql default) but the tables are UTF8 because the application (or person) intentionally managed that aspect.
  21. A workaround for Issue #30 - CSS urls when PW installed in subdirectory // ------------------------------------------------------------------------ // Load source of file and rewrite absolute URLs. // ------------------------------------------------------------------------ $_css_src = file_get_contents($stylesheet['absolute_path']).PHP_EOL; $_css_src = (!empty($_css_src)) ? Minify_CSS_UriRewriter::rewrite($_css_src, dirname($stylesheet['absolute_path']),wire('config')->paths->root) : $_css_src; //SB: My fix for issue #30 about paths in css image urls. Compatible with Soma's fix for #20 in which you specify the path in css file starting with /site. //Issue 30: When pw is installed in a subdirectory aiom omits the subdirectory from paths it makes for css image urls. //Allows dev site's pw to be in doc root and deployed site's pw to be in subfolder (or the other way around) and have same css work on both. //1. Specify image urls in css without any path (e.g. background:url(T-on75.jpg)) //2. Put the images in templates/styles/ $rel = str_replace($_SERVER['DOCUMENT_ROOT'], '', wire('config')->paths->templates); //relative path to templates from doc root. Maybe /subfolder/site/templates $_css_src = str_replace('url(/site/templates/styles/', 'url(' . $rel . 'styles/', $_css_src); //processed url: /subfolder/site/templates/styles/T-off75.jpg I'm using this on AIOM 3.1.4b with the following... https://github.com/conclurer/ProcessWire-AIOM-All-In-One-Minify/issues/17#issuecomment-47402040 (My change to _getCacheName) https://github.com/conclurer/ProcessWire-AIOM-All-In-One-Minify/issues/20#issue-40582619 (Soma's fix mentioned above) I use this in my template files so urls in $config->styles pointing to hosted libraries are not messed with: foreach ($config->styles->unique() as $path){ if(preg_match('#^'.$config->urls->templates.'styles(.*)#',$path,$m)) $path = AIOM::CSS('styles'.$m[1]); echo " <link rel='stylesheet' type='text/css' href='$path' />\n"; } Enjoy!
  22. This worked great on my local server but when I installed it on the real server pages with email addresses fail. I get ERR_EMPTY_RESPONSE. I wasn't able to find any more clues but if I ever do I'll let you know. Both setups are running 2.5.10 dev.
  23. Thanks from me as well. These lines in my template file plus adding alt to the img tags in the theme made my good friend the W3C validator happy. $options = array('title' => str_replace(' ', '%20', html_entity_decode($page->headline))); $soc = str_replace('&', '&', $modules->MarkupSocialShareButtons->render($options));
  24. Wouldn't it be easier to extend the page class, adding your methods and properties and still be able to work with these new superDuperPages with all the usual API tools? Maybe you telling us more about what you hope to achieve would bring better answers.
  25. I've run into long waits for thumbnails too on a site where some frontend pages have up to a couple hundred thumbnails from rather large source files. I'm also using tiny thumbs in the backend page lists. In normal operation with template caching and routine editing it's fine but during setup it was insane. I wrote a script which uses the API to see which variations are not made yet and make them. Before turning it loose you can use assess method to just get a report. Returns a handy array to use in other processing scripts. It's alpha, not gift wrapped and polished, but I can make it available somewhere if anybody wants it. Example of usage below. This puzzles me: While my script is building images all other PW activity pretty much grinds to a halt (that's not the puzzling part) but other pages on the site using PHP/MySQL independent of PW continue to work just fine. They use a different database so maybe some db lock/transaction thing is holding things up? $fab = new imagePrefab(); $fab->background = 1; //don't make browser wait $fab->verbose = 1; //Yes we want some feedback... $fab->setLog(); //...in a log file $ok = $fab->setBuilderCallback('buildImageMyWay'); //optional callback function if(!$ok)die(" Callback function not found at ".__LINE__); $data = $fab->build('my-template', 'image', array(array(48,48),array(110,110),array(800,0)));
×
×
  • Create New...