Jump to content

adrian

PW-Moderators
  • Posts

    10,902
  • Joined

  • Last visited

  • Days Won

    349

Everything posted by adrian

  1. Just committed a fairly major update to support full migration of files and images, including rewriting of the src tag to match the ID of the new page for images embedded into RTE fields. Additionally, the module now also migrates the template .php files. Files/images/template files and the json structure/data file are exported in a zip file which is then imported into the destination PW install. So, you can now select one parent page during export and it will migrate the following content for all child pages of the selected parent: All standard field types, including RTE, and decoding of links modified by the PageLinkAbstractor module and abstracting again on the destination PW install. File/Image/CropImage fields including the actual files/images/thumbnails and all other variations Repeater fields and all their required fields, templates, and all content, including files/images Page fields (and the pages, templates, and fields that make up their selectable pages) Multi-language versions of all field content Templates (including Access, Family, URL and other settings) and the template .php files. It even grabs the appropriate file if you are using the "Alternate Template Filename" setting. NB the templates directory on the destination PW installation must be writable for these to be imported. So, you could build sections of content on a local dev PW installation, export it, and then with a couple of clicks import everything into the live PW installation. Some outstanding issues that I hope to get to shortly: Need to support images inserted from a different page into an RTE field Rewrite any references to page ids, eg $pages->get(xxxx) in template .php files so they will be converted to the correct id on the destination installation. Need to look into the new core link abstractor that was added to PW 2.4 and see how to handle those links compared to the PageLinkAbstractor module. I still want to add finer control for determining exactly what components will be exported and imported. Generally needs lots more error checking for things like making sure required languages are installed on the destination PW install etc Need to add checks so that existing template php files are not overwritten (or give the option to choose) Might need to override PHP max_execution_time and other settings for larger exports and maybe chunk out zipping of all images to prevent memory issues on larger exports. In its current state it is handling almost all my needs, but I would really like to have this robust enough for anyone to use, so if you have time please do some testing for me - THANKS! At the moment, please only use it on two unimportant test PW installs!
  2. You can make a simple contact form using either of these: http://modules.processwire.com/modules/form-template-processor/ http://modules.processwire.com/modules/form-template-processor-mailer/ Or if you want something more powerful you should take a look at: http://modules.processwire.com/modules/form-builder/ No matter which option you choose, it is easy to insert the form anywhere you want in your site.
  3. Well the definition of cute that I remember from my Aussie upbringing was: "Ugly, but interesting" Glad we got that cleared up
  4. Cute ? I actually thought it was pretty functional - nicer to be able to click on the parent item or expand it to access the children. You not sold on the idea?
  5. I actually love the way meanmenu handles this issue: http://www.meanthemes.com/demo/meanmenu/demo.html
  6. echo $page->documents->description; should work just fine. I think it is likely your documents field is set to handle more than one image, so you will need: echo $page->documents->first()->description; I just did a little testing a noticed something slightly unexpected. When there is one image in the field you get: echo $page->documents; //selfie.jpg echo $page->documents->first(); //selfie.jpg echo $page->documents->url; //site/assets/files/xxxx/ echo $page->documents->first()->url; //site/assets/files/xxxx/selfie.jpg echo $page->documents->first()->description; // image description echo $page->documents->description; // blank With two images in the field, you get: echo $page->documents; //selfie.jpg|selfie2.jpg So I guess I had never noticed that you actually get the filename returned from a files array. I would have expected an error with: echo $page->documents;
  7. A couple of options from Soma for achieving this: http://processwire.com/talk/topic/3159-hide-settings-tab-in-page-edition/?p=31126 http://processwire.com/talk/topic/4680-block-access-to-settings-delete-and-view-tabs-for-page/?p=45734
  8. I think this thread should answer your question: http://processwire.com/talk/topic/5083-possible-bug-page-fieldtype-with-custom-selector-to-find-selectable-pages-returns-error-while-saving-page/
  9. I think offsite in general is a bad idea - eventually something will break. I did think of the Github option, but seemed wasteful to put images in with the module files and hackish to put them in a separate "pw-screenshots" repo. Hopefully Ryan will chime in with a better solution!
  10. Well in the first example you pointed to, horst is hosting the image on his own website and the second example is from Ryan. He is hosting it in the assets folder of the modules directory, but I don't think the rest of us have that option - at least I don't see it when I try to edit one of my modules - maybe I am missing something?
  11. foreach($page->children("sort=DMCContact_Country") as $child) { $class = $page === $child ? " class='on'" : ''; if($child->DMC_represented!=0) { echo "<li> <a$class href='{$child->url}'> <span class='label label-default'> {$child->DMCcontact_Country}</span> {$child->title}</a></li>"; } }
  12. Often the "documentation" for third party modules is in the first post of the associated forum thread. Sometimes this is very similar to what's in the Readme file or in the text in the modules directory, but often it is much more detailed. That would be my suggestion for you at the moment, but I would agree that all module authors should do a better job of ensuring the text in the modules directory entry is more complete. Actually thinking about this, I think one of the problems is that the modules directory doesn't support images at the moment so we can't add screenshots here whidh is why I tend to think of the forum thread as the main spot for documentation. Ryan - any chance we could add support for images in the modules directory?
  13. I assume you are talking a front-end form using the API? You can make it transparent to the front end user. Have your form processing code save the page using whatever field you want for the title/name of the page, then $newpage->save(), then process the rest of the form fields including the file upload and then save again. Does that make sense?
  14. Thanks for the feedback guys - I hadn't tested thoroughly yet, although maybe the size of the .app file should've rung some alarms - pretty huge for a text editor!
  15. You just have to change the Label Field from Title to Name and you'll be good!
  16. Thanks for giving me yet another tool to try Just when I was thinking about switching from ST to Brackets I have another option to try. Have you guys seen this: http://blog.brackets.io/2013/05/31/better-javascript-debugging-with-theseus/
  17. I just set up a page field with parent of Admin > Access > Users and it works fine. Do you get that error when saving the field in the admin, or a page with that field on it, or saving the page via the API?
  18. I think we were at least all on the same track regarding the issue with id and %= On the either / or issue - I really can't wait for this, it is one of the very few things in PW that are sometimes a cause of frustration because it not only feels dirty combining more than one page array, but also because of the issues regarding pagination when you do end up doing that. Nice examples there teppo
  19. Thanks for the link teppo, but none of the examples that David or myself have posted here are of the either/or ilk. Just to spell it out, id|name=1|about would be the same as: WHERE id=1 OR name=1 OR id=about OR name=about An either/or would maybe be: WHERE (id=1 AND name=home) OR (name=about) It's late here, so maybe I am not thinking straight, but I think I am on the right track? That said, I am not exactly sure what David is wanting to achieve with the a|b=c|d style selector. Maybe he is after an either/or, even though that's not what it currently does. I actually don't think I've seen this style documented anywhere either, but maybe it is just assumed to be obvious based on what else you can do. I might sign off now before I confuse anyone else
  20. No problem. PW is incredibly flexible - more so than probably any other CMS/CMF, but it does require that you learn at least some basic php. Mostly foreach and if/else will get you going. I would definitely recommend googling a few tutorials on the possible options/rules for these statements so you can better understand the syntax. It can seem a little confusing at first, but once you get a handle on the basic rules, it really is pretty easy!
  21. Not exactly sure what you are still having problems with, but this line: if $page->parent->name=categories { needs to be: if($page->parent->name=="categories"){ Same goes for the years if statement. Does that fix things for you, or are there other problems?
  22. I thought that too, but then I noticed that: id|name=1|about returns Home and About and: id|name=1001|about returns just About. Is it possible that Ryan has introduced partial/unannounced support already, or am I missing the point?
  23. To be honest I haven't actually used that module until now. I am also having issues with the selectors you are trying, but the following all work fine: path=/about/ id=1,path=/ path%=/about/ I think it is logical that %= wouldn't be supported for id, although I can see the issue when you're trying to combine OR's like that. Not sure if that really helps, but I am sure Ryan or someone else more familiar with that module will chime in soon.
  24. You need to install the PagePaths module which is included in the Core, but not installed by default. http://processwire.com/talk/topic/4874-what-does-page-paths-module-do/
×
×
  • Create New...