Jump to content

kongondo

PW-Moderators
  • Posts

    7,473
  • Joined

  • Last visited

  • Days Won

    144

Everything posted by kongondo

  1. The more I read this the more it sounds like what you are after are custom hooks?
  2. I am curious about this as well Was it Joomla? Why did you decide to stop using Joomla? Why ProcessWire?
  3. In that case, what @teppo said should do it (according to the docs in its support board): $pages->find("books.category=something, books.text=$letter");
  4. Glad you find it useful ? Yes, thanks! This has been reported before but I've not yet had time to commit to the repo. Here's the previous post with the recommended fix ?
  5. Hmm. I've never tried this but I am curious ProcessWire didn't complain about a custom field called 'name'. I would've thought that is a reserved word since ProcessWire pages field has a name column. Do you mean Select Options field (fieldtype)?
  6. Great! Glad you got it sorted. Please explain what this means ? Zero? Wrong results? I'll try and replicate when I get a bit of time. Could you please clarify the field types in your selector? What is category and text?
  7. Please explain, what is unusual? You have a data that is structured in an unusual manner or you think ProcessWire's database structure is unusual? If the latter, then many here will beg to differ ? Do you mean a page or module where you can view a page's data in this manner? Like in a spreadsheet? Or, do you mean a database that resembles a spreadsheet in its structure? If the latter, that's akin to a flat file database. ProcessWire uses a relational database. This model is not unusual at all :-). I don't understand this bit. What is the dilemna?
  8. Your topic says 'pipe selector not working' There are two different uses of pipe selectors in your sample code. template=article|blog_post|book - OR selectors: matching one value or another (docs) title|body|author*=$q - OR selectors, matching one field or another (docs) Which one isn't working? Are you not getting any results or is it returning unwanted results? Are you sure it is not the AND selectors (docs) that are 'interfering'? Perhaps you want OR:groups (docs)?
  9. Of course, you are right. I should have read the requirements more carefully :-).
  10. This assumes only one field of type FieltypePageTableExtendedGrid is present on the page, no? ?
  11. Yes, thanks. @horst found out the same and wrote this tutorial ?
  12. Whilst I appreciate the inherent advantages, I'd like to point out that the forum rules/guidelines currently don't allow this. Edit I see @teppo beat me to it :-)
  13. No. It could. Not worth the hassle. Instead, I'd suggest you try one of the 'restore' DB modules or at 'worst', do a manual save state of DB and restore it after each of your import script tests. Some candidates to do this: ProcessDatabaseBackups - https://modules.processwire.com/modules/process-database-backups/ (quick, in out, all or nothing) RockMigrations - https://modules.processwire.com/modules/rock-migrations/ (if you want fine-grained control BUT I am not sure how it deals with pages )
  14. Nothing newer. I use multi-instance recently and it worked fine.
  15. This is a curious line. Why do you need this? Or are you ONLY using it if on CLI?
  16. Moderator note: @MarkE, Moved your question to the module's support thread.
  17. Moderator note: @JeevanisM, please keep the same question in one place. Thank you.
  18. With bells and whistles ?
  19. Have you seen my response, 3 posts above?
  20. Hi @Gideon So. Thanks for chiming in. I see we posted at the same time. Please let me state that this is incorrect. @spercy16's function is a recursive function ? It can be called inside itself. The code works just fine as it is (I tested it) ?
  21. Hi @spercy16, Your snippet is working just fine for me. I am not sure what you mean by not working in my child pages but I think the reason is access issues. The following will not naturally show up in page finds: Unpublished pages Pages the user has no access to Hidden pages If your pages (including child ones) fall into any of those categories, they will not show up. However, if you need them to, you can override access control behaviours. For something like a menu, that may not always be what you want. For instance, if a page is unpublished, you want it that way for a reason. Please have a look at the docs (link below) for how you can use (for example, $pages->get('/')->children('include=unpublished')) overrides in your selectors. https://processwire.com/docs/selectors/#access_control Since you are new to ProcessWire, please note that overriding access controls using 'include=all' for the children of Home ('/') means you are asking ProcessWire to return all pages on the site, including admin pages, roles, permissions, etc, clearly not what you want. Additionally, calling $pages->get('/')->children without any limits, [e.g. $pages->get('/')->children('limit=50'))] can potentially lead to the retrieval of lots of pages (assuming you have a big site). A quick by the way, although this: foreach ($children as $page) does not affect the working of the function, since the $page variable is out of scope inside a function, it's just good to know that if used outside, it would have side-effects, i.e. overwriting the current page (variable). Maybe you knew this already. Otherwise, conventionally, some people go for $children as $child or $children as $c or $children as ....whatever, for consistency (and clarity) of use in and out of functions ?. Welcome to ProcessWire and the forums ?
  22. I don't think you are doing anything wrong. I don't think we have a sanitizer for inline CSS. Regex maybe? https://stackoverflow.com/questions/2488950/removing-inline-styles-using-php https://www.sitepoint.com/community/t/remove-inline-style-with-preg-replace/21743 https://wordpress.stackexchange.com/questions/91949/removing-any-and-all-inline-styles-from-the-content https://www.php.net/manual/en/function.strip-tags.php#99643
  23. Something like this... wire()->addHookAfter('Pages::published', function($event) { $page = $event->arguments(0); if($page->template !='blog-post' ) return; // ProMailer API TO SEND EMAILS // no need to return $event if you haven't modified it }); Talk to Ryan about ProMailer API if what you need does not exist here https://processwire.com/api/ref/pro-mailer/
  24. I think you still need #1, but that's the easy bit ? https://processwire.com/store/pro-mailer/
×
×
  • Create New...