-
Posts
687 -
Joined
-
Last visited
-
Days Won
4
Everything posted by matjazp
-
Pages with file/image fields require a directory. Why, if there is no image/file present? I use Clean Empty Page File Dirs module occasionally.
-
tpr, I was commenting BernhardB's video, not yours. When in admin, there is javascript config variable and config.url.modules points to core modules directory so that could be used in FEEL.lightboxJSpath/lightboxCSSpath? But config is defined only when page is loaded and you need the path before that...
-
fredi had problems with fields that are not full width and (as far as I remember) it closes the modal even when there are errors (eg. required fields not entered). I think new version of fredi is using "native page editing". As I can see on the video at the provided link, your version of edit-shortcuts also requires manual page reload?
-
Looking good! I also disabled/hid the Setting tab. You should mention in docs that jquery is needed. My development version is not on root so I had to adjust the path to lightbox css/js.
-
Could the script be modified so that popup (iframe) would close itself after save ONLY if there are no errors? You are hiding tabs with javascript and that can be seen on the video...
-
I would like that each user could edit just his/her "home" page and also add/move/delete/sort etc. pages beneath his homepag. I'm aware of some modules, like PageEditPerUser, PageEditPerRole, CustomPageRoles, DynamicRoles, "Page edit per user created id" by Soma and tinacous (and probably more). How to approach this in the most scalable way?
-
API how to delete files with hook "after page save"?
matjazp replied to Juergen's topic in API & Templates
Not tested, maybe $p->removeAll() or $p->delete($p->filename) -
Yes, quiet works (at least on 2.5.4), I used it recently on pages. I found the code somewhere here on the forum, don't remember the author.
-
$p = $pages->get(1234); $p->created = '2015-07-09 11:12:13'; $p->save(array('quiet' => true));
-
Sites with A (and B) grade are almost certainly using ProCache. In real life it is really hard to get A grade without ProCache. And yes, some CMS/CMF are faster. The best results are achieved with SSD (for data and for mysql data), tested myself, almost double the speed...
- 3 replies
-
- performance
- loading
-
(and 1 more)
Tagged with:
-
I have set $start = ($input->pageNum - 1) * 20; $newposts = $posts->find("limit=20, start=$start"); $newposts->setLimit(20); $newposts->setStart($start); and pagination (and rendering the posts) is working. But this is slower than having two "independent" queries: first $pages->find(...) just to get the authors and second $pages->find(...) to get the posts. Thank you LostKobrakai and tpr.
-
I use $posts->renderPager() method for pagination. $posts = $pages->find("template=post, limit=20"); $posts->getLimit(); returns 20 $posts->getStart(); returns 0/20/40 etc. $posts->getTotal(); returns 203 $posts->count(); return 20 $posts = $pages->find("template=post"); $newposts = $posts->find("limit=20"); $newposts->getLimit(); returns 0 $newposts->getStart(); returns 0 $newposts->getTotal(); returns 203 $newposts->count(); return 0
-
Is there a better way of finding all different post authors? $posts = $pages->find("template=post"); $authors = []; foreach($posts as $p) { $authors[$p->createdUser->id] = $p->createdUser->get("title|name"); } Later on I need a selector like this: $now = time(); $posts = $pages->find("template=post, !post_expires<$now, limit=20, sort=-post_created"); So I have 2 (redundand) queries, so I would like to "extend" the first query (performance?): $newposts = $posts->find("!post_expires<$now, limit=20, sort=-post_created"); but that way pagination is not working.
-
When attempt is made to edit non existent page (http://localhost/processwire/page/edit?id=9999999) this error is shown instead of 404: Error: Call to a member function attr() on a non-object (line 350 of C:\inetpub\wwwroot\PW\wire\modules\Process\ProcessPageEdit\ProcessPageEdit.module) This error message was shown because site is in debug mode ($config->debug = true; in /site/config.php). Error has been logged. Administrator has been notified. PW 2.5.4 dev
-
Yeah, trash is just for admins, forgot that. Now I have two hooks: one on Page::trashable intended for admins, to remove trash icon, as a reminder not to shoot myself in the foot, and one on ProcessPageEdit::buildFormDelete, where I can inform the user about possible consequences about deleting the page that is referenced from another page(s). I think it would be good to have that sort of functionality available in the core or installable core module (for example user should not get deleted if he owns pages). LostKobrakai, thank you for your suggestions.
-
I tried this: wire()->addHookAfter("Page::trashable", function($event) { $page = $event->object; wire('session')->message('trashable: '.$page->id); $event->return = false; }); With that hook the trash icon in page list is gone (for all pages of course), but I can still move the page to the trash. Also, I can trash the page in Delete tab (while editing the page) unless I hook to Page::deleteable.
-
I noticed something: when you enable advanced settings in config.php and set "Disable trash option" in templates System tab (API: $template->noTrash = 1; // or 0 to disable) the trash icon is not present in page list (when you click on move), that is ok. But, you can move page to the trash... is this expected behaviour?
-
I would like to prevent certain page delete (or move to trash) if it is still "in use" in other pages. I would like to hook in admin.php similar to https://processwire.com/talk/topic/5027-hide-page-instead-of-trash-or-delete/ wire()->addHookBefore('Pages::trash', function ($event) { $page = $event->arguments[0]; //do some checking wire('session')->message('just testing'); $event->replace = true; } ); but page is moved to trash and message is not displayed when I'm in the Page list (I click Move then Trash icon on the right). If I delete the page while editing it (In tab Delete and then confirm), it works as expected. What am I doing wrong? In debug tools hook is listed: before Pages::trash() anonymous function() class method 111
-
@jordanlev, thank you for your thoughts, I was facing with similar problems. I quite like how edit pages works, but for end users I needed something just a little bit different. I didn't want to reinvent the wheel so I ended up creating my own ProcessPageEdit module, based on the original. There I hid the tabs (now we have module for that) and changed the logic about saving and redirecting. Then I didn't want header and footer, so again, I just grabbed AdminThemeDefault and made my own theme, where I get rid off unwanted stuff. I can elaborate further if needed.
-
What is the purpose of Check field data in Fields -> Advanced? It reported: pages_id: 14, data: Edit Template pages_id: 15, data: Add Template pages_id: 12, data: Templates pages_id: 19, data: Field groups pages_id: 20, data: Edit Fieldgroup pages_id: 17, data: Fields pages_id: 18, data: Edit Field What should I do? I just saw new tab and deleted the orphans
-
@Beluga, I already saw post from jordanlev. @Ivan, I know I can find a ready to use solution, we already have one, my question was more hypothetical. Thanks for your opinion.
-
Let say that I need enterprise application for inventory of the equipment. The firm buys 100 laptops. Each laptop would get id number (automaticaly generated), name, location, date of purchase, responsible person etc. The user would need an option to modify & delete the items, make a search base on all fields (eg. what items are located in specific location, what are the items older than 5 years) and make reports as PDF. Emailing is not needed at this point. As I noticed in the video for form builder, collected data from the forms could be put into pages. The amount of data would be in range of 10.000 items per year and would need the archive for at least 10 years so 100.000 pages is bare minimum.
-
I need an advise. I might need the "custom application" (nothing specific in mind) and I'm not sure how to start. I could create forms by hand (<input name=... type=...>), I could create forms in PW way ($f = $modules->get("InputfieldText"); $form->append($f); etc.) but I would like to do it more "visually". I could use FormBuilder (never used before, just saw the video). I could render the forms from templates, like in the admin area (ProcessPageEdit.module?). I could make my own admin theme as full blown admin would probably be too much. What is you advise? How to start? Thanks!
-
Me too
-
I had to add extension=php_fileinfo.dll to php.ini on windows environment...