Jump to content

horst

PW-Moderators
  • Posts

    4,088
  • Joined

  • Last visited

  • Days Won

    88

Everything posted by horst

  1. Hi reems, thanks! Yes what was needed was to collect the ids of the main- and sub- levels too. The above posted renderNav4 function need no changes then. Just passing an array with involved main-, sub- and page-ids to it works. The only thing I would do a bit different is to collect the ids in assoc key=>value arrays: // $myArray[] = $page->id; $myArray[$page->id] = $page->id; This way you don't get double or multiple entries (no need for calling array_unique), but much more important: you are able to check for existence of an id by calling if(isset($myArray[$id])) what is much, much faster than if(in_array($id, $myArray)) So, I think this only becomes important with huge arrays and a high amount of calls to the function.
  2. Hi reems, this sounds really good and I have tried it out. I use a slightly modified renderNav function from the current dev branch minimal site profile for that. But unfortunately the page ids of the main and sub pages are not within the matches of a search query. With this way to generate the sitemap / search results output it does not work. // $items always is the homepage // $matches is an array with key-values the same: $matches[id] = $id; function renderNav4($matches, $items, $maxDepth = 0, $fieldNames = '', $class = 'nav') { // if we were given a single Page rather than a group of them, we'll pretend they // gave us a group of them (a group/array of 1) if($items instanceof Page) $items = array($items); // $out is where we store the markup we are creating in this function $out = ''; // cycle through all the items foreach($items as $item) { if('site-map'==$item->name) continue; $show = isset($matches[$item->id]); // markup for the list item... // if current item is the same as the page being viewed, add a "current" class to it $out .= $show ? ($item->id == wire('page')->id ? "<li class='current'>" : "<li>") : ''; // markup for the link $out .= $show ? "<a href='$item->url'>$item->title</a>" : ''; // if there are extra field names specified, render markup for each one in a <div> // having a class name the same as the field name if($fieldNames) foreach(explode(' ', $fieldNames) as $fieldName) { $value = $item->get($fieldName); if($value) $out .= $show ? " <div class='$fieldName'>$value</div>" : ''; } // if the item has children and we're allowed to output tree navigation (maxDepth) // then call this same function again for the item's children if($item->hasChildren() && $maxDepth) { if($class == 'nav') $class = 'nav nav-tree'; $out .= renderNav4($matches, $item->children, $maxDepth-1, $fieldNames, $class); } // close the list item $out .= $show ? "</li>" : ''; } // if output was generated above, wrap it in a <ul> if($out) $out = "<ul class='$class'>$out</ul>"; // return the markup we generated above return $out; } Using it this way produces only a list of pages, not the hierarchical structure of the sitemap. I need the main and sub branches, but only where they contain at least one page in matches. Any other ideas or tips?
  3. On a little site I have a pagetree like: home main sub page page sub page main sub page sub page page main ... every page use the same template, every page has a tag field with a string shown as above (main, sub or page) The same structure is used for the navigation and sitemap on the frontend too. What I would like to achieve is the same presentation for search results. Therefor I need a results array ordered this way. Is it possible to cover this with the search selector only? The amount of total pages is less than 100 and ever would be less than 300 in the future too. The pages are fetched from a big german online electronic kompendium. I need the site to filter only the very basics from the online site which seems to hold many thousand pages. It is for local / private use only. (for my son as a searchable reference)
  4. As you define the sizes by yourself when setting up a field, you may add this manually into the template code where needed. But you can also get it programmatically like interrobang has done it here: https://processwire.com/talk/topic/4437-delete-orphaned-filesimages-from-siteassetsfiles/#entry43750 search for this lines: $crops = $field->getArray(); $crops = $crops['thumbSetting']; $crops_a = explode("\n", $crops); // ie. thumbname,200,200 (name,width,height)
  5. this is wrong, imagesizeroptions apply to _all_ images that imagesizer handles. => https://processwire.com/talk/topic/6848-recognising-image-orientation-on-upload/
  6. also the link to API needs change to DOCS
  7. @reems: do you know that you can set a maximum length for images in the images fields? admin => setup => fields => (click to edit your images field) => tab input :: look for "Max Image Dimensions"
  8. You should try to have major version in sync, PHP should be both 5.3 or 5.4 Also the minimum requirements for PW are: (not 5.0.10 or 5.0.8) regarding 5.0.8 see also: https://processwire.com/talk/topic/7034-check-for-new-modules-causes-internal-server-error/
  9. (my like is for this)
  10. horst

    ED DESIGN

    Great Site! I have chosen the german language on the desktop (win7 FF31) and mobile (iOS). Everything looks very good. My only thought: maybe the navigation arrows under the sliders should also be visible on the desktop? Have found 2 or 3 typos: not sure about a typo: "unter der Verwendung eines der fexibelsten Content Management Systems." => should it be "... Content Management Systeme." ? sure a typo at page signature: "komminiziert" => "kommuniziert", "Merzedes" => "Mercedes" typo (or not?) at http://ed-works.com/de/projects/small-mobile-big-hands/ : "wurden mehrerer Notizbücher" => "wurden mehrere n Notizbüchern" ? "Radaktion" => "Redaktion" I wish much success and good customer!
  11. @LostKobrakai: You are right, but only to, maybe 80 - 90%. I also can understand pwired a bit. Just imagine the client from your example chooses PW one day because it supports 1-click theme-switching for those who are willing to use it. Additionally to that he can import a whole WP-blogsite content by using the WP-migrator with only clicking two or three buttons. What do you think does this do to him if he later on want to extend his site with a cool shopping cart, a newsletter system and some other shiny things he has read from here? I bet he think that this can be done with just clicking some buttons, because he has changed to PW because he has heard this is better than XY before. Also his first steps really only needed some simple clicks. So why should he think that this cannot be done that easy? Also the community is so friendly and helpful. - If he has only little or no HTML/CSS skills and no PHP/JS skills, (and maybe he also has no interest in learning this), I only can say: good luck and a lot of patience with such new users. So, it will be different with those who are able and willing to understand the differences of application modules. We should do it in a relaxed manner. One of the best goods here (besides PW itself) is the helpful and kind community. And it takes time to "assimilate" new users from that spectrum. Also I think it only could be a small amount at a time. - The worst case would be if they try to assimilate us
  12. @reems: if there are all images already created, the imagesizer get not involved. I bet there are not all imagevariations created now. But 30 seconds is far to long for only 80 images. Maybe there is one corrupted image in or what ever. To get rid on it you may debug on which imagefiles it is called. This way you can track down the issue, I hope. If you have this on your local host you simply can add a line into the imagesizer file here, at the start of the resize function: $logentry = $this->filename; wire('log')->save( "debug_resizes", $logentry); This way you get a list in site/assets/logs/debug_resizes.txt with all filenames on which the imagesizer is called. (site/assets/logs/ must be writeable, what it should be by default) Just empty or delete the logfile if it contains previous entries and call your admin page that causes the issue only once and inspect the logfile afterwards. If you need further assistance come back please.
  13. Does it show this every time or only once or only sometimes? "2006 MySQL Server has gone away" can have different reasons. As it states there, it is a "General Error", not a specific. One reason can be that the MySQL server is very busy (shared host?) and you run into a timeout. Another reason could be that a previously used connection was lost and it couldn't be re-established. This was the behave with the PDO-class in the past, but this was fixed in early march this year. Which PW version have you installed now? If you use 2.4.0 (stable) you have this bug. Then you should go to the dev-branch and get the WireDatabasePDO.php file and copy this over your existing file from 2.4.0: wire/core/WireDatabasePDO.php If you have installed the latest dev branch allready, it has another reason.
  14. @Hari KT: In the whole time since your first patch (5 month until now), it occured max 2 or 3 times, not more, but also not zero. Thanks for sharing your code!
  15. maybe more is to read here: https://processwire.com/talk/topic/4792-festival-site-with-processwire-and-ajax-boom-festival/ ------ Edit: A very good site @benbyf. The only thing that I (personally) would change is the behave when clicking on a photographers name: one should get the "Main Gallery" directly, no need to click two times before seeing the first photo. / but also a bit nitpicking, I know
  16. http://processwire.com/talk/topic/771-is-there-a-way-to-get-a-db-backup-from-within-pw/#entry6452 http://processwire.com/talk/topic/3052-open-dynamo-webspace-backup-tool/ https://processwire.com/talk/topic/771-is-there-a-way-to-get-a-db-backup-from-within-pw/ https://processwire.com/talk/topic/4653-how-to-make-backup-of-database/
  17. You should use http://buildinternet.com/project/supersized/ or search for superbgimage and use that one. Highly customizable!
  18. Until then you may use the WireMailSmtp class. It has to, cc and bcc functions and I think Ryan will use the same names for the functions.
  19. @Gazley: Here is a quote from Ryan:
  20. This is an Error regarding "ProcessCropImage" = Thumbnails You should look there, I think it can belong to this: https://processwire.com/talk/topic/643-release-thumbnails/page-17#entry66437
  21. You should post this into the formbuilder forum (only visible for registered form builder users) because it belonges there and the post gets better recognition there. (I don't know form builder, so cannot help here)
  22. He uses 2.3.0
  23. Ah yes, this one I have had sometimes with different text: "Undefined index: xyz". I've got this with modules on their first run.
  24. @adrian: doesn't you populate two times the value here? $f->attr('value', $data["allowedRoles"]); and: if(isset($data['allowedRoles'])) $f->value = $data['allowedRoles']; Which one should be used with the ASM ?
  25. You should check what you get with your find. For debugging you can drop in something like var_dump($slides); die('Manually debugged ' . __FILE__ . ':' . __LINE__); or inspect the $s and not the $slides, or both. EDIT: should have read more carefully before try to answer. Soma gave the right direction!
×
×
  • Create New...