Jump to content

Zeka

Members
  • Posts

    1,065
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by Zeka

  1. Hi @DL7 I think that you should stick with page field instead of options fields. It is much more easier to accomplish what you want with that field. Make read of this https://processwire.com/blog/posts/making-efficient-use-of-fields-in-processwire/#use-page-fields-rather-than-individual-checkboxes
  2. Hi @MilenKo Did you see these modules? http://modules.processwire.com/modules/fieldtype-star-rating/ http://modules.processwire.com/modules/page-ratings/
  3. Hi @phil_s Also check this blog post from Ryan Filtering out common WordPress files
  4. Hi. By $page->url(true) we can get a url with scheme and hostname. But $page->image_field->url(true); returns url without scheme and hostname. Is it expected behavior or just inconsistency between methods? How do you thinks, should these methods behave the same?
  5. Why just not use image field for that? http://modules.processwire.com/modules/fieldtype-assisted-url/ You can use Media Library for central management of your images http://modules.processwire.com/modules/media-library/ and use image field for selecting needed images in your matrix items.
  6. Also made small test with Ryan's module. Were added 9359 ( 3119 per minute) pages in 180s before timeout.
  7. Hi. In your code you find all pages with template "events", but as I understood you want to show some repeater items from "event@ page $items = $pages->get("/event/")->events_repeater; if($items->count()) { foreach($items as $items) {} }
  8. Hi. You should uncomment this line in .htaccess and change "pw" to the name of your folder RewriteBase /pw/ Also, there is a branch of similar topics:
  9. Yes, it is. "templates/admin/..." by default would be ok. But what about backward capability, if there is no check for the root of templates folder?
  10. @Stefanowitsch Thanks for tip, but it isn't relative to HTML minifying.
  11. Hi @tpr! I want to propose some improvements in auto-loaded files. By default these files are loaded: /site/templates/admin.css: CSS file loaded for the entire admin /site/templates/admin.js: JavaScript file loaded for the entire admin /site/templates/cke.js: JavaScript file loaded for CKEditor fields /site/templates/cke.css: CSS file loaded for CKEditor fields /site/templates/templates.js: fallback for the CKEditor "templates" plugin templates From the point that we try to keep templates folder as much structured as possible, it would be great that auto-loaded files, by default, will be loaded for example from "templates/admin/" folder. It also would be conveniently when you use some task runner as Gulp. It that way you can create one task for custom admin assets. Tough, we have settings for custom assets path, it is not very handy to set these paths on every new project. So I want to propose to change how files are auto-loaded by default: 1. AOS looks for files in "templates"; 2. AOS looks for files in "templates/admin"; 3. AOS looks for files in custom paths. What do you think about it?
  12. @Sephiroth What about caching and performance? Does Smarty module respect template cache settings or it has an own caching system?
  13. Hi Look through these links: http://modules.processwire.com/modules/template-engine-factory/ https://github.com/fixate/pw-mvc-boilerplate http://modules.processwire.com/modules/template-file-helper/
  14. I just tested it with the new commit and it works as expected.
  15. Looks like my question was not clear enough, so I'll try to make it more clear. I have a page with products listing. The structure of this page looks like this: Because there is a lot of dynamic parts on a page I can't use template cache, so I stick to MarkupCache and WireCache. Every product's card cached by MarkupCache. Also, there are different sorting options which I want to cache by WireCache: $sort = ($input->get->sort) ? "sort=" . $input->get->sort. "," : "sort=title,"; $products = $cache->get("products-{$sort}", "+10 minutes", function($pages) use($categories, $sort) { return $pages->find("template=product, product_category|product_subcategory={$categories}, sort=product_stock, {$sort} limit=100"); }); It works as expected and I get cached arrays limited for 100 products in DB and outputted list of 100 products. But I want to list only 20 products per page, so I have to limit find method for 20 items: return $pages->find("template=product, product_category|product_subcategory={$categories}, sort=product_stock, {$sort} limit=20"); echo $products->renderPager(); It generates cached arrays for 20 products and renderPages method for the first page load, when there is no cache, will see all products and will output pagination markup, but for the second load, when $products variable loads from cache it will see only 20 items in cached array and will not output pagination markup. How can I cache array and the get pagination markup from it?
  16. Hi. I just found out some strange behavior in selectors. There are two snippets of code with small difference in order of selectors. First example returns all pages which match "has_parent" selector even if they are not "blog-post" template (not expected result) , but the second one returns only "blog-post" pages ( expected result) . $categories = $page->children("template=blog")->add($page); $items = $pages->find("template=blog-post, has_parent={$categories}, limit=7"); $categories = $page->children("template=blog")->add($page); $items = $pages->find("has_parent={$categories}, template=blog-post, limit=7"); Is there any documentation on how order of selectors affect the results?
  17. @kongondo Thank you for explanation
  18. Hi @kongondo Are these two methods the same from the point of performance? $pages->find('template=posts-content')->count(); $pages->count('template=posts-content');
  19. Hi. I'm doing the first steps in using wire cache, but I ran into a problem. Here the code that I use to save and get cache: $categories = getAncestors($page, 2); $cacheNamespace = "products"; $cacheTitle = "prefix__$page->id-$page->template-{$user->language->name}"; if ($input->pageNum > 1) $cacheTitle .= "-page$input->pageNum"; $allProducts = $cache->getFor($cacheNamespace, $cacheTitle, "5", function($pages) use($categories) { return $pages->find("template=product, product_category|product_subcategory={$categories}, sort=product_stock, sort=title, limit=5"); }); This code generates "products__prefix__1047-product-category-default" table in DB that contain paginated page array: {"PageArray":[1230,1095,1233,1142,1061],"template":48} Then I output pagination: echo $all_products->renderPager(); But it works only when cache expires and $all_products contain uncached array. So the question how to use wire cache in this situation? Zeka
  20. Hi @justb3a Sorry for being not clear enough. I want to extend image field by page reference field. But if I do so, I get just regular text field instead of page field. So it makes me thinking that your module works only with text-based fields and not with some more complicated.
  21. Maybe this module by Adrian is somehow relative to this topic
  22. HI @justb3a Does you module support "Page refference" field?
  23. Hi @Doug G I'm not sure, but it looks like that you can use old Skysrapers profile, but after installation you have to replace template files from this repo https://github.com/ryancramerdesign/skyscrapers2 and maybe make some changes according to instructions in repo
×
×
  • Create New...