• Content count

  • Joined

  • Last visited

Community Reputation

42 Excellent

About OLSA

  • Rank
    Full Member

Profile Information

  • Gender

Recent Profile Visitors

2,218 profile views
  1. Hello. There are few possible problems with centralised concept. As example, what to store in that images field? To be more clear, if some image is part of PW page only as reference link, than how can we resize it (eg. "on the fly" in page rendering process)? What would happened when someone delete image on that external point - how would ProcessWire page know that? Etc... Because of that, if I go to build that module/field type than probably it will copy image from that external central point to ProcessWire page. With that, we can have external Media manager where we can use all it's power (organise files to folders, search etc.). Also, because we have on PW side copy of that file we can use all PW API power to manipulate with it - on PW side. Here was few discussions why PW by default doesn't have "Media manager" like many others CMS's (I was one with that question too) but very soon undrestand that maybe because of that some other popular CMS's still doesn't have simple solution to store and generate various dimensions intro images. If some CMS's had that option, need to look closely to see how and where they store eg. that intro images... Storing concept is very important (eg. in case when need to do some export or imports). That what you ask is completly ok, but also it's important to think about possible consequences. What I like in centralised Media manager idea is 1 central point for file organisations, all other with that idea bring us problems and complicate things. Regards.
  2. After all, write small function to locally test resizing of images (using default PHP GD image library) and find that this images are not 100% valid (semi corrupted jpeg files). Strange thing was, as you can see here (first two images) looks normal. Same PW on Windows with PHP >=7.1.9 works fine - no problems with upload and resize. Inside PW logs, Tracy debugger, Wamp/PHP logs, custom core debugging, didn't find any exception/note about "Corrupt JPEG data" (maybe because error suppression operator (@) in few places inside image processing/pw core). Also playing locally with PHP getimagesize() return correct image data (size, bit, channels, mime...) for all that images . Etc... If you ever had a problem with upload/resize images, and on server use PHP GD enginee, and images looks ok, maybe there is a problem with small file corruption. In that case you can try to put this in site/config.php ini_set("gd.jpeg_ignore_warning", 1); This will not fix corrupted jpeg image, but will provide that PW image processing do job and doesn't break. Regards.
  3. Hello for all. I have strange problem with images in PW 3.0.62, wamp, PHP 5.6 - 7.0.23, (Windows 10, i5, 8GB RAM). 1. Can't upload some images, process failed in first step (thumbnail preview creation). 2. Images can be uploaded/saved using API, but later in admin backend, there is no preview thumbnail image. It can be opened and zoom, but can't edit/crop/resize . 3. Everything works fine in PHP 7.1.9 Warning and errors: "Warning: filesize(): stat failed for .../site/assets/files/image-name.jpg in ...\wire\core\Pageimage.php on line 511" "ImageSizer::resize(0, 260) failed" "ProcessPageEditImageSelect: Unable to complete resize" I have large number of images with that problem in current project, and if someone want to test this, I attached two "bad" images, and screenshot from admin backend. Don't know is this some kind of ProcessWire issue or there is some problem with images? Please, what is yours opinion about this? Thanks.
  4. @hezmann If this works for you, than I mean that also you can try this example what is in basic the same what Robin S write in first answer: //please note template in selector, in this case go from top to bottom $walk_segments = $pages->find('template=walks, children.children.start_town.marker.continent.title="Europe"'); foreach($walks_segments a as $thewalk){ echo $thewalk->title; }
  5. Hello. Dont know if I understand you well, but maybe this: // get childrens what are in desired continent $europe_walks = $pages->find('template=walk-segments, start_town.continent.title="Europe"'); // or can use selector with continent page id eg. "start_town.continent=10050" $variations = array(); // can use this inside foreach to store page arrays id foreach($europe_walks as $variation){ echo $variation->title . "<br>"; //Walk Segments echo $variation->parent->title . "<br>";//Walk Variation echo $variation->parent->parent->title . "<br>";//Walks } Second option can be this: //directly get walk variations $europe_walks = $pages->find('template=walk-variations, children.start_town.continent.title="Europe"'); Regards.
  6. Hello for all. @Vigilante Maybe this module can help in that situation? How it's works and what it's does: 1. it use customised nestable jquery plugin 2. it clone current PW pages tree 3. provide drag and drop options with parents and childs 4. provide easy option to manipulate with tree (eg. hide children from desired parents) 5. store pages tree list in JSON format, and every list item has attributes (page id and "slug") 6. don't need to build desired website pages tree on-the fly (with complex logic and if statements) in page rendering process Note: to render menu need to create simple function (eg. inside _func.php ) Maybe looks complicated at first sight, but I think it's worth a try. Link to description and download. Regards.
  7. Hello @Kongodo and thanks for this module, I am always in a hurry, and probably that is the reason why I still can't find right solution how to use this field. Please can somebody write short instruction how to get this on attached image using this field? Thanks.
  8. Hello for all, this is old question (and problem) - what is the best option to allow clients to place images inside text in editor field ("body")? Please note that I am not meaning here about default editor image button, because that is bad for administration, clean text data, responsive design etc... My client request is to get them option to create rich content like on many popular world news portals. As one example they want option to insert gallery in some part of text. My answer was that with PW are many, many options how that could be solved - but need to find what is the best for all (user friendly for "editors" (role), clean data storage, manipulation with data and frontend rendering). There are options like using custom markup tags (eg. ![images](1,2,3), or PW Hanna code [[images=1,2,3]]) or another option with repeatable block (editor + image field). What I don't like with markup tags is storing custom (strange) txt format in field, and not so user friendly (could be optimised with custom editor plugin). Using repeatable block can be more user friendly than using macros, but repeatable blocks, are repeatable... and want to avoid later complexity (export, import...). What do you think about custom editor plugin what would insert this: <figure data="1,2,3"><!--data attribute store images ordering number--></figure> In that "empty" figure HTML tag we can store on-page images ordering number using data attribute. To make it visible in editor we can use custom editor.css... That editor plugin can be "button" what would open some modal or popup with options to select on-page image(s). Later in frontend it's not problem to use some PHP HTML parser (eg. Simple HTML DOM Parser) to get and replace figure HTML tag. Please what is your suggestion about this request? Thanks and regards.
  9. Hello, Try to add at the top of your included form1.php this: namespace ProcessWire; Regards.
  10. Bravo diogo! There is no option to give you 10+. Please don't be like others communities where is restricted to tell the true. Processwire is developer oriented platform and need to write code if you want to do custom things. Not like in Joomla or Wordress where you can install template and do things without coding, but also many of us here were there ( for years) but stay with Processwire. Regards.
  11. No, no in this product had very large place for clean categorisation. It is very easy to separate tools and showers or tiles or parquet or painting colors... Except, had that problem on category level, but for that use "tags". As example, in category "Tools" are about 100 products, but also inside that category had tags "for painting", "cleaning"... Also know what are you talking here, as example in some rental site some house can go to rent and sell at the same time (that was my client request in one project). Solved that without problem using "tags". Low level item is property, but same property can have various status... Also property can be house, flat, ship...whatever...
  12. This is off-topic, but here is drag and drop JSON tree page module (or menu manager) what I build inside this project to solve client task to get much as simple solution to manipulate with Main menu (and all other website navigations). Also, please that this topic go in same direction as it started. This is only short of-topic. What this module do: 1: clone page tree and build JSON string (it's good if you have few thousands of pages), and in rendering you don't have in runtime to build main menu 2: if you have some special cases where need to do some correction for main menu, you can do it very fast and easy (do not need to "move" DB large page tree, you "moves" inside small JSON) 3: you can save ("export") somewhere current tree, and experimenting with menu 4: you can create page tree Menu, and child "Top menu", "Sidebars", "Fotter menu" etc... I build this for this project, and main target was to leave real PW page tree, but add options to manipulate with that if needed. Also one of target was to get faster page rendering, done testing (in this project with >2000 pages, get faster pages rendering about 25% and more). How to use it: 1) download attached zip (at the bottom of this message) and install like any other PW module 2) create "JSON tree" type field and place it on some template ("menu", or if you like place it on "home", or...) 3) you can add pages one by one (first tab), or if you have large page tree, in second tab set your "max deep level", set what parent you want to skip their children, and press "Create list" 4) press Save 5) now you can drag and drop and create custom tree (and after changes press save) How to edit some list item: Press on some list item button "pencil/edit", and in the bottom you will get that page selected, change that to some another page... And press Save. How to create "Label" item, in next version that would be different, but now it's can be done: 1) Create template "label" (only title field), create some pages ("labels"), and after select that pages inside JSON tree and append children to it (drag and drop). 2) In rendering process check if template=='label'... How to render page tree (Menu): As example, call: // field is on page with id 3600 // fieldname is "tree" $menu = $pages->get(3600); // var_dump($menu->tree); echo mainMenu( json_decode( $menu->tree)); // mainMenu is method in function.php, there you go through tree and create UL,LI... NOTES: 1) What is inside "mainMenu" function? Do var_dump(...) before function call and will understand what that function need to do. We have JSON objects with attributes, eg. "pwid" store page ID. If you don't build multilanguage websites, you don't have to call PW page (there is also attribute "slug"). // function.php // you need to create function inside function.php // this is only example function mainMenu($items){ $out = ''; foreach( $items as $item ){ // please note main attribute "pwid" it's store PW page id $i = wire('pages')->getById($item->pwid)->first();// in my example need this because multilanguage project . . . . } } This module is totally unpolished (first version). Here are few screenshots: - First image shows process when module clone PW page tree where you can add desired pages to list. - Second image shows option where you can add pages one by one, or select multiple and add. - Third image shows what happened after you press button "Add to list" or "Create list". Regards. FieldtypeJSONtree.zip
  13. Thank you Zeka, Can't use this concept because, as example, they have category "faucets", and there are "faucets" for kitchen and for bathroom. Also they have "colors" for wall paintings, "floors" (wall tiles for kitchen or bathrooms can be the same product), and there are other examples where can't use that principle (divide products by area)... Also, grouping categories really helps to get cleaner administration, but also get me in another "problem" where I get unbalanced page tree (levels), as example: 1) products: - faucets ---- faucet-product-1 ---- faucet-produc-2 . . - floors ---- parquet -------- parquet-product-1 ---- laminate -------- laminate-product-1 I use PW few years, and build many custom things (not polished yet to put it here, but will do it for this great/the best community), but never use PW concept with URL segments. Read about that, sounds to me very interesting, but never had time to investigate, how and when... Yes thinking about that, but that not decided to use that concept because in administration would be chaos (initial content is ~2000 products, but client has plan to place 10 to 20 000 products, build importers..). Also for ajax, filters.. in backend is "easier"... "where parent category is my parent"... In all I agree with you, but sorry because in first topic, I didn't write other details about this website. Thanks.
  14. Hello for all, these days finishing project what is combination of e-commerce and portal website. Problem is "Products" page-tree because content need to be divided inside 48 categories. Also the client gave me content divided in 68 categories, but at the end they accepted my proposal about reducing that number. But problem is that and with 48 categories in backend, "Products" page tree is very large, long list, and very hard for administration. On front-end mega-menu with labels (menu group headings) solved that problem for vistors. And, at the end, I decided to test variant with additional categories to group categories, and result is good (now it's easy for adminsitration to find what they want very easy). Problem: now urls are longer, and in some parts (categories) not sure how that's can affect on SEO (eg. before: "products/showers/some-product", now: "products/showers-and-bathtubs/showers/some-product"). There are few more examples like that. And another thing is that urls are now longer (more characters, and deeper). For better administration I added new level of categorisation - I think - that is not a way to go. What is your opinion or suggestion about that? Maybe different, custom admin template, with custom navigation, or some folders? or ...? Thanks.
  15. Thank you Robin S! "status=published" solved my problem. I was sure that eg. outlet=0 or outlet='' will work and didn't think that there might be some new selectors (need to read this). No everything need to be simple as possible. If in edit procedure product doesn't have visible group - it's not in a group. Group is "virtual" product item (can change...), not like "TV" or "sofa", and because of that administration can do with group what they like (eg. update: change image and append new product to group). Probably, after they sell "group item", they will delete group page. Here is more important to delete real products (if no products, no group) . Ok, very interesting, will try it. Thanks Robin S.