Nico Knoll Posted October 21, 2011 Posted October 21, 2011 Ehm, how can I change the user template - it's not in the templates list in "setup"?
apeisa Posted October 21, 2011 Posted October 21, 2011 There is filter options above template list. Choose system templates and you are good to go.
slkwrm Posted October 21, 2011 Posted October 21, 2011 There is filter option at the top of the list of templates. Expand it and change "Show system templates?" to "yes".
apeisa Posted December 20, 2011 Posted December 20, 2011 I will need to import bunch of news items soon, and planning to use this for the job. Any clues how to get date field working Ryan? It would be pretty trivial to write custom import script also, but I have looking for opportunity to test this module.
ryan Posted December 20, 2011 Author Posted December 20, 2011 I think this will depend somewhat on what format those dates will be in from your spreadsheet (CSV). If it's a unix timestamp, or any format consistent with what PHP's strtotime() will accept (which includes quite a lot of formats), then you should be able to import dates pretty easily. I think all you'd need to do is add FieldtypeDate to the list of allowed fieldtypes at the top of the modules: <?php protected $fieldtypes = array( 'FieldtypePageTitle', 'FieldtypeText', 'FieldtypeTextarea', 'FieldtypeInteger', 'FieldtypeFloat', 'FieldtypeEmail', 'FieldtypeURL', 'FieldtypeCheckbox', 'FieldtypeFile', 'FieldtypeDate' // add this line ); I don't have a good example to test from at the moment though will try to test it tomorrow. But let me know if you get a chance to test, and if that works I'll go ahead and add it to the module permanently. Looking at it now, I'm not sure why I didn't add it before. But it's the end of the day here so my mind is tired and I may be missing something.
apeisa Posted December 21, 2011 Posted December 21, 2011 Thanks Ryan. I don't have csv yet, but I am telling the client in which format the date's should be. I will test this at beginning of January, but it seems like it should be work or with very trivial work.
apeisa Posted December 21, 2011 Posted December 21, 2011 I went ahead and tested this. I didn't modify anything and it imported dates just fine. This was my test CSV (I just pasted it): "title","body","date","images" "Uusi uutinen","Tämä on leipäteksti, jossa on "lainaus".","12-06-2011 12:45:11","http://www.avoine.fi/@Bin/213898/ulkona1.jpeg" Only strange this was that body text was in this format in tinyMCE field: Tämä on leipäteksti, jossa on lainaus"." Not sure if they should be escaped in csv?
apeisa Posted December 21, 2011 Posted December 21, 2011 Forget to say: absolutely brilliant module Ryan. Very friendly UI and it was breeze to use!
ryan Posted December 21, 2011 Author Posted December 21, 2011 Thanks Antti, glad that it's working alright and that the dates imported how they should. That's interesting that your CSV file had unescaped quotes in it. That will confuse any CSV parser. What did you use to export the CSV? Nico's right that quotes should be escaped with a backslash.
apeisa Posted December 21, 2011 Posted December 21, 2011 I didn't export that CSV from anywhere - I just wrote that myself as test case. I wasn't sure should the content be escaped so tested it without escaping - I was little bit surprised with the result (it worked, sorta)
Nico Knoll Posted December 21, 2011 Posted December 21, 2011 If you would export a .csv from your database it should escapes '"'s automatically
raydale Posted February 1, 2012 Posted February 1, 2012 I'm having problems using this module in PW 2.2. I have installed the module and then under 'Setup' and 'Import Pages From CSV' - I get the following message: "This page has no Process assigned."
diogo Posted February 1, 2012 Posted February 1, 2012 @raydale I didn't use the module yet, but i would say that you have to look for that page in the tree, and edit it to assign to it the module process. 1
raydale Posted February 1, 2012 Posted February 1, 2012 Thanks for the nudge in the right direction diogo - that's me being a complete noob with PW. In case anyone else comes across this: under 'Admin' -> 'Setup' -> 'Import Pages From CSV' choose to edit the page and under 'Process' in the 'Content' tab select 'importPagesCSV' from the drop down.
apeisa Posted February 1, 2012 Posted February 1, 2012 I think that process should be right after install, so there have been something strange in your situation raydale.
diogo Posted February 1, 2012 Posted February 1, 2012 I assumed it would work by doing this. But it should be working by default...
raydale Posted February 1, 2012 Posted February 1, 2012 I think that process should be right after install, so there have been something strange in your situation raydale. Ah, so I'm not being quite such a noob In my case I wasn't taken through any extra steps and just left at the standard module overview screen (the one with 'Module Information').
ryan Posted February 1, 2012 Author Posted February 1, 2012 I'm having problems using this module in PW 2.2. I have installed the module and then under 'Setup' and 'Import Pages From CSV' - I get the following message: "This page has no Process assigned." Testing here in 2.2, but I can't duplicate. Can you think of any other factors involved? Has your site been through a profile export/import (like 2.0-2.1 upgrade)? Have any admin-related pages been renamed? Let me know if you can think of anything else that might be different from a stock installation. Tahnks, Ryan
raydale Posted February 1, 2012 Posted February 1, 2012 Hi Ryan, The only thing I can think of is that I have renamed the admin pages url from 'processwire' to 'admin'. I will probably be doing a bit of work on this over the next few days with different localhost installations - so I'll see if I can reproduce it then.
ryan Posted February 2, 2012 Author Posted February 2, 2012 It shouldn't matter if you've renamed the admin page, but thanks for mentioning it. Those are the kind of things that are good to know. Let me know if you find that you can reproduce it. Thanks, Ryan
Michael Murphy Posted February 11, 2012 Posted February 11, 2012 I am trying to import some events which have two date fields - a start and end date. I enabled the FieldtypeDate in the module as suggested by Ryan : protected $fieldtypes = array( 'FieldtypePageTitle', 'FieldtypeText', 'FieldtypeTextarea', 'FieldtypeInteger', 'FieldtypeFloat', 'FieldtypeEmail', 'FieldtypeURL', 'FieldtypeCheckbox', 'FieldtypeFile', 'FieldtypeDate' // add this line ); However there seems to be some odd results after importing. Some event pages have imported both start and end date. others have only a start or end date. and then some have no dates at all. I have tried various times and made sure that the dates are in the correct format (d/m/Y) but no luck. Here is the CSV file I was using http://db.tt/h0fGuBHU Was there any progress with the page field type import?
Michael Murphy Posted February 12, 2012 Posted February 12, 2012 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
Nico Knoll Posted February 12, 2012 Posted February 12, 2012 Maybe you should first rebuild a timestamp with "strtotime()". Then you can use it in every format you want/need.
ryan Posted February 13, 2012 Author Posted February 13, 2012 Michael, have you tried changing your dates in the CSV to the d-m-Y format? I believe it should import then. The FieldtypeDatetime module sanitizes any string input with PHP's strtotime() function. That function accepts d-m-Y format if you use dashes in the input (rather than slashes).
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now