Jump to content

manlio

Members
  • Posts

    148
  • Joined

  • Last visited

Everything posted by manlio

  1. Thank you Felix for your helpful suggestions, and sorry for delay in my reply. I was thinking about page tree just for convenience and readability, but in the end with lister pro I have no problem retrieving data and using your approach I think have lot more flexibility (by the way, some parts of the project are already running in this way). I also would like to ask which is the better strategy to maintain the progressive numbering of card's requests. So every cards should contain a text field in which I store the request number. I want to have the flexibility that if something is wrong with second card request of an instructor, I can delete the second request and when the instructor recompile it the number will be again 2 and not 3. I found this in another thread, is the right thing to do? $val = $pages->find("template=mytempl, sort=-counter, limit=1")->first->counter + 1; Thank you
  2. Hi I'm looking for advices to choose the most flexible and rational approach to manage a specific task in my project. I have several users (instructors) that can request certification cards for their students and I would like to store all the requests made by every instructor. Usually at the end of a course the instructor can insert one certification card for every student (I have developed an ajax front end for this) and I store every card in a page. I'm thinking to structure every request like this (the parent is the certification number request of the instructor) username1 >1 >>card1 >>card2 >>card3 >2 >>card1 >>card2 username2 >1 >>card1 >2 >>card1 >>card2 >>card3 ecc... As an additional note I have italian instructors and international ones and I was thinking to create two different parents "Italian" and "International" that contain all the usernames My first idea is to store temporarly the cards pages under another page (for example "temp"), and as soon as the request is completed create the request number page (1, 2, 3, ecc...) and change the parent of the certification cards. I don't know if this is a good approach or if you have a better one. Thank you for any advice you can give me. Ciao Italian
  3. Thank to everybody for your support! At the end Nico suggestion's worked like a charm and luckily I have no security limitations on the server. I report here the code I finally use and I hope this could be useful to someone else // fetch the json displayed on the service page $dataJson = file_get_contents('http://www.serviceurl.com/service-pages/?parent=1145'); // transform it into a php array $items = json_decode($dataJson, true); foreach ($items['matches'] as $item) { // start the looping. "matches" is the name of the results array generated by the webservice echo $item['title']; echo $item['body']; echo 'http://www.myurl.com/site/assets/files/' . $item['id'].'/'.$item['myimage']['basename']; // url image } If you need to pass an image, the last line rebuild the url and Insted of www.myurl.com and [myimage] field you have to write your own and than you can use in an img tag.
  4. Hi, I would like to use data from a PW website (a list of books with cover) on another PW website (on different server and domains) just for convenience because these data are identical but are presented differently. I have installed the Pages Web Service module and it generates correct output. Now, sorry for my ignorance, but I would like to know how I can read the generated Json. Is there something built in processwire? I should search something in PHP? Probably I searched wrong terms but I wasn't able to find anything useful to me. Thank you!
  5. Sorry Katherine for mispelling your name (btw my name is Manlio ). I will investigate more on some of these softwares and report here my opinion on that. Ciao
  6. Thanks Kathy for starting this thread. I'm really interested in new way to speed up the workflow in an intuitive way. I didn't knew "Blocs" but I have tested in the past Pinegrow that seems more mature today. I'm more design oriented and I find frameworks and these tools to be invaluable.
  7. Solved! I just went into the mysql database "pages" table and changed the "status" to 1. After that everything works again and the delete tab shows and works as expected.
  8. Probably I have some corrupted pages (two or three) inside a "parent" that seems to work properly. I tried to remove these pages from my PW installation with no luck. If I edit one of this pages I don't have the "delete" tab. I was able to move the entire hierarchy in the trash but still when I empty the trashcan it returns errors as you can see in the second image below. Anyone have some suggestion how to fix the problem? Are there any recommended steps to follow when you encounter problems like this? Thank you
  9. Thank you Soma, you were really helpful. This is for sure the best way, thank for your help, I try to use this approach instead.
  10. I tried also with something like this but still doesn't work <form role="form" action="<?php if ($user->language == '1061') {echo '../contatti/contatti-invio/';} else {echo '../en/contacts/contacts-done/';} ?>" method="post" >
  11. English url http://mywebsite.com/en/contacts/contacts-done/ Italian that is working http://mywebsite.com/en/contatti/contatti-invio/ Thank you
  12. Thanks Soma, you are right, my bad... I have corrected in <form role="form" action="../contatti/contatti-invio/" method="post" > but still doesn't work when I change to english language.
  13. Thank you Wanze, my link in the form is like this and to me seems right <form role="form" action="../<?php $config->urls->root;?>contatti/contatti-invio/" method="post" > For me it is strange that the form works perfectly in italian, and when I switch to english and submit it doesn't work. When I send form from English the mail that arrives misses all the post fields and the saem hapen in the confirmation page after the form submission. If this is a normal behaviour maybe I could change the form address using php based on the language selected. Just guessing.
  14. Hi, in a multilanguage site (italian - english), I have a contact form that on submit send post variables to another PW page. Everything works for the italian part, but when I switch to english (that it is not the default language) , when I submit the form the post variables are empty. Seems that PW operates a redirect and lose the variables. How can avoid this? Thank you.
  15. Adrian you don't have to be sorry! Instead thanks for you effort that I know is great and thanks for support. I send you a message with the zip file. Ciao
  16. Hi, I'm trying to import pages with images from a website to another (PW 2.5.3 both) using migrator module, but I get errors and it doesn't work for me. The errors appear during import. I set the home as parent and then I click "upload and create content" button and the result are shown in this images. If instead I check "Edit Imported content", after I click "Upload and create content" button, everything seems to work but in the end of the page I have this error And after when I click "Create Content" I have this one This the first time I use migrator. Thank you for any help.
  17. I only need a single tree of pages. Anyway now I post in migrator specific thred. Yes is the last version of Migrator, I downloaded yesterday from github. Thank you.
  18. Ok, thank you. in the meanwhile do you know any other way to copy the tree? Is it possible to safely copy directly mysql tables for example? Thank you
  19. It import only the parent and not the children pages. This tree is based on page table field but I read that it is supported.
  20. Thank you for replying. The errors appear during import. I set the home as parent and then I click "upload and create content" button and the result are shown in this images. If instead I check "Edit Imported content", after I click "Upload and create content" button, everything seems to work but in the end of the page I have this error And after when I click "Create Content" I have this one This the first time I use migrator. Ciao
  21. Hi, I'm trying to import pages with images from a website to another (PW 2.5.3 both) using migrator module, but I get errors and it doesn't work for me. Which are the most reliable alternative ways to achieve this? Thank you.
  22. In the meanwhile I wrote a simple function that I put in an myfunctions.inc file that I can include whenever I need. Then I can call the correct date in this way <?=rightdate($page,"datainizio");?> //** rightdate is the name of the function that you can find below Here the function: function rightdate($rightselector,$mydate) { $user = wire('user'); $page = wire('page'); if ($user->language == "1061") //** here you have to insert the id of your language {setlocale(LC_ALL, array('it_IT.UTF-8','it_IT@euro','it_IT','italian')); //** you can to whatever language you need return strftime('%d %B %Y', $rightselector->getUnformatted($mydate)); } else {return $rightselector->$mydate;}} I'm a newbie and for sure this is not an excellent method but maybe this could help someone else that is learning like me .
  23. Hi, I have some questions about month date in different languages. I have a multilanguage website with only two languages running on PW 2.5.3 and I would like to know if it is possibile to translate month names in frontend directly in translation files. Now I'm using something like: if ($user->language == "1061") { //***CHECK IF THE USER LANGUAGE IS ITALIAN setlocale(LC_ALL, array('it_IT.UTF-8','it_IT@euro','it_IT','italian')); echo strftime('%d %B %Y', $page->getUnformatted('mydate'));} else {echo $page->mydate;} //*** PASTE "STANDARD" DATE Is this a good approach or there is an easier one? Which is the Windows 8 alternative for command "local -a" on Unix system? I wanna know exactly how my server calls my language. Thank you.
  24. Sorry but was only a problem related to the "active" checkbox of the language. Usually is active by default but after importing from csv was not.
  25. I'm developing my first multilanguage website (italian and english). Till this time everything is good, but I have only a problem. I need to have "italian" courses and "international" courses that are totally different in content (so I don't need translation of the same page, but different records). I wanna show italian courses on italian website and international courses on english website. I tried using standard (not multilanguage) fields and try to retrieve them in this way if ($user->language == "1061") //check if set default language {$items = $pages->find("parent=/courses/italiano/,limit=4");} //query for italian courses else {$items = $pages->find("parent=courses/international/,limit=4");};//query for international courses but this doesn't work, and no data show when I switch to english language. Can you give some insights how to solve this problem and point me in the right direction? Thank you!
×
×
  • Create New...