Jump to content

Michael Murphy

Members
  • Posts

    141
  • Joined

  • Last visited

Everything posted by Michael Murphy

  1. I was also struggling to display the correct language dates (German). My date field is called news_date - the input and output format of the field set using the drop down is "18 October 2012". I am outputting the field in my template like this $page->news_date; I first tried setting locale in the site config.php and then in the page template, but it had no affect. setlocale(LC_ALL, 'de_DE'); I followed Somas advice in this post, installed the language support and added the German translations. I installed them as the default language. I changed the value found here "/wire/modules/LanguageSupport/LanguageSupport.module" - "Value to pass to PHP's setlocale(LC_ALL, 'value') function when initializing this language" is set to "de_DE" However, this also had no affect What I ended up doing was : <?php echo strftime("%d %B %Y", strtotime($page->news_date)); ?> And now it correctly outputs the German date. Not sure what I did wrong or if this is a bug, but I think the simplest solution would be to add the setlocale option in the site config (instead of installing the extra language support which might not be required).
  2. Hi mrs, Are you using a language gateway approach like on the example website? e.g. /en/contact or /de/contact where /en and /de are gateways that change the language. If you have a language gateway setup you could use something like this : //what is the current language $lang = $user->language; //this line sets the language to sites default. //"default" is the name of the sites primary language, in this case it's English $user->language = $languages->get("default"); echo "<li><a href='/en{$page->url}'>EN</a></li>"; //this sets the language to German, so you can get the pages URL in German $user->language = $languages->get("de"); echo "<li><a href='/de{$page->url}'>DE</a></li>"; //this sets the language back to current one again $user->language = $lang;
  3. Hi Joe, One of the nice features of the multilanguage fieldtypes is that when they are empty, they will fall back to the default populated field. For example, if you have a multilanguage title in English and not in German, when outputting $page->title (and the user language is in German) - it will output the English title.
  4. This looks great, and I hope it’s a big success - I will gladly pay a good price for this. I was actually just playing with the previous experimental "Form Template Processor" module you released, so this is great timing. The scenario I am looking to build is a community site that accepts new events - If the user is logged in (via Standard login / Facebook or Twitter) they can add new events (date, location, category). So I would be interested in being able to save form entries to a page. Is this is scenario where you would recommend using the new Form Builder? Or as they will be logged in should I just give them access to the main PW admin area? sending mail one of my main concerns with building web forms for clients is the reliability of sending emails - not all hosts are equal - some host have no way to send email, or have unreliable / poorly implemented mail send. I consider any client website form as business critical, so I want to make sure that the emails are being delivered. This is one of the main reasons I use Wufoo.com for most all my clients website forms (as well as the other advantages you mentioned with this module - the speed of creating a form, the spam protection, the database logging of all entries and ability to export.) Maybe the ability to use a full email account (imap / pop3) for sending? Or the option to use a mail sending service like Postmakapp.com, Amazon SES, Sendgrid.com, Mandrill.com… Just to clarify - - You can use any field type within processwire, including page types and custom fields? - You will have full control over the markup? For future ideas, one of the really cool things I like about Wufoo are the integrations with other services - for example allowing a user to be added to a mailing list on campaign monitor / mail chimp when using a contact form. I’m sure this is something that could be easily done with PW. Thanks!
  5. Regarding the original request to use  + s (CMD + S) to save files, I tried with Somas HotKey module, (use meta+s in the settings) however, I think  + s is a reserved shortcut for "save" and cannot be overridden. (Maybe you can by changing the OS default keyboard shortcuts, not too sure)
  6. I have always found the dedicated "media library" to get messy after a while and is always confusing clients - It takes the user out of the context of the current page. It’s definitely a legacy of previous CMS systems. I have found the page related media to work far better in the systems I have built since using PW. The only scenario where it might make sense is for a set of shared assets or when you want to restrict a user to use certain media (like for branding or style guides). In this case you could create a dedicated page called assets which will then be accessible when you use the media browser in TinyMCE . Maybe an additional field type could be built that allows you to browse a specified page - call it “Media Browser” - which lets you assign a page that has the media assets. This would appear like the current image field type, apart from when you click “open file” it shows you a list (nice thumbnails) of the available media.
  7. Thanks Ryan. Have you heard of embed.ly? they might be a good service to use for embedding many different urls from different providers (over 200). The free account can be used for upto 10,000 urls a month http://embed.ly/docs/endpoints/1/oembed
  8. The Alt key (also called the Option key) on Macs is normally used for special characters and adding umlauts and accents on letters. The default command for quit is CMD + Q. For me, the Alt + Q is not used for anything important (well it creates this nice character - œ ) Great module soma - very useful. Did you think of a way around the issue with it not working when the field is in focus? I’d really like to be able to edit a field and then Ctrl + S to save - at present there is no way to quickly get out of the field so the shortcuts will work, without using the mouse. Maybe if you could press escape to exit the field and then use the shortcut? Or could you bind the plugin to all input fields? I am guessing you might also have some issues with Tinymce which has its own keyboard shortcuts. Probably not a simple solution to this one. I like the search overlays, it’s like a quick launcher - pressing Escape to close the overlay dialog would be useful. If you are looking for inspiration for more shortcuts I always thought the Gmail ones were very good http://support.google.com/mail/bin/answer.py?hl=en&answer=6594 A way to navigate the tree would be great (although the “quick launcher” way is probably much better). Or a way to open next and previous items in the tree. And a help overlay mapped to ? which shows current shortcuts would be useful during the Shortcut learning phase (and for clients)
  9. @soma did you resolve this issue? I am getting the same error when trying to open up the thumbnail cropper on all my CropImage fields (I have about 6). Not sure when this happened - I am using the field in some repeater elements - however the error is affecting all CropImage fields even those not in a repeater element. The CropImage field is still working and creating all the thumbnails, it's just the crop edit window that is showing this error.
  10. Hi vanderbreye, I like the idea - I've always wanted the ability to use dropbox for site assets, as it would be a much smoother workflow especially when working with others (eg. use a shared folder and eliminate the need to use the web interface to update files). @diogo mentioned this interesting service a while ago which might be worth investigating https://www.filepicker.io/ not sure if it works both ways - I think it just gives you a simple interface to the files which would then be uploaded to your server
  11. Thanks for the feedback and extra information, good to hear.
  12. @DaveP - thanks for sharing. So you managed to use PW with 1.6 million pages (for each UK postcode)? Interesting to hear how far people have pushed the system. The most I have tried so far is 1,800 pages. I have an upcoming project that will need ~ 100,000 pages, so wondering if PW would be suitable. It's not really a public facing website, more a tool that will be used by a few people for analysing and aggregating data, like your nearby intranet tool.
  13. was just playing with this module last night (very useful thanks!) - to add the users IP, copy this line into the email body or email subject field IP: {REMOTE_ADDR} you can find a list of all the other PHP server variables which can be used here : http://php.net/manua...bles.server.php
  14. thanks Pete. always interested to hear about useful libraries that extend PW
  15. Thanks for sharing, Flourish looks useful and easy to use. I read in a previous post that you used the Flourish library to collect emails from an IMAP account and display them in PW. I'd be interested to hear some more potential uses of this library when combined with PW.
  16. Hi Roman, I have also found the "Default" language setting confusing as it can't be renamed or deleted. What I have done is used the "Default" as the main language and renamed the Title to English. Then added the second language as normal (eg. Name : de, Title : Deutsch). It means that when I need to detect the current language in my code I use a snippet like this : if($user->language->name == '' || $user->language->name == 'default') { // code for English } elseif($user->language->name == 'de') { // code for German } I am sure there is a more elegant solution, but this is what I managed to get working (still don't understand why user->language->name would equal blank, but it does when using the "language-gateway" technique described in the docs)
  17. whoops, how embarrassing - been reading version numbers wrong! PHP 5.2.17 > 5.2.4 so maybe it is a bug.
  18. I have also been having quite a few issues with the multi-language fields in the most recent versions of PW. I thought they might be related to the problems Apeisa is having, but just as I had finished writing down my issues, thinking it might be a bug, it's probably related to using an old version of PHP (version 5.2.17 and PW only supports > 5.2.4) - On 5.2.17 the language-alternate fields don't work (however the Multi-language fields work fine). So maybe check your PHP version is > 5.2.4? Well, here are the issues that I had : My first issues are probably more related to installing and testing the Repeater module - my conclusions are : don’t use the Repeater field with multi-language fields that are AutoJoined or if you have changed PageTitle field type to a TextLanguage. I could not sort the tree or save pages - lots of errors about columns in field list : “Unknown column 'data1008' in 'field list’” - eventually i managed to completely break my install after trying to add an additional language (front end and backend were not accessible and showing an Error Exception: Unknown column 'field_title.data1031' in 'field list’) So I tried again, and on my second install (2.2.0.1), I did not install the Repeater module. I also decided to use the “language alternative field” approach for Page titles to be safe. This is my setup : title (default PW field - PageTitle) title_de (for German titles - Text) body (for English and German body text - TextareaLanguage) On local host MAMP install it all works as expected (navigation titles and content change when switching languages) But when I transfer it to the server the language alternative fields stop working (in the navigation titles) BUT strangely the TextareaLanguage body fields do switch properly. So the content changes but the navigations titles don’t. MAMP is using PHP Version 5.3.6 Server is using PHP Version 5.2.17 And this was the point where I realised PW only supports PHP version 5.2.4 and above, so I can't really compain. Sadly, it's one of them horribly cheap shared hosting setups that clients seem to love, so no hope that they'll be upgrading php versions anytime soon. Why do clients spend so much designing and building a website, and then peanuts on hosting?
  19. I've found the Profile Exporter module a nice way to move sites between servers (like from local to web host). You create the export profile using the module, copy the files to the new server, then go through the PW install process again. It will check all the permissions and install into an empty database you define. No need to mess with any SQL import / export. https://github.com/ryancramerdesign/ProcessExportProfile
  20. Thanks Dave, looks very interesting and maybe not as difficult as I first thought. Cheers, Michael
  21. I missed this little Valentines day surprise yesterday Very excited - this is going to be very useful - Thanks Ryan!
  22. Thanks for the regexp tip. I am trying to keep a simple workflow for business users where all data preparation can be done in spreadsheets (excel / numbers / google docs) and then imported to Processwire. I'm a big fan of using spreadsheets as a middle ground or starting point for building applications especially where lots of data is involved. I've not tested yet, but will the import work with the new multilingual fields? In the past, spreadsheets have been a useful way to translate content with multiple people.
  23. Just discovered there is a simple way to do the d-m-Y dates (or any format) in Apple Numbers without switching your main format settings - you just need to create a custom date format - see attached screenshot : http://db.tt/SnvwLoA7
  24. I could not use the date format of d/m/Y that I wanted no mater how hard I tried. As an example of the strange results I was getting here is the code I used on the event page - the results are in the comments : echo $config->dateFormat; // Y-m-d H:i:s echo '<br />'; echo $page->event_start; // 21/01/2012 echo '<br />'; echo $page->event_end; // 15/04/2012 $date1 = strtotime($page->event_start); $date2 = strtotime($page->event_end); echo $date1; // empty echo '<br />'; echo $date2; // empty echo '<br />'; $diff = $date2 - $date1; $no_days = floor($diff / (60*60*24)) ; echo 'duration : ' .$no_days; // 0 This may have been a result of changing the date field formats too many times. I deleted all the fields and created them again with default US settings. I then changed all my dates in the CSV to US style m/d/Y re-imported and now it works as expected! I did not try the d-m-Y format yet (I could not find any country that uses this format in the OSX dates preferences) - it was easier to change to US date settings. On a side note, I always thought the US date format was odd - the logical way would be small > medium > large (day > month > year). Are they are the only country that starts with a month ? http://en.wikipedia....rmat_by_country Thanks, Michael
  25. After some further testing, I may have worked out part of the issue. Both the date fields were changed to use European style dates d/m/Y However despite changing this in the field settings (output and input tabs) it was still only accepting the US style m/d/Y - hence why it was importing only valid US style dates and skiping the rest. I have tried lots of variations for European style dates in the field settings and csv but it only accepts US style m/d/Y After changing the main wire config file $config->dateFormat = 'd-m-Y H:i:s'; it accepted the dates, but in my scripts it still seems to be calculating with the US style (I am adding / subtracting dates to work out time differences) - any date like 28/05/2012 is calculated wrong - this is still confusing me. I am using the latest PW 2.2 from Github download. Thanks, Michael
×
×
  • Create New...