Jump to content

ryan

Administrators
  • Posts

    16,772
  • Joined

  • Last visited

  • Days Won

    1,531

Everything posted by ryan

  1. This is great Nico! That was fast. Thanks for posting this. I just created German in my dev copy, dragged in your ZIP file and now I'm running PW in German! If only I could read it. It looks like it works great. Congrats–You are the first person to do a real translation for ProcessWire! How did you like using it? Any highlights or concerns? Thanks, Ryan
  2. Sounds good–this has been added in the latest commit to the dev branch.
  3. Soma this is awesome! Thanks for posting the video. Antti's right–you are on fire! I can't wait to give this a try.
  4. Yes, you can do that. This is what's called a 'singular' module, meaning it returns a new instance on every $modules->get("MarkupRSS"). So you can create as many instances as you need, and they don't share data with each other.
  5. Thanks for posting Statestreet. It sounds like a good and clever method to me, and I imagine it gives an nice app-like feel. Feel free to post a URL to it if you want. Like with anything ajax, you probably want an alternate/accessible path to pages if you want the content indexed by search engines, but I'm guessing you already know that.
  6. I think this really just depends on what you are using to handle your modal dialog. Without knowing specifics, I'd say your modal dialog content should be set to an iframe pointing at your login page. And your login page should be output in a manner that looks good in a modal dialog (i.e. probably just the content area and not header/footer.
  7. Soma, I'm not exactly sure why that would be happening, but it sounds like a possible bug in the system. I've not had it happen here before, so wondering how I can duplicate. Is there a specific module that you are using where it always happens?
  8. Check your field settings for that page. Make sure that "parent of selectable pages" is unset. If set to 'home' then click 'change' and then 'unselect' home, and save. I'm guessing that's why it's only accepting pages with parent home. Likewise, make sure that "template of selectable pages" is unset (unless you know you want it).
  9. Looks like I missed that headline on the Search page. Just added it to the latest commit. Once you've pulled in that commit, go to Setup > Languages > German and click the 'edit' link for the file for the ProcessPageSearch module, and you should see it there. Thanks for finding that and please let me know if you come across any more.
  10. Nico, thanks for testing– Please let me know how it goes for you and how the experience is of using PW in doing translation?
  11. That's correct. What will be changing is that more modules will be added (more things to translate). But we have 20 translation files already, so enough to keep busy. I recommend saving a copy of your JSON files as a backup after you've completed each file translation. Just as a safety measure until this thing has had some use. Either that, or do your translations in a separate text editor and paste them into PW's translation entry fields. I'd hate to think of someone spending half an hour translating some stuff and then hitting Save at the end and being told they need to login. The two are very different and probably compliment each other well. However, they may conflict with one another in the short term (for instance, I noticed Oliver's module installs a Languages section in Setup as well). So don't run them together just yet. But I imagine some cool possibilities down the road having the PW 2.2 language support and Oliver's module running together at the same time.
  12. I was wondering if anyone would be interested in helping me test an early version of the multi language features in the admin? (Antti? ) While the system is not done, most of the fundamentals are there and I believe it's ready for some testing. However, it's not ready to use in any kind of production environment, and you won't want to start building a new site with it. Instead, if you test it, you'll want to use a completely blank copy of ProcessWire and not use it for anything other than testing. Currently the translation functions are in place. You can translate many (though not yet all) of ProcessWire's core modules. You can also enter labels/descriptions for Fields or Templates in multiple languages. Multi language support with your own field values (as discussed earlier in the thread) is not yet in place. I have it working locally, but feel I need more work on that part first. I also think that part is not nearly as useful as this part, so figured I'd focus on making this first part as good as possible first, and then go back to the multi language field values. How to install The alpha version of ProcessWire 2.2 is available as the 'dev' branch on GitHub. To be safe, don't switch any existing site to the dev branch, instead start with a brand new installation of ProcessWire. To install from GitHub, type this: git clone git://github.com/ryancramerdesign/P21.git git checkout dev The only difference between this and how you'd install any other time is just the 'git checkout dev'. That makes it switch to the development (PW22) branch. (Note that it will still say it's PW 2.1, don't worry about that). Now go ahead and install ProcessWire as usual by pointing your browser to it. Once installed, go to Modules > Language Support > Install. Make sure that 'English' is checked as the default language and click Submit. Note: Stick to using the default admin theme. There are components of the theme that need to be multi-language ready, and PW's default admin theme is the only one ready for this at present. How to use 1. Your Setup menu will now have a Languages option. Click to that and note that English is the only installed language at present. 2. To start, we're going to add Spanish as a langauge. Click Add New. Enter "es-es" as the name (or something else if you prefer), and click Save. 3. Enter "Español" (or if you prefer: "Spanish") for the title. 4. Attached to this post is a ZIP file of language translation files for Spanish. If your installation supports ZIP uploads, just drag the ZIP file into the Language Translation Files field. If not, unzip that file and drag them all into the field. Then hit Save. 5. Click the Profile link at the bottom and change your Language to Español. Your admin should now be in Spanish. Note: Not all modules are translated. I've focused the effort on making the Page-related modules translatable (i.e. the ones your clients might use). Nothing under Setup, Modules or Access is translatable at present. When you go to edit a page, you may notice that all the field labels are still in English. Read below to see how to change those: How to translate field labels and descriptions All fields in ProcessWire are custom fields, so a pre-defined translation isn't going to know what fields you have in your system or what translation they should have. So that's something that is left up to the individual installation. Lets say that you wanted to provide a Spanish translation for the "Title" field, here's how you'd do it: 1. Go to Setup > Fields > and edit the title field. 2. Note that you now have English and Spanish labels available. You also have English and Spanish descriptions available. Enter "Título" for the Spanish label and hit Save. 3. Repeat for any other fields that you want. When you edit a page using that field, you should see the label and description in the language you've chosen in your user profile. How to change your default system language Lets say that you want the system to assume Spanish by default. That would mean that Spanish would be assumed before a user was even logged in (and the login form would display in Spanish). Here's how you'd do that: 1. Go to Modules > Language > Language Support. 2. Click the Spanish radio button, and click Save. 3. Spanish is now assumed bo the default system language. When a user sees the login form, it will be in Spanish. How to add another language 1. Click to Setup > Languages > Add New 2. Enter a name for your language. I recommend using a language code those discussed earlier in the thread (like no-NO or fi-FI). Click Save. 3. On the next screen, enter a title for your language, preferably in the language-native (non-English) spelling. 4. For the Language Translation Files, you can choose to translate them individually or upload a bunch of other translation files and edit them (this is easier). Both options are described below: To perform an individual module translation, click new in the files field. Then enter the path to the file you want to translate. For example, to translate ProcessPageEdit, you'd enter: /wire/modules/Process/ProcessPageEdit/ProcessPageEdit.module and click Submit. On the next screen it would show you all the translatable phrases it found. To build a translation from existing files, just upload the files for another language's translation to the files field. You might want to use the attached ZIP (for Spanish) as your starting point. Then click edit for each file, delete the Spanish translations and change them to your language's translations. 5. If you need to support more than one language on your site's admin, then you'll want to translate field and template labels as well. These are site-specific, and located under Setup > Fields > any-field, and Setup > Templates > any-template. How to share your language translation Download all of the JSON files for your translation and ZIP them up. To download, just click on the translation filename in ProcessWire. If your browser renders the JSON file, then you may have to right-click then 'Save File'. Place them all in a ZIP and upload here. Once PW22 is final, we'll be providing language translation downloads on the main site. You can change ProcessWire's English output too You can change the default/English output in ProcessWire just by adding translations to the English language already in the system. If you only need to change one thing, that's okay. Just change what you want, and leave everything else blank. You can have as many, or as few translation files as necessary. But if you only need to translate a phrase from 1 module, then only keep a JSON file for that one module in your Language Translation Files. What's not here, but still coming Multilanguage text-fields as described earlier in the thread. Date field localization Still making more modules multi-language ready setlocale() support. Other tweaks… Disclaimer 1: Just to repeat from above, don't use this for production work. Stuff may still change, and I don't want anyone's site to get messed up due to this being a work in progress. Disclaimer 2: I don't know Spanish – I just used Google Translate for the Spanish translations. If you speak Spanish, I'm guessing some (or most?) of these won't read quite right. Disclaimer 3: I'm one of the only people here that isn't multi-lingual. If I've missed something obvious please tell me (just go easy on me). I appreciate all of your feedback. ProcessWire-Language-Spanish.zip
  13. Thanks for posting Neil! I'm glad to hear you are doing good things with ProcessWire while having fun. It's great to have an internet security specialist here too.
  14. Wouldn't it make sense to just have it as the first item in the breadcrumb trail? I also like the idea of having it in the top right corner (or top left). If we go that route, I'd want to add it in a way that doesn't mess up the other themes. I think the site link makes sense where it is in WP because it's in the context of the site's name up in the masthead (if I'm remembering correctly). But PW doesn't have the site's name in the masthead and instead just has the logo. So the placement next to the logo doesn't seem quite as contextual in PW as it does in WP, even if it looks good.
  15. Thanks for your feedback Mjmurphy! I don't think I have control over the filename that GitHub creates for the ZIP file. So what Soma suggested to rename it is probably the best bet. Or, this would be even better if you have the capability on your server: cd site/modules/ git clone git://github.com/ryancramerdesign/FieldtypeMapMarker.git Then you'll end up with a nice dir called /site/modules/FieldtypeMapMarker/ with all the files in it. And whenever you want to update it, just do this: git pull …and that's all there is to it. Good idea, I just did it. I'm actually planning on doing something with the combination of these two. I'm going to use the status codes to determine the zoom level. Just haven't gotten around to it yet. But zoom level is one of those things that is a bit hard to predict what people will need. For instance, I needed it zoomed out in the project where I used it. I figured the safest bet is to zoom according to the address accuracy and/or provide a config option that lets people set what default zoom they want. I agree it would be nice. But this is a Fieldtype that's designed to function non-interactively (like if you were using it from the API), so the geocoding can't be dependent upon javascript. If interactive updates were added, they would have to be something separate (and perhaps something to do in a future version). I wasn't thinking of it as a replacement for that module, though perhaps the functionality of the two could be combined. The primary intention with this module was to serve as a demonstration for people that are making their own fieldtypes. So I'm interested in keeping it straightforward and easy for someone to follow. If there's a way we can add the capability you've mentioned without adding much complexity to it, I'd certainly like to. I don't currently know how to add that capability, but am interested in learning how.
  16. Nice job Nico! It looks well put together. A couple questions: 1. What about an option of adding a target="_blank" attribute for external links? Honestly, that's the one my clients ask for more than any other. 2. Regex question just for fun: why are you using the 'U' (ungreedy) modifier in your regex? After a brief look, I couldn't identify that it would affect this particular regex, but not positive, so figured I'd ask. I think it's just for external links, as a way to tell Google not to pass along pagerank to those links. But it's intended to be for things like user posted URLs in comments, rather than for regular external links. I would be curious to know if Google penalizes one for using rel="nofollow" for all external links across the board. I'm betting not, but it does seem like maybe an abuse of what the nofollow tag was intended for. Then I would be really worried about the above, as that would apply it to all external links even if you had hard coded them in the template file. Keeping it as a textformatter at least ensures that it's only applied to the fields where you want it. Though I think it'd be even better if it was an option on our TinyMCE link screen, then it would be much more surgical and placed where you really want it. It doesn't look to me like it would remove existing classes or attributes. But it does look like it would add second class or rel attribute to links that already had them. Maybe not an issue in TinyMCE since these attributes are disabled by default, but maybe a good thing to check for in a future version. Last item I wanted to mention that applies to all modules. When you all make a module, put your name at the top, not mine. Here is the top of TextformatterMarkExternalLinks.module: /** * ProcessWire Mark External Links * * ProcessWire 2.x * Copyright (C) 2010 by Ryan Cramer * Licensed under GNU/GPL v2, see LICENSE.TXT * * http://www.processwire.com * http://www.ryancramer.com * */ So others looking at this would think I'm taking credit for your module. And I'll be glad to do that. But you deserve the credit. So something like this would probably be better: /** * Mark External Links module for ProcessWire 2.1+ * * Add's a class='external' and a rel='nofollow' to every external link. * * Copyright 2011 by Nico Knoll * http://p.stadtpirat.net/ * Licensed under GNU/GPL v2, see http://processwire.com/about/license/ * */ Or if you prefer to keep the ProcessWire copyright info, then just put it after yours: /** * ProcessWire Mark External Links * * Add's a class='external' and a rel='nofollow' to every external link. * * Copyright 2011 by Nico Knoll * http://p.stadtpirat.net/ * Licensed under GNU/GPL v2, see http://processwire.com/about/license/ * * ProcessWire 2.x * Copyright (C) 2010 by Ryan Cramer * Licensed under GNU/GPL v2, see LICENSE.TXT * http://processwire.com * */
  17. The main reason it's not there is just because $input is another layer on top of $_POST (or $_GET or $_COOKIE) and I wanted to limit the overhead of it as much as possible, at least until we needed it. Didn't want to enable the possibility of someone posting endless multidimensional arrays from a security standpoint. But ultimately if the need was there, I would add it. And now that its come up, we might as well add it. Probably what I will do is just limit the recursion to 2 or 3 levels to keep it safe. I don't see any potential issues with adding it. If you've had the need for it, then I'm sure others will to. If you want to submit a pull request, I'll bring it into the core. Otherwise, I'll plan to add and commit an update to the core soon. Thanks, Ryan
  18. Since you are using getimagesize() that function wants a disk path, not a URL. You'd want to use: <?php $img->filename; // returns full disk path or if you have multiple images, you'd loop through them, or grab one of them and retrieve it's filename.
  19. I think it's a great idea too. Are there any other CMSs that others here have expertise in that they'd like to write something? Perhaps we could build an archive of these on the site in the 'about' section so that people can get a good idea of what the differences are between ProcessWire and another CMS they are using.
  20. This topic has been moved to Tutorials. [iurl]http://processwire.com/talk/index.php?topic=754.0[/iurl]
  21. This topic has been moved to Tutorials. [iurl]http://processwire.com/talk/index.php?topic=755.0[/iurl]
  22. FieldtypeMapMarker Module for ProcessWire 2.1+ This Fieldtype for ProcessWire 2.1+ holds an address or location name, and automatically geocodes the address to latitude/longitude using Google Maps API. This Fieldtype was also created to serve as an example of creating a custom Fieldtype and Inputfield that contains multiple pieces of data. Download at: https://github.com/r...ldtypeMapMarker How to Use To use, install FieldtypeMapMarker like you would any other module (install instructions: http://processwire.c...wnload/modules/). Then create a new field that uses it. Add that field to a template and edit a page using that template. Enter an address, place or location of any sort into the 'Address' field and hit Save. For example, Google Maps will geocode any of these: 125 E. Court Square, Decatur, GA 30030 Atlanta, GA Disney World The address will be converted into latitude/longitude coordinates when you save the page. The field will also show a map of the location once it has the coordinates. On the front end, you can utilize this data for your own Google Maps (or anything else that you might need latitude/longitude for). Lets assume that your field is called 'marker'. Here is how you would access the components of it from the API: <?php echo $page->marker->address; // outputs the address you entered echo $page->marker->lat; // outputs the latitude echo $page->marker->lng; // outputs the longitude Of course, this Fieldtype works without it's Inputfield too. To geocode an address from the API, all you need to do is set or change the 'address' component of your field, i.e. <?php $page->marker->address = 'Disney Land'; $page->save(); // lat/lng will now be updated to Disney Land's lat/lng
  23. Clicking the 'check for new modules' button should clear those cache files (that's what the button is for). The only thing I can figure is that maybe those files were no longer writable to PW for some reason? Either way, glad you got it resolved.
  24. Soma, thanks for this fix for this and for the IE8 file delete link fix. I tested both here and both worked well so I committed them. Thanks again!
  25. Rob, I can't think of why they wouldn't be recognized unless your class isn't specifically defining a getModuleInfo() function. That getModuleInfo is not something that can be inherited as it's the only thing that PW has to tell what your module is. If you haven't defined that and made it return the proper array of info, then you need to do that. If you've already done that, then feel free to email the files to me and I can try from here. My email is ryan at this domain name.
×
×
  • Create New...