Jump to content

kongondo

PW-Moderators
  • Posts

    7,479
  • Joined

  • Last visited

  • Days Won

    146

Everything posted by kongondo

  1. Welcome to the forums @TJB. You seem to have made that page's template a system template. You cannot delete system resources like that. You would need to do it using the API. An example here:
  2. Have a look at these discussions: Edit: Not sure will work for you actually, i.e. if you need a database level sort. @fbg13, I'm not sure that will produce desired results since that sort will take place in-memory, i.e. after the PageArray has been retrieved. I think @Jason Huck wants the sort to take place at database level.
  3. @mel47, Please see this note on how to call a menu in a multi-lingual environment: If that doesn't resolve your issue, try refreshing your file compiler cache.
  4. Hi @MaryMatlow, Same way, really. renderPosts() takes 3 arguments, the third of which is $options. Since you need to pass in the 3rd argument, in blog-post.php, line #56, you also have to specify the second argument like so: $options = array('post_comments'=>0); $content = $blog->renderPosts($page, false, $options) . $blog->postAuthor() . $renderComments . $blog->renderNextPrevPosts($page); The 'false' is the second argument. The post will be rendered in full since what that says is that $small = false.
  5. http://processwire.com/blog/posts/roadmap-2017/#whats-in-store-for-processwire-in-2017
  6. I'd say go for it! Not only do I wish you success in your endeavour, but I am hopeful that this will also give ProcessWire some good exposure .
  7. $pages->get() will always get you ONE page only. In your case, it gets you the first child of $store, i.e. Page A. This is because Page A, via sorting, comes first (i.e. before Page B and Page C. $pages->get() returns a Page. If you did a $pages->find(), this will always return several pages (if it found them, of course). The important thing, as noted earlier, is that $pages->find() returns a PageArray. That means, several Page Objects. So, you cannot directly echo like so: $results = $pages->find('template=basic-page'); // cannot do this; it doesn't make sense since you have multiple items inside $results //...so, you would need to loop through it using a foreach echo $results->title; Think of it this way: // FRUIT: this is very specific. You are requesting a banana; not an orange, not an apple, but a banana. //...We will get you a banana $fruit = $pages->get('banana');// @note: pseudo code! // hence, you can do echo $fruit->title;// outputs 'banana' // BUT....if you want FRUITS...there are several fruits... $fruits = $pages->find('fruits');// @note: pseudo code! // if you did this, the question would be, what fruit was that again? // direct 'echo' doesn't make sense; // ...you need to tell us what fruit you want; apple? orange? banana? There's several fruit in here! echo $fruits->title; // aaah, so, we loop through the basket, one fruit at a time... foreach($fruits as $fruit) echo $fruit->title;// this will output each fruit in here in turn...apple; orange, banana, etc... Hope this makes sense.
  8. Update: Menu Builder Version 0.1.7. Changelog Fixed a bug that caused titles of menu items with apostrophes not to display properly in menu settings. Thanks @LMD Code cleanup and refactoring.
  9. In the frontend, have you checked to see how many pages are being retrieved? Something like this: $prevEvents = $player->child("name='history'")->children("date>=$prevDate"); echo $prevEvents->count();// does this output the number of pages you are expecting? In addition, any repeaters in the fields you are retrieving?
  10. Seems you've been away for a while . That's what the file compiler is for. It allows version 2.x modules to run in version 3.x.
  11. What about an autoload module that will make the changes on save? This way, it's done once. Or maybe JavaScript to make changes client-side on click' insert-link'? Hmm, maybe not be as elegant though. Just some rumblings....
  12. I see what you mean. Meanwhile, maybe there are workarounds to accomplish what you are after. I have nothing concrete atm .
  13. How is that different from selecting a checkbox, one each for btn, btn-success and btn-sm? Works for me just fine. <a href="/blog/" class="btn btn-success btn-sm"></a>
  14. @MaryMatlow, Seems you missed the third link in my post above . The array indices were changed to 'post_image_tag' => 'whatever', etc..Please see the whole list there or within the module code itself
  15. Yeah, that's a lot of post . Let's see if we can take it bit by bit. I believe this line will grab ALL the children (a PageArray) of history from the database, then return the first (in-memory manipulation) of these retrieved results: $lastEvent = $player->child("name=history")->children("sort=-date")->first(); Instead, try this, to actually grab ONLY one child from the database: $lastEvent = $player->child('name=history')->child('sort=-date'); This line doesn't make sense to me: $prevEvents = $player->child("name='history'")->children("date>=$prevDate"); How can previous events' date be greater than the previous date?
  16. In a hurry, so a quick (and not thoroughly tested) part answer Actually, the 'normal' selector is an AND not an OR (i.e. the comma separated selector). 2a. Both terms in at least one field (@see docs) // both terms in at least one field $sel1 = '(title%=foo, title%=bar), (body%=foo, body%=bar)'; 2b. At least one term in at least one field (@see docs) // at least one term in at least one field $sel2 = 'title|body%=foo|bar'; 3 LIKE (@see docs). Here we use %. See the notes in the docs about the alternative + matching order, etc
  17. Seems like a CKEditor quirk. Rather than going to the source code, you can highlight the heading and change it to 'normal' before deleting it. Not ideal, I know...
  18. Excellent work as usual! Question; when the rectangle shifts to the right, the e sits right above the browser's scrollbar (see attachment). Is that intentional?
  19. @celfred, regarding the optimisation, yes, please start a new topic. I, for one, I am curious why you have to load 5000 pages! .
  20. By the way, strtok can lead to some unexpected results. Try this: $name = $sanitizer->pageName(strtok('about-us.html', '.html')); echo $name;// outputs 'abou' $name = $sanitizer->pageName(strtok('around-us.html', '.html')); echo $name;// outputs 'around-us' So, you might want to use something else (replace or regex, etc)
  21. What @Robin S said. Good idea to sanitise that name though . I'm sure Robin just forgot. $name = $sanitizer->pageName(strtok($input->urlSegment1, '.html'));
  22. That's because a dot (.html) is not considered a segment (I think?). Segments take the form of /a/b/c/, i.e. separated by forward slashes. I am not sure whether using the regex feature would allow for this. Have a look here. A different approach here as well:
  23. Not sure about that one. Could be something to do with your server's time. It's hard to tell without knowing exactly how he's pulling in the facebook feed. Please start a new topic/thread regarding that question, thanks.
×
×
  • Create New...