Jump to content

adrian

PW-Moderators
  • Posts

    11,190
  • Joined

  • Last visited

  • Days Won

    372

Everything posted by adrian

  1. Hi @tpr - I am curious how you set this up - I have a similar situation and went with the Dynamic Roles module, but I am not super happy with this approach, so I'll probably end up with a custom hook to further limit access to specific page trees (given that each page tree shares the same templates). Anyway, I'd like to hear how you accomplished this, as I am sure would others.
  2. Check out the latest version of PW - 2.7 just released. EDIT: Sorry, just read that you want it limited to specific pages. For this you might be better off with the dynamic roles module. I haven't checked if it can do exactly what you want, but worth a look: https://github.com/ryancramerdesign/DynamicRoles Be aware that it does have a critical bug right now that might or might not affect your use: https://github.com/ryancramerdesign/DynamicRoles/issues/14 Alternatively if none of these work as needed, you should be able to create a simple hook to check if the page matches you rules and prevent the title from being changed. No time for an example right now, but maybe someone else will chime in.
  3. return $page->parent->parent->children();
  4. Depending on your setup, you could probably make use of the "Custom PHP code to find selectable pages" option and reference the $page->parent or $page->parent->parent - hopefully you get the idea.
  5. If my screenshot is what you want to achieve, then it's very easy. Here are the settings for the details tab of the field: And here is the page tree that is being referenced:
  6. That is basically correct, but the timestamp will also be included in the filename of the cropped version. Is it important that the timestamp is updated to match the exact time the image is actually cropped? The "Rename on Save" option might work - haven't tested.
  7. I am not sure if this helps you or not, but CustomUploadNames (https://processwire.com/talk/topic/4865-custom-upload-names/) allows you to add a timestamp to the filename of an image using code like this: [Y-m-d_H-i-s] in the module's config settings.
  8. Is this what you want to see? The other option would actually be to use the ImageExtra module and the link option - it will work like a pagelistselect, rather than a select dropdown, but would avoid the need for repeaters.
  9. Sorry for the delay in getting back to you regarding the error - I still need to look at this again, but for now I have a new problem for you It looks like the Page Link option isn't working properly - it just shows a text input with "0" as the value. If I load "InputfieldPageListSelect.min.js" in the module, then it works as expected.
  10. Zahari - if you need to work with more than one tag, then this approach will work: foreach($page->images as $image) { if(!$image->hasTag("exclude")) echo $image->url;
  11. Maybe I am not understanding, but it should be as simple as returning this: $homepageImg->url Just make sure that the homepageImg field is set to "PageListSelect" without the "Multiple" and that the "Dereference in API as" is set to Single. That should then return the URL to the page they selected.
  12. We really need to see some code, but the general principle is to set up a counter and and if it equals 0 (the first loop), then add the "checked", eg: $items = $pages->get(1)->children(); $i=0; foreach($items as $item) { echo '<input type="radio" name="items" value="'.$item->name.'" ' . ($i==0 ? "checked" : "") . ' /> ' . $item->title; $i++; } Note the ternary operator checking to see if $i == 0 before outputting checked. EDIT: Well and truly beaten by Kongondo
  13. Once you have installed Migrator and MigratorWordpress you will use the XML from WP and upload it. It will create all the pages, templates, and fields required. It will even create users in PW based on the names of the authors of the blogs in WP. Hope that helps.
  14. Be sure to check "Import Created / Modified Dates" when running the import.
  15. What about adding a Font Awesome plugin to Ckeditor: http://ckeditor.com/addon/ckeditor-font-awesome
  16. Hey kongondo - small bug for you. When editing a page in a modal window - eg through Lister, the Export Data button is ending up at the bottom of the modal. The PW modal code grabs some buttons and forces them to be in the footer, but I am not sure why "export data" is ending up there, but "clear data" isn't - likely a class that has been applied to the export button - but I haven't investigated. Thanks!
  17. Is the WP site still being updated? If you are closing it down and would prefer to move all the posts into PW, we have an importer: https://github.com/NicoKnoll/MigratorWordpress If not, you might try using the RSS feed from the WP site and use this module to render it: http://modules.processwire.com/modules/rss-feed-loader/ - not sure about this - just a quick idea
  18. Module Toolkit does exactly this, and more! https://processwire.com/talk/topic/8410-module-toolkit/ It's still not in a release worthy state - some functionality needs some tweaking - it's on my list, but you know how it goes Still worth checking out though as I think it should handle your needs very well. PS Welcome to PW and the forums!
  19. Seems like a very possible scenario!
  20. HTTrack (at least how I have used it) just downloads the served HTML pages - it doesn't need any access to your server for this - it just grabs the pages that any browser can view. How do you know that the copy isn't just serving static HTML pages? If that is the case, then there really isn't anything that can be done. Even if they have duplicated some dynamic functionality from your site, that doesn't necessarily mean anything was hacked. This does seem a bit weird though. I assume you mean the same IP CIDR block, rather than the exact same IP address?
  21. Beautiful work! I think I might have said this just recently to some of your other new features, but it is true - this has become one of my favourite field types. Now go spend some time on some of those commercial modules you have cooking
  22. No problem - it looks like that approach of setting to false, doing something, and then setting to true is used in several places in the PW core. Interestingly, the cheatsheet mentions setting to false, but doesn't show true as an option - maybe just meant to be assumed - weird it doesn't show: $a->setTrackChanges(true|false) That would be consistent with others.
  23. Great - just committed a new version of BCE (master branch) with those changes - thanks for figuring this out!
  24. I think that setting TrackChanges to false seems like a great idea - I will happily implement that in BCE - do you want to suggest it to Ryan for the core version of that method? Just to clarify - this is PW core changes you are talking about and not something caused by BCE - correct?
  25. Yeah, I was talking about the ability to import a CSV via the API - perhaps like I did with the TableCSVImportExport: http://modules.processwire.com/modules/table-csv-import-export/ $modules->get('TableCsvImportExport'); // load module // data, delimiter, enclosure, convert decimals, ignore first row, multiple values separator, append or overwrite $page->fields->tablefield->importCsv($csvData, ',', '"', false, true, ',', 'append');
×
×
  • Create New...