Jump to content

adrian

PW-Moderators
  • Posts

    11,190
  • Joined

  • Last visited

  • Days Won

    372

Everything posted by adrian

  1. All these avatar changes are freaking me out I am starting to see vxda's point. I was caught up on embedding into RTEs and then display through templates, but I can see the scenario where it would be great to have a client be able to insert an existing image from another page into a dedicated image field.
  2. This is in the works: http://processwire.com/talk/topic/3219-images-manager-alpha/
  3. But why do you need to upload them multiple times? You can access them from any page, either through the RTE example above, or using the API to display them in your templates like: $pages->get("name-of-other-page-with-image")->image-field-name->url That assumes the images field is set to only handle one image. If it contains more than one, you would need: $pages->get("name-of-other-page-with-image")->image-field-name->first()->url or instead of first(), you could choose last() or eq(n) where n is the number of the image in the field based on their order.
  4. From: https://github.com/evanmcd/SublimeProcessWireSnippetsAdvanced If you're using Git, the best method is to clone this repository to your ST Packages folder. (on Mac, it's here: /Users/your_username/Library/Application Support/Sublime Text 2/Packages/). You can also download the zip file and unzip into the Packages folder. Either way, I would recommend creating a ProcessWire subfolder as there are more than 200 files.
  5. Just a wild guess - do you think it is possible that they have messed with the .htaccess file or have some other redirect rules (maybe even in the apache conf file) that would be causing the redirect?
  6. If you are referring to using them in an RTE, then to expand on Kongondo's comment, when you are in the Insert Image dialog, click the "Images on Page" header and click the "change" link to browse for images on another page.
  7. Hey Antti, I have just committed an update that I think fixes the multi-language issues. I know there are two different ways to do different language versions of a field, but from my understanding, this should work with both. Would you mind checking on your end and see if the import is now working for you. Thanks!
  8. I am no Github expert, but the only way I have ever been able to submit a pull request is to fork the full repo. This seems to confirm this: http://stackoverflow.com/questions/14821583/pull-request-without-forking However maybe I am not exactly understanding what you mean by "Or can I do this only with the files which need the changes?"
  9. I am not sure about that error in the context of field creation - perhaps you can share what went wrong. Generally not good practice as it can get you in trouble if you don't know what you are doing, but you may need to fire up PHPMyAdmin and delete the "field_fieldname" table and also the relevant row from the "fields" table.
  10. Glad you got it working. The $videoItem->video makes me think you are storing the URL for the video in a dedicated field? If that's the case, you shouldn't need to do that preg_replace. You already have the id from $my_array_of_vars['v'] so you should be able to just build the embed version directly from that.
  11. Ok, so it sounds like you are manually adding the thumbnail image to an RTE? Maybe you don't really need the video embed module, because you don't actually want the video to play inside the RTE field? There are lots of ways to go about this. You could use a regex in your template. You could make your own module. You could maybe use the Hanna Code module (http://modules.processwire.com/modules/process-hanna-code/) and just enter the video ID and use that to output the thumbnail and link to open in fancybox. You could even use JS to modify the link. An example of your exact usage would really help to narrow down the best approach.
  12. It depends on what you want to do exactly. Because the module converts a Youtube link that is in an RTE texatarea field, you already know the id of the video because it is in the link. You could easily insert the image link using the url schema from that first link I posted. Maybe if you can explain your usage scenario we can help more. Where you do want to display the image? How is it connected to the embedded link. It is easy to grab the id of the video from the link in either PHP or JS using a regex, but the video module also stores the id in the PW database (in the textformatter_video_embed table), so this might also be an option depending on your needs. EDIT: Here is the function in the module that parses the video url: https://github.com/ryancramerdesign/TextformatterVideoEmbed/blob/master/TextformatterVideoEmbed.module#L127 Or you can use: $url = "http://www.youtube.com/watch?v=C4kxS1ksqtw&feature=relate"; parse_str( parse_url( $url, PHP_URL_QUERY ), $my_array_of_vars ); echo $my_array_of_vars['v']; // Output: C4kxS1ksqtw
  13. Hi vxda, Assume you are using youtube: http://stackoverflow.com/questions/2068344/how-to-get-thumbnail-of-youtube-video-link-using-youtube-api And here is some code for both youtube and vimeo: http://darcyclarke.me/development/get-image-for-youtube-or-vimeo-videos-from-url/
  14. Thanks Ryan, I hope I can make some time in the next couple of days to get a few more things sorted out with this. I am excited to get this release worthy!
  15. Hey Ryan, Thanks for the great feedback. I have incorporated the first two of your suggestions: $page->phone now generates the same as $page->phone->formattedNumber The country code and extension input fields are disabled by default, but can be enabled from the field's Input tab I am not really sure how to make your last suggestion work consistently. Given the large variety in the number of digits in phone numbers around the world, I don't know how I could reliably parse a number entered in one field. How would I know what digits to separate out into which of the subfields? It would be do-able if they always entered in the same format - eg a space between each component of the number, but I think it might cause more problems than it solves. Do you have an idea I am missing? I have also added a few new features: Ability to define an override format when filling out a phone number - I thought this might be useful for organizations with international offices where they want to format different phone numbers on their web site using different local formats. This option is off by default, but can be enabled on the Field's Input tab. Ability to edit all the formats available from the format selector, along with comments at the end of each entry. This was needed to make feature 1 work so the developer can define multiple custom formats without modifying the module's core code. This is found on the Field's Details Tab. Ability to change the numbers used in the formatted examples in the format select dropdown. I thought this would also be useful for international users so that they could make the numbers look more familiar - eg Australia has two digit area codes that always start with a '0'. This is found on the Field's Details Tab. One issue I am having with new feature 3 is that I can't seem to store values with leading zeros in the input field config field (ie the values in the data field of the "fields" table). I haven't yet dug into the source code to see where the leading zero is being removed - any ideas how I can solve this? Ok, I see the problem is in the core wireEncodeJSON function. Only trouble is I am not sure how I can override this since I am not actually calling it directly. EDIT: Also wondering if I should maybe move the Phone Output Format Options and Example Number Options to the modules config settings, rather than for the field. Obviously reduces flexibility, but simplifies setup. Any thoughts? As a side advantage, it would seem that it would allow me to solve the (int) problem mentioned above because I could hook into saveModuleConfigData (http://processwire.com/talk/topic/1849-clearing-cache-on-module-save/). I don't seem to be able to find a way to hook into the saving of ConfigInputfields - is that possible? I am going to attach the revised version here for the moment. I would really appreciate your feedback before I update the code on Github and update the docs. I am worried that I might have overcomplicated things with all these new options. Thanks! InputfieldPhone.module FieldtypePhone.module
  16. I didn't know that Soma - thanks for the correction!
  17. Martijn's points are very valid, but I would also argue that the advantage to getting by ID rather than name, is that the client can change the name of the page if they want and the selector will still work, so it is a bit of a trade-off. I agree that the second makes no sense. Any selector together with ID will always be meaningless as only one page can have that ID anyway. See Soma's post below.
  18. I wonder if this is of any help for you. It is about wordpress on Plesk/iis, but should work fine for PW http://smackwagondesign.com/permalink-for-wordpress-on-a-windowsplesk-server-%E2%80%93-iis-6-mod_rewrite-fixed/
  19. Does the "template" that you are calling via ajax really need to be a template file with a PW page that it is attached to? If you place it in the website root folder and call it from there, PW will leave it alone. I have done that with files that process ajax form submissions and it should work for your purposes as well.
  20. That's great news Marty Unfortunately I haven't managed to make any time to work on this today and I am away for the next couple of days, but I hope next week to solve the multilanguage issue that Antti discovered - I have a plan and should be quite simple so long as the receiving PW installation has the needed languages installed - I should be able to issue a warning if it doesn't. I also have some ideas on how to make migration of images and files work too and maybe even RTE embedded images. Not sure how important migration of this sort of content is though - maybe it is adding too much complexity. Do you have any thoughts on number 3 of the road map above: http://processwire.com/talk/topic/4420-page-list-migrator/?p=43582 BTW, I have spent many days in your part of the world when I was a keen climber - beautiful place!
  21. Wow Ryan - those new multi-value fields sound brilliant - can't wait to see your implementation. I'll have to use them, just to have a reason to send some money your way. You also really got me thinking about the potential of custom fieldtype/input field combinations for an upcoming project which is extremely data heavy. I will still definitely need several custom database tables and SQL queries for the data manipulation side of things. These queries actually take quite some time to run, but only need to be run periodically to generate results. So I am thinking that I will store the manipulated results of these queries in some custom fieldtypes which will dramatically reduce the number of PW fields, yet still allow for API querying of the final results on the front-end. So many cool possibilities
  22. Ahh, that makes total sense - I am sure it is because all your fields become objects because of the two language versions eg: "body": { "data": "", "data1029": "" }, rather than just simple strings. Not sure how difficult this will be to fix - hopefully simple
  23. Thanks for finding that Antti, although I am having trouble reproducing it. Unfortunately I am pretty ignorant of the multilang features - typical English speaker I'm afraid I just installed the Language Support (Core) module and ran a successful import without any errors. I am running a fairly recent dev version so I wonder if that is the difference? Or maybe I actually need to install a language pack and set up an alternate language field to trigger the error. I'll keep investigating, but do you have any ideas? BTW, I just fixed a problem with the country and state list files - my subconscious must have realized and woke me up (it's early here) - I should learn never to release code late at night This change won't be causing your error though.
  24. Just made a couple of quick updates on Github to v0.0.3 now to fix some path issues for the main parent in some situations. Hopefully fixed now, but we'll see Off to sleep now - probably some more bug finding tomorrow EDIT: Marty - let me know if this version works for you.
  25. OK, I have a new version ready, with a new name: Page Tree Migrator This new version has a new Github page: https://github.com/adrianbj/ProcessPageTreeMigrator It can still handle simple "page list" imports and I have update the format of the countries.json and us-states.json files at: https://github.com/adrianbj/ProcessWirePageLists WARNING: It should still be considered alpha at the moment, so please be careful !! You will now need this new module to be able to import those files. Whats' New Ability to import any page tree with infinite levels of children Templates are now created with all (I think?) settings from the original setup (including Family child and parent templates allowed). Three export options: - Everything, including all data pages - Field, templates, and structural pages - Fields and templates only I am not really happy with the middle one yet (see Road Map for more details), but I think the other two are very useful. Road Map Testing - It has been working great for me so far, but I am sure you guys will find some problems - I know it is far from perfect Code cleanup - at minimum I want to rename some variables etc to be more logical and add some detailed commenting. I am sure someone with more PW experience will see a mess in how I have achieved certain things. I know of a few things already that I want to redo, but for now I just want to get it out for testing Add more options for the "Field, templates, and structural pages" export option. At the moment this exports the templates, fields, and all pages, except for the final child level. My logic was geared towards something like a gallery with this structure: Gallery --Nature ----Image 1 ----Image 2 --People --Animals So, with this export option, you would only export the Gallery parent page, and the category pages (nature, people, animals). The image grandchildren won't be exported so you can use this to start with a clean gallery page tree. However, I think I should add more options that allow the user to select which levels of children to export and even which fields within these pages. That way you could choose to only export the title field for an entire set of pages, leaving the rest of the fields empty. Not sure of the most useful approach here. Any thoughts? Deal with any potential issues that occur when importing over an existing template if existing settings are different. What else do you guys want to see?
×
×
  • Create New...