Jump to content

kongondo

PW-Moderators
  • Posts

    7,487
  • Joined

  • Last visited

  • Days Won

    147

Everything posted by kongondo

  1. Hehe The .com redirects to .net
  2. @Ovi, Excuse my ignorance. I am not sure I get why you need to hook into any method? If a comment is submitted, it is saved to the db (directly if it does not require approval and later if it does require approval by Admin). In that case, why not just count the comments in the db directly? Since comments are related to their pages, you will know how many comments there are per page(?) I'm probably not getting it (I usually don't many times, hehe) and you are far way a better coder than I am, so would request your indulgence to unravel this for me please Edit: Useful? http://processwire.com/talk/topic/1205-comment-counting-returns-odd-number/ OR: Just use PW API in your template file: In my tests, this code sorts my posts (pages) in a list according to number of comments (and echoes the number of comments per post). Since there is a page refresh after each comment submission, the sorting is always up to date... foreach ($pages->find("template=post, sort=-comments.count") as $reviews ){ echo "<li>{$reviews->title} - " . count($reviews->comments) . "</li>"; } Other topics: http://processwire.com/talk/topic/594-how-can-i-use-pagination-with-comments/ http://processwire.com/talk/topic/357-creating-comments-via-api/ http://processwire.com/talk/topic/1930-comments-question/ http://processwire.com/talk/topic/1624-comments-module-multi-pages-display/
  3. Horst, Actually, from what I can tell from the Blog Profile, they are not PW Pages. They are stored in the field (table) "field_comments" (see screenshot). They are associated with their posts (pages) though. I'm sure there is a way to "hook" into them though...
  4. Thanks. Good intro albeit with a few issues I don't agree with (e.g. it is not easy to upgrade PW!). Yeah, maybe for the point-and-click crowd?
  5. Yes, in PW 2.3, you need to create the child page. Both pages (parent ["shows"] and child) will be in the site Tree. The parent will also be listed in the Admin menu (next to Settings, Modules, etc. - depending on the Admin theme you are using.). Clicking on it will open your custom admin page. In the dev version of PW you don't have to create a child page. See Diogo's github for more info. What the module does is render the child page using that child's template. I find ACP really handy. All PW variables are at your disposal and the page is safely hidden in Admin . Seen the crazy things I've been doing with it ?
  6. If you decided to do it in Admin and do not wish to create a module, you can use Diogo's ACP module. See http://mods.pw/4Y and http://processwire.com/talk/topic/3474-admin-custom-pages-module/
  7. Janlonden, This topic might be of interest...http://processwire.com/talk/topic/3785-alternative-syntax-for-control-structures-a-tip-for-newbies/ regarding coding styles. Well done on writing your first code snippet
  8. slkwrm, Thx for the tip. Just tried this in PW 2.3 stable. it doesn't work. The attribute doesn't show up. I cleared my cache as well.
  9. Nik, Thanks for the update. Feature request please: An option to "after save, edit next sibling" (an implementation of $page->next). Thanks.
  10. Roelof, I do not mean to be rude. I would really love to help you but am finding it rather difficult at the moment for three reasons. One, you have started interrelated threads and posts in various places and I just can't keep up. Second, I am not sure how comfortable you are with PHP and PW. Stating this can be helpful so that people responding to your questions don't make assumptions. Third, I think it would be appreciated if your questions were more specific. Take for instance your question above are you talking about pagination? Are you talking about a menu? Or are you talking about listing latest articles? What exactly does the client want to do? What have you tried? How did it go? Again, I don't mean to be rude but I think you will get better answers if you heed to these simple suggestions: 1. Please try and post in one thread before opening another 2. Please be more specific with your questions. i am not a moderator in these forums so this is just plain advice from one newbie to another. I mean no offence; I only wish to see you get the answers you need. Building sites in PW should be enjoyable, not frustrating and I wish that your experience with the system is enjoyable. Thanks for reading. Cheers/k
  11. Yes. Tree is best IMO. CRUD tables like these are more suitable for power users. PW can easily manage 1000s of pages in the Tree. You can also try to nest your pages as much as possible (categories) if that makes more sense and helps with pagination in the Admin. Additionally, using the admin search, you can easily find pages. It all depends on your needs though. BTW, you can have both the tree and the CRUD tables if you wanted. I think Matthew is working on a datatables implementation as well, btw.
  12. There's no other module (ATM) but I was fooling around with this http://processwire.com/talk/topic/3474-admin-custom-pages-module/?p=34425. It's not a module but an implementation of CRUD using jTable and the module Admin Custom Pages. I don't have the capability (yet) of transforming that into a module .
  13. I only no how to do that using API and the $template API variable echo "<select>"; foreach ($templates as $template) { echo "<option value=''>{$template->name}</option>"; } echo "</select>";
  14. This is defined here: /wire/config.php $config->http404PageID = 27; But this is PW. We do not hack the core. So what do we do? Uh, this is PW, we can override this . So, we put our own 404 page id configuration in our /site/config.php $config->http404PageID = 1035;// my custom 404 page A word of caution though in /wire/config.php * Hard-coded configuration options for ProcessWire * These may be overridden in the /site/config.php, but it is not recommended. More info here: http://processwire.com/api/variables/config/
  15. Welcome to PW Janlonden! This topic might help:http://processwire.com/talk/topic/3758-search-form-drop-down-categorychild-page-output-support/ And this one too. See post by Adrian: http://processwire.com/talk/topic/3583-filter-results-of-selector-using-selectcheckbox/
  16. Good. Btw, is $page->hotel_name a custom field? I ask because $page->name will give you the current page's name. But that may contain hyphens which is probably not what you want to match.
  17. When you create the field, you have radio buttons to choose whether it is a Single Page or a Multiple Page field. When editing the field, this is under BASICS. Also, check under INPUT when editing the field, scroll down to input field type*. Make sure to make a selection that matches Single Page if your field is for single pages or Multiple Page if it is for multiple pages.Otherwise, you will get no output if you select the wrong type. Edit: I think some people live right here in these forums Late again!
  18. <quick tut> And in case you are wondering why this is so...it is no mystery. Look under the hood in your PW database. Select one of your Page Reference Fields db tables (e.g. field_boardbasis). You will see the data stored there is/are the page(s) id(s) of the currently selected page(s) - see attached screenshot. And in case anyone else is still wondering why the ID? Well, with the ID, you can get all sorts of information about a page since the ID is unique - unlike custom fields like title </quick tut>
  19. http://modules.processwire.com/add/ - you get here from the button on the bottom of the module categories on the modules page...
  20. Perhaps this post will be helpful? http://processwire.com/talk/topic/958-repeatable-fields/?p=8432 And this too: http://processwire.com/api/fieldtypes/repeaters/
  21. I'm not following. Do you want to search for a field name or search the contents of a field of the current page? $page->nameOfYourField Gets you the current page's field with that name. E.g. $page->title give's your the current page's title field (assuming it has a field with the name "title" ). So you can do echo $page->title; On the other hand $page->fields gives you an array of the fields attached to the current page (via its template). This is if you want the names of those fields. With arrays, you do a foreach if you want to echo them out, for instance. Edit: Also useful if you can state what you want to accomplish. In many cases, there are easier ways of going about tasks in PW...
  22. Here are the new additions Soma's talking about...http://processwire.com/about/news/introducing-processwire-2.3/
  23. Hi Jamie. Welcome to PW! In a bit of a hurry but this page also has answers for you - http://processwire.com/api/selectors/. E.g. title|body*=sushi tobiko //would match only those pages that had the exact phrase "sushi tobiko" present in either their title or body fields Edit: Adrian is fast! - As you read the docs (and this is mentioned there) $page always refers to the current page. $pages alwasy refer to all other pages
×
×
  • Create New...