Jump to content

hellomoto

Members
  • Posts

    355
  • Joined

Everything posted by hellomoto

  1. I have the following sidebar.inc included on my Shop page which is the main index of items: <?php foreach($input->get as $key => $val) { echo htmlentities("$key = $val") . "<br>"; } $selector = ''; $summary = array( "categories" => "", "agegroups" => "", "keywords" => "", ); if($input->get->categories) {} $sidebar = "<form id='search_form' method='get' action='{$config->urls->root}shop/'><div class='row'>"; $taxonomies = $pages->find("template=product_taxonomies"); foreach($taxonomies as $t) { $items = $t->children; $sidebar .= "<div class='small-6 large-12 columns'><h3>{$t->title}</h3>"; foreach($items as $i) { $sidebar .= "<input id='$i->name' name='$t->name' value='$i->name' type='checkbox'><label for='$i->name'>$i->title</label><br>"; } $sidebar .= "</div>"; } $sidebar .= "<input id='search_keyword' name='keyword' type='text'/>"; $sidebar .= "<div class='large-12 columns'><input type='submit' id='search_submit' name='submit' value='Search'></div></div></form>"; Checking more than one input of the same name only produces the last value of those. Can anyone advise me on how to make these multi-select filters return multiple values?
  2. I hope there are never that many PW modules for any one general feature such as a gallery. With PW this should never come to pass; WP only has that many because of course they're all plug-and-play with a million minute options for the back- and front-end to choose from, like positioning or color of captions... most of which are, most of the time, for most people, wholly unnecessary. PW should refrain from jumping on that bandwagon. Given the power of PW out of the box there probably will never be nearly as many modules in the directory as there are WP plugins, and that is a beautiful thing.
  3. That's pretty true unless you don't have a real reputation...
  4. I think it would be a great idea for us to set up a showcase site directed not towards end users but to developers' clients more specifically, as so many people on here have encountered, it can be difficult trying to explain the benefits on a case-by-case basis. It would be much more efficient to simply refer people someplace, or since plenty won't even do that due diligence, have a live and ready source on the web to visit with the client and show them in real time so they can ask any questions as they come up rather than put it off... (Of course anyone who wanted to like myself could do it themselves too. It's just time-consuming to do by oneself.) I like PossibleWith.PW I registered it and would happily donate it to the cause. So PW.pw can draw more "enterprise" or large-scale sites selected in/from processwire.com, give performance and other comparisons between different CMSs, maybe have a blog... if anyone wants to contribute, the Big Things Blog. We could just post inspirational and informative quotes from the forums and stuff... that are convincing and appealing to non-developers... Because it's like Pete said (on page 1, and then more I'm sure, as this convo has been spinning around) that we can't just have a flashy website to appeal to businesses and start like a whole operation catered to them... and like someone else said, most sites we build tend to be for businesses anyway (they're the ones buying)... but, of course, the ones buying usually like to be in control, and given that, despite not really having the expertise to make a well-informed major technical decision for themselves such as the CMS/framework to be used, will want to do so anyway. ProcessWire.com is aimed towards developers, as the CMS is, as it should be, because it's their business. When a developer comes to the site, he or she should be the one the info is targeted to because not having heard about it before, they're the only ones who will be able to make sense of the benefits. But that's why clients haven't heard about it, and why maybe we should put something together, somewhat separate, that's meant for them, that developers can refer their clients to rather than trying to convince each one individually every time…
  5. To refresh my thumbnails I have been using a solution found in this thread. It is a script in the root of my PW installation on my localhost that when accessed in the browser displays a list of all "orphaned" image files and directories, this way: if (!in_array($f->getFilename(), $valid)) { echo "Orphaned file: " . wire('config')->urls->files . "$id/" . $f->getBasename() . "\n"; // unlink($f->getPathname()); } So you can preview the list first, and then choose to un-comment the unlink function and re-run the script to delete them, and fresh thumbs will be regenerated the next time they are requested, all the outdated ones will be eliminated. I want to make this a simple module: Include this script on an admin page Create a Fresh Thumbs action option on the page (just a button, rather than having to un-comment that line in the source) Enable a cron job option... Seems simple enough so I was hoping maybe someone could shed some light on this for me. Past the creation of a blank admin page, I'm sure I can just include the file and figure out the rest with that foundation. I have also been curious as to how to do this for a long time. As always all your gracious input is much appreciated in advance.
  6. I was wondering how to do this too before, and ended up using ProcessRedirectIds... hadn't known about AutoPageName. But I wanted to have the page name be its ID for URL purposes, since the title of the listing may be subject to change... although I guess PagePathHistory could take care of that as well. In the aforementioned case though do you think there is a better alternative? Because in that case I would have no other use for the listings' name field, besides to identify it, for which I would use its actual ID [field] anyway... so I really have no use for the name field and might as well just replace it with the ID for the URL, anything else would be over the top. I think.
  7. Mine is preceded by "Proudly" (like WP has by default, which I never put myself, and I feel is unnecessary at this point given how it's usually fairly obvious when a site is built with WP, and their existing popularity)
  8. Nice pseudocode, and nice of you to actually consider the proper grammar of English as your second language while so many native speakers disregard it. I'm learning Spanish and am coming across the same thing... Many native speakers don't tend to pay much mind to their grammar or spelling, etc., the technicalities, so when I ask questions they won't know because they had never thought about it. Turns out I can at least write Spanish more accurately now than some native speakers. I enjoy learning the forms and irregularities. But the real simpler way to tell the difference, in my opinion -- being that it is the real difference -- is that "it's" is a contraction, meaning it's the word "it" with "is" or "has", connected to make it shorter, and the apostrophe is there in place of whatever is eliminated in between. This should be obvious... I would think... Then "its" is possessive. It's like "Sam's" means like "belonging to Sam". But since "it's" is already another word, a contraction, we can't use that, so as to be able to distinguish one from the other, grammatically; additionally, all third-party pronouns in English lack the apostrophe: "his", "hers", and "theirs". Another bad one is then and than. They're just two different words -- homonyms, indeed, but different nonetheless, like "so" and "sew". Completely irrelevant, yet both totally common words that everyone should know how to spell... Yeah... grammar's my passion...
  9. The doc pages are searchable and public, by the way; -------------------------- Moderator note: @hellomoto, That's a very important and helpful find, thanks. However, to protect the integrity of that website (and save Macrura some blushes ), could you please PM him instead? Thanks. Hence, I have removed the link you posted.
  10. Awesome work and ideas, thanks for sharing.
  11. Is there a somewhat comprehensive guide or tutorial somewhere on theming the PW admin? There's so much untapped potential there I just don't know really where to start to learn my way around it. If not, would anyone care to create one? I know I would greatly appreciate it, as would many more users. There are no admin themes in the modules directory currently that claim to be compatible with 2.5. That would probably change with a solid beginner's guide.
  12. If not that, at least display the latest specified compatible version in the list view. I think this would be a nice and helpful feature to have, especially for some module categories (such as Admin Themes) with few listed as being compatible with 2.5... For now you have to open each module's page individually to view this info, and not only that but that brings up another minor annoyance in my experience with the modules directory, which is that trying to open a module's page in a new tab actually loads it in the source tab as well. I mean, the site does load swiftly, thank you guys for upholding such quality standards... but I still don't see why that's even desirable to do... You all know what I'm talking about right? I wish processwire.com was open source, especially to see how the newsletter system is done.
  13. Never mind, wasn't the conditional anyway. This did it: foreach ($mainnav as $p) { $p = $p->id; if($page->rootParent->id == $p) $current = 'style="background: #fff;"'; else $current = ''; echo "<a href='{$pages->get($p)->url}' $current class='{$pages->get($p)->name}'>" . strToUpper($pages->get($p)->name) . "</a>"; }
  14. I have a page field on my home template with output set to multiple pages (PageArray). I can echo its value, 1111|2222, or foreach $nav as $p echo $p, 11112222. But when I do this that I need to, it doesn't work: foreach ($mainnav as $p) { if($page->rootParent->id == $p->id) $current = 'style="background: #fff;"'; else $current = ''; echo "<a href='{$pages->get($p)->url}' $current class='{$pages->get($p)->name}'>" . strToUpper($pages->get($p)->name) . "</a>"; } I get: I've tried the conditional in the code with one and three = signs.
  15. According to Pingdom on shared hosting this costs 7 seconds on an initial page load...
  16. I'll just call you Sir Fan. The MR acronym has too many options to choose from. I hear only great things about Costa Rica though, for sure. Anyway I had added magnific popup to edit them from the calendar already; but my calendar view isn't supposed to replace the page list view or whatever you have, just supplement it, with more than one type of event and varying start/end date assignments (like a listing template could be included in two group instances: one with the start date = created and no end date, to mark its creation, and another with the date_sold instead; and the event template only need be instantiated once and can use date_start and date_end for a range). I got the basic functionality going, now trying to make it into its own module and take it a bit further... keyword "trying"...
  17. I made a calendar view page in the admin using AdminCustomPages module, but since I want to add more functionality to it I am trying to make it (the calendar) its own module... So I have a module ProcessKalendar that extends Process and implements Module, ConfigurableModule. It creates the Kalendar page on installation and currently just outputs the input of the one config field for the module on that page on execution. I need to add scripts and stylesheets... How do I do this within the module?
  18. Okay now what if I want to access this info? Like display on a page, the most "viewed" pages, in a certain datetime range? (or "edited", let's say; viewed in my case.) Also how often are these flushed out? I see the cleanup function in ProcessChangelogHooks, says at an interval of $this->data_max_age. Where does that come from/is it set?
  19. This is great; I was building a viewtracker made up of PW pages but needed a better solution, so I was able to just add it in to this, thanks to adrian who brought it to my attention. Anyone know how I can add page segments to the URL though for the views? Here's my altered logPageEvent() in ProcessChangelogHooks.module (just search 'viewed' or 'render' in the code to find my additions): Never mind $page->input->urlSegment(1) had to be $event->input->urlSegment(1). public function logPageEvent(HookEvent $event) { // render has no arguments if ($event->method == "render") $page = $event->object; else $page = $event->arguments[0]; // don't log operations for repeaters or admin pages if ($page instanceof RepeaterPage || $page->template == "admin") return; // grab operation from event $operation = $event->method; if ($operation == "saveReady") $operation = "edited"; if ($operation == "render") { if ($page->template->name !== "vessel") return; $operation = "viewed"; } // only continue if this operation is set to be logged if (!in_array($operation, $this->operations)) return; $fields_edited = array(); if ($operation == "edited") { // skip new pages or pages being restored/trashed if (!$page->id || $page->parentPrevious) return; if ($page->isChanged()) { foreach ($page->template->fields as $field) { if ($page->isChanged($field->name)) { $fields_edited[] = $field->name; } } // only continue if at least one field has been changed (or // if status has changed trigger new event for that) if (!count($fields_edited)) { if ($page->isChanged("status")) { $event->method = $page->is(Page::statusUnpublished) ? "unpublished" : "published"; $this->logPageEvent($event); } return; } } else return; } else if ($operation == "renamed") { // if previous parent is trash, page is being restored if ($page->parentPrevious->id == $this->config->trashPageID) return; // if current parent is trash, page is being trashed else if ($page->parent->id == $this->config->trashPageID) return; } else if ($operation == "moved") { if ($page->parent->id == $this->config->trashPageID) { // page is being trashed $operation = "trashed"; } else if ($page->parentPrevious->id == $this->config->trashPageID) { // page is being restored $operation = "restored"; } } // details about page being edited, trashed, moved etc. $details = array(); if ($page->title) $details['Page title'] = $page->title; $details['Page name'] = $page->name; if ($page->namePrevious) { $details[($operation == "moved" ? 'Page name' : 'Previous page name')] = $page->namePrevious; } $details['Template name'] = $page->template->name; if ($page->templatePrevious) { $details['Previous template name'] = $page->templatePrevious->name; } $details['Page URL'] = $page->url; if ($page->parentPrevious && $operation != "edited") { // for pages being edited current or previous parent is irrelevant // data since changing parent will also trigger "moved" operation. $details['Previous page URL'] = $page->parentPrevious->url; if ($page->namePrevious) $details['Previous page URL'] .= $page->namePrevious."/"; else $details['Previous page URL'] .= $page->name."/"; } if ($operation = "viewed" && $page->template->name == "vessel") { //$details['Page URL'] .= $page->input->urlSegment(1); //echo $pages->get($page)->input->urlSegment(1);//->input->urlSegment(1); //print_r($page); } // note: currently only "edited" operation keeps track of edited fields if (count($fields_edited)) $details['Fields edited'] = implode(", ", $fields_edited); // find out which script / URL triggered this particular action if ($this->log_caller && $caller = $this->getCaller()) $details['Caller'] = $caller; $this->insert($operation, $page->id, $page->template->id, $details); if ($page->isChanged('status') && !in_array($operation, array("unpublished", "published"))) { // if status has changed, log extra unpublished/published event $event->method = $page->is(Page::statusUnpublished) ? "unpublished" : "published"; $this->logPageEvent($event); } Much thanks to Teppo et al in advance
  20. I just added it into Changelog Can't wait for the next release so I can try out the multiple versions of modules... I don't want to try and fail the dev branch again.
×
×
  • Create New...