Jump to content

adrian

PW-Moderators
  • Posts

    11,182
  • Joined

  • Last visited

  • Days Won

    372

Everything posted by adrian

  1. I decided to have a look around and discovered the problem is that the rebuildForPage method is not being called when a new page is added. This fixes it for me (note the addition of !$page->created): } else if(count($changes) || !$page->created) { $this->rebuildForPage($page); }
  2. True enough - it depends on how you are looping through the child pages. Perhaps something like this: foreach($page->children() as $dam) { echo $dam->country->title; }
  3. I think you are using a pagefield called "country in the dam template. If so, then: $page->country->title
  4. I have a similar (I think) issue to soma - I need to restrict a role to only be able to edit all pages in one branch of the page tree. Initially it looks like this module makes very easy work of it, but what happens when a new page is added to the page tree - the index is not rebuilt, which means that the new child page won't be editable by the dynamic role. At the moment it seems like the only fix is to open this module, change one of the selectors, save, then change it back to what I want and then save again - then the new page is added to the index of pages that are editable by the dynamic role. Am I missing something?
  5. List of PW modules on Packagist: https://phppackages.org/s/processwire https://packagist.org/search/?q=processwire Makes me wonder - should all module authors be submitting their modules to this list, especially now that PW 3.0 will have composer support?
  6. I just tested Macrura's group approach and it works for me on an ImageExtra field. It's modified slightly to match the fields/templates I have in my current sandbox install. I can't imagine why CroppableImage would affect this. $q = 'testtag'; $matches = $pages->find("template=home, (title|first_name|body%=$q), (images.tags*=$q), limit=150"); foreach($matches as $p) { echo $p->title; } What happens if you strip it down to the basics, like this: $q = 'testtag'; $matches = $pages->find("images.tags~=$q, limit=150"); foreach($matches as $p) { echo $p->title; } Also, try putting this as is in a template file to make sure nothing is going wrong in getting $q to the selector. Of course you could also just echo the value of $q in your search template as well, but you see where I am headed
  7. Could you post a list of the modules you have installed on the site that is having the problem. A quick glance might give us a clue of where to look.
  8. This post shows how: https://processwire.com/talk/topic/5610-field-template-context-on-frontend-forms/
  9. Ok, so in the Blue VR Site Profile take a look here: https://github.com/gayanvirajith/BlueVrSiteProfile/blob/master/templates/_done.php#L84 This is where menu functions are being called. Try replacing that one line with this: $homepage = $pages->get('/'); $children = $homepage->children(); // make 'home' the first item in the navigation $children->prepend($homepage); echo renderTopNav($children); Untested, but I think that is what you need in that situation.
  10. I completely agree - I think it would be more targeted and efficient that way, although I am guessing he probably won't want to bother with the str_replace option I just introduced. My need for that is probably an edge case though
  11. Just made some changes to the gist. It now uses square brackets [ ] and not curly braces {} It now limits replacements to just description and notes paragraphs You can now define str_replace $search and $replace like this. In this example I needed the dashes in $page->name replaced with underscores, but you can use however you want. [page.name.(-|_)] Not sure that my code/regexes are the cleanest - I needed this is a bit of a rush, but it seems to work well and I am really finding this very useful in many of my fields. I'd definitely be keen on hearing feedback from anyone else who tries it and if you think it warrants being included in the modules directory. I think I will likely use it on most new sites, but maybe it's just me
  12. There are many different ways to do this, so without seeing your code, it's hard to know what would work best to match what you have, but take a look at this: https://github.com/ryancramerdesign/ProcessWire/blob/cffb682836517065d7dd7acf187545a4a80f1769/site-beginner/templates/_head.php#L21 See how the homepage is prepended to $children so that when it is foreach'd it will be included. Does that help?
  13. Ryan wrote this one: http://modules.processwire.com/modules/fieldtype-events/ as an example / starting point for writing your own fieldtype/inputfield. Of course there are others in the modules directory as well that you can steal from
  14. Do you really need to modify CommentList.php ? What about the "OPTIONAL: Generating your own output" section on this page: https://processwire.com/api/fieldtypes/comments/ If you really do need to modify, take a look at this blog post: https://processwire.com/blog/posts/processwire-core-updates-2.5.14/
  15. Hi @justb3a, Just noticed a bit of a critical bug. If you remove one of the "Add other text input fields" the field/column is not removed from the DB. This results in a fatal error and the images uploaded to the field are lost. You have to manually edit the DB table to remove the fields to get things working again. As a wishlist item, I'd love to see the ability to add select, radio, and checkbox fields as well as plain text
  16. Just committed a small update that makes use of image-picker (http://rvera.github.io/image-picker/) for selecting the poster image which is much cleaner than the ugly radio buttons I had before! Thanks to @BernhardD and his TemplatePreviewImages module for the inspiration.
  17. Please take a look at this old thread: https://processwire.com/talk/topic/552-i-get-the-404-page-when-editing-home-page/ Firstly try turning on debug mode, but also please check to see if your host is running Apache's modsecurity - seems like it might be the issue. Note in particular the last comment on that thread - maybe you should contact @jlahijani to see if he found a solution as he was also using a <script> tag.
  18. Why aren't all browsers (and Android/iOS apps) supporting SVG icons ? Looks like Firefox already does and Safari is heading that way: http://caniuse.com/#feat=link-icon-svg Maybe the others will follow and all this icon sizing mess can be a thing of the past! EDIT: Some discussion regarding SVG icons in chromium: https://code.google.com/p/chromium/issues/detail?id=294179
  19. So to clarify, if you don't put any JS code in the texarea then the you see the proper edit page for your homepage? Maybe it's hard to tell now - I am assuming you can no longer edit the homepage at all to even remove the JS code?
  20. Do you mean Content Type: "Unknown" ? Are you using a regular textarea Inputfield type, or CkEditor. It works fine for me with a regular textarea.
  21. Hi manlio - I am sorry I haven't gotten back to your PM yet - work and life has been a little hectic this last week. I really hope I can have a good look at your PM and sort out your Migrator issues sometime in the next week. I hope that timeframe will be ok. Again, sorry for the delay!
  22. I don't have the option currently to exempt a particular language, but would be happy to add if that helps. But perhaps the better option would be to figure out a way to prevent the problems you are experiencing when greek is being renamed. Can you provide more details on exactly what is going wrong?
  23. I am noticing that some editors are forgetting, or not seeing that they have to publish the items/pages in a PageTable fields. I think in many/most cases you would want all published automatically. Or perhaps it could be an option for the field - the dev can decide whether editors can choose to save unpublished if they want. Alternatively I think it would at least be helpful if there were publish and hide toggles (like the new main page tree action buttons) so it is easy to quickly publish all subpages rather than opening each one up. I would prefer the first option though. Anyone else think this would be useful?
  24. What a great comment!! I sometimes find myself apologizing for my PHP work also, but until someone can show me a system in a trendy/better language that is better than PW, it will always be my goto tool for web development. That doesn't mean I don't like playing with the new JS toys (node, meteor, angular, react) when the need arises, but PW makes everything so easy that I'd rather be here
  25. Thanks Kongondo - the new custom PHP code option is awesome - I just swapped out my old hacked version for this and it's working brilliantly!
×
×
  • Create New...