-
Posts
4,632 -
Joined
-
Last visited
-
Days Won
55
Everything posted by apeisa
-
Nice on Georgson, totally forget to update that. Here is little mention about PW also: http://doteduguru.com/id8671-really-why-django-and-rails-cms-are-so-rare.html
-
I'd say it is super rare situation when client needs to delete 20 users, so that shouldn't be a high priority or dominate the UI design. Adding 15 events/pages is a more common situation. While I think creating multiple pages is already pretty smooth, that is something where "power tools" comes in handy. I think there are already bunch of modules to allow batch adding/removing/editing of pages? When we start adding all the features to the core, we are soon having more buttons and actions than Word has.
-
DaveP: thanks. I got this solved just before your tip. I ended up using pretty much similar solution, used this logging just in the beginning of 404 template: $log = new FileLog($this->config->paths->logs . 'mysterious404.txt'); $log->save("url: " . $_SERVER['REQUEST_URI']); And then I noticed, that few urls that had , in their ?get=something,like,this That alone doesn't do any harm, but in that site I had autoload module, that did some redirects (hooked to pageNotFound). There i had this code: $url = $_SERVER['REQUEST_URI']; $url = $this->sanitizer->selectorValue($url); $p = $this->pages->get($url); if ($p->id)... That ->get($url) was the part that was causing problems. I have now simplified that redirect module so that it doesn't need to make that get query at all anymore. Thanks all for your help (and Ville from our office!).
-
Thanks guys. Luis: Google Analytics doesn't show anything, I don't think it get's a change to log those requests, since exception is thrown. Soma: my guesses are on same line. Wanze: in few places yep, but so far haven't found anything where I don't run those through sanitizer.
-
Luis, great case study. Is the software available for purchase somewhere?
-
I am getting this kind of error messages in regular interval (about every 5 minutes): I suspect that it is caused by some bot or other program that queries some url of our site - since I get equal amount of emails day and night - and they are always by guests, never logged in users. Also client haven't noticed anything strange. I haven't figured out how to duplicate that issue. Any clues how I could get more information what is causing that? I have tried all kind of obscure urls on my site, without any luck.
-
[Solved] First PW cron job--tips on getting started?
apeisa replied to MarcC's topic in General Support
I don't know, but would guess that it would just throw error when you save archived page in admin. You don't have to remove it though, you might check the parent also (if page is already in archive, don't move and save). -
[Solved] First PW cron job--tips on getting started?
apeisa replied to MarcC's topic in General Support
It gives you the page that is being saved. wire('page') would give you the admin page (page edit -page). That event stuff feels little mysterious when you're starting with autoload modules, and it you will grok it soon. Lots of information here on forums about it. -
[Solved] First PW cron job--tips on getting started?
apeisa replied to MarcC's topic in General Support
You could do this via LazyCron, but since you probably want to archive it right away you save the page, I think most logical place would be just hook into page save process. This should get you pretty close (written in browser): class MovePage extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Move page after saving it with certain value', 'summary' => 'Modules are easy and fun.', 'version' => 1 'autoload' => true, ); } public function init() { $this->pages->addHookAfter('save', $this, 'hookSave'); } public function hookSave(HookEvent $event) { $page = $event->object; // No need to to anything, if field isn't archived if ($page->my_page_field->id != 1234) return; // If it is archived, then we remove the archived (this avoids pagesave loop $page->my_page_field->remove(1234); $page->parent = $this->pages->get("/archived/"); $page->save(); } } -
[Solved] First PW cron job--tips on getting started?
apeisa replied to MarcC's topic in General Support
You change page parent and save it. -
Nope for clients and when I am developing it takes very little time to first loop and echo and then loop and delete. But I agree that there definitely are developers and clients who would prefer admin tools for that kind of functionality. I just don't personally think that as a high priority since those are quick to do from API.
-
9 out of 10 of our sites need recursive navigation and Soma's module solves 98% of those needs. Visit function on the core: I like the idea - though really hard to say how much use it would get.
-
Module - Shop for Processwire - Selectable options and the cart
apeisa replied to NooseLadder's topic in Modules/Plugins
NooseLadder: I would like to keep PaymentExample as is, since it just introduces the core concepts. But maybe this is something that could be easily turned to invoiceToEmail: https://github.com/apeisa/Shop-for-ProcessWire/blob/master/PaymentInvoice.module -
Pete: why try to keep page alive when you could run it on background? Just show some message on page refresh, like when process was started if it's not finished yet. Maybe actions to restart backup if it seems to be unable to finish.
-
I always use api for bulk creating and deleting. Few lines of magic and superpowers.
-
Just add php comments like this: <?php // this won't be in page source code ?> Edit: fixed, thanks diogo
-
What kind of forum you need is all based on the needs of the community. My "built in three hours" discussions module runs nicely on www.martat.fi with almost 100 000 posts (most migrated from old system). Only features people there are missing are quotes and simple writer profiles - both things that I will implement there at some point. But adding 100 000 posts/replies as pages did add little overhead for the site. Especially for some kind of searches (grab a section and find pages under that with full text search). Ryan quickly provided tweaks to core selector engine and the selectors run nicely now. But if I ever rebuild the Discussion module, I probably make it use own tables instead of using pages. Although it is super nice to query the forum posts with the awesome PW api.
-
Current method with template based access control works very well in most of the sites and apps. But if you have lots of "horizontal" needs, then it gets complicated. What I mean with horizontal needs is things like: we need to have 15 news sections with different editors and readers. Each of those news sections are in different parts of the site tree. Template based access control just falls short here, since we don't want to duplicate those 15 news templates (and create new duplicate each time we need new news section). News section is just an example, it could be also things like "workgroup section", "blog" or "private room" etc. CustomPageRoles module definitely helps here and I have been able to do all the things with it. But our sites usually are dynamic in a way that client themselves need to create those sections. Since CustomPageRoles build upon the template access control, it still needs quite a clicking on template access tabs etc. I have also made some tweaks to that module that I need to share. I like the idea of "global" and "local" - you could add "local" access control that will be inherited from some part of the site. See this: Home (home) -- services (basic-page) -- news (news) -- -- news item 1 (news-item) -- -- news item 2 (news-item) -- -- office intranet (intranet) * -- -- -- our rules (basic-page) -- -- -- office news (news) -- -- -- -- office news item 1 (news-item) -- -- -- -- office news item 2 (news-item) I would have defined my global template access like this: home guest role - view access office-member role - edit access * Then I would have added local template access to page "office intranet" and have defined there these rules: intranet guest role - no view access office-member role - view access office-admin - edit access news guest role - no view access office-member role - view access office-news-editor - edit access office-admin - edit access Not sure how complicated this would get, but I still find the current way a little bit cumbersome for our sites (with lots of "horizontal needs").
-
Thanks Joss. I noticed when tested it, but never seen it before. Need to turn it on for clients.
-
Module - Shop for Processwire - Selectable options and the cart
apeisa replied to NooseLadder's topic in Modules/Plugins
I think you could just create the "add cart" functionality yourself, on template level. Like this: <form method="post" action="./"> <input type="radio" value="10001" name="sc_product_id"><label>Product variant 1</label> <input type="radio" value="10002" name="sc_product_id"><label>Product variant 2</label> <input type="number" class="sc_qty" name="sc_qty" value="1"> Qty <input type="submit" value="Add to basket"> </form> It doesn't matter what is your form action, the shopping cart module looks for sc_qty on all pages. sc_product_id value should be the page id of the variant you are adding to a cart. -
My Chrome use to have Wikipedia favicon on my pw forum bookmark for years (never understood why...). It's no more there, I am all lost.
-
Sorry Ryan, missed this last time around. For me the UI is much better in CKEditor (right click for context menu). When I have showed clients how tables in TinyMCE works they are always little unsure (like I am too). And ok.. now that I tested tables in TinyMCE website, I see context menu there - I have never seen that in my own implementations on with PW. There must be some setting I am missing? About dialog windows: those are very easy to customize in CKeditor (remove or add fields, set defaults etc): http://docs.ckeditor.com/#!/guide/dev_howtos_dialog_windows Last year I have implemented (or tried to) CKeditor 4, TinyMCE, Aloha and Mercury and I gotta say clear winner was CKeditor. For some reason customizing etc just made sense to me. Most pain I had with Aloha, which was a true mess at that time (they had both JqueryUI and ExtJS - now they have seem to dropped the Ext out).
-
Ryan, for me personally it doesn't matter. MIT is much easier to understand than GPL. I also agree with you that "risks" with MIT are pretty close to zero: if someone wraps PW in commercial version and tries to sell it => the original and open source would still be there. And in current logic I could add few modules, admin theme and site profile and bundle them as a commercial CMS, build on top of the ProcessWire CMS/F. But as long as it is clear for everyone what is ok and what is not - then all is good. I feel that GPL and modules/plugins are hard thing. Of course there is a huge difference between ProcessWire and WP & Drupal -camp, since those especially see modules as derivatives - and you especially state that in ProcessWire modules are clearly independent from core (or tools build with and for ProcessWire, not build by modifying or extending PW). I also think that the current way to go seems ideal to me: free and full featured core, where people can build open source or commercial modules for specific needs.
-
Good points Neil. It seems to be grey area in general whether plugins should inherit GPL or not. WordPress and Drupal are both GPL and they both think plugins as derivatives that should be GPL also. Maybe more free license like MIT might be better fit without any grey area? Marketplace driven concrete5 has MIT.
-
You can drop the get("/") and use just pages find. Or alternatively keep the get, and use children instead of find and drop has_parent. Also you might consider using page object instead of path on tag_seasons, but that really depends about your site... If you are sure that season paths don't change then that is clean and nice.