Jump to content

SIERRA

Members
  • Posts

    86
  • Joined

  • Last visited

Everything posted by SIERRA

  1. @BitPoet This is working. @BitPoet and @Zeka Thanks for your help
  2. Thanks for your reply if we give $title="School Resumes"; $eventspage = $pages->get(1085); //eventspage $findeventspage=$eventspage->events->find("title={$title}"); echo $findeventspage; this displays id if we give $title="School Resumes"; $eventspage = $pages->get(1085); //eventspage $findeventspage=$eventspage->events->find('title={$title}'); echo $findeventspage; this does not displays id if we give $title="谢师宴 11am-1pm, Test服务奖 service award"; $eventspage = $pages->get(1085); //eventspage $findeventspage=$eventspage->events->find('title={$title}'); echo $findeventspage; this also does not displays id. Actually we need to check the duplicates if availabe. Could you please suggest. Thanks
  3. Hi If we use chinese text in processwire find method like the below the error appears as 'Fatal error: Exception: Unknown Selector operator: ''' $title="谢师宴 11am-1pm, Test服务奖 service award"; $eventspage = $pages->get(1085); //eventspage $findeventspage=$eventspage->events->find("title={$title}"); Could you please suggest on this. Thanks
  4. I am getting warning as below after login as admin  Please suggest can I include ‘en_US.UTF-8’ against English -> /wire/modules/LanguageSupport/LanguageSupport.module as in below screen shot. But against ‘Chinese’ the same corresponding file does not exists. Thanks
  5. $subscriptions=$subscriptionpage->subscriptions->find("email={email@mysite.com}"); should be $subscription=$subscriptionpage->subscriptions->find("email={email@mysite.com}"); Even then this is not working
  6. Hi I am not able to delete a repeater item This code works $subscriptionpage = $pages->get(1442); $subscription = $subscriptionpage->subscriptions->first(); // or whatever item you want to remove echo $subscription; $subscriptionpage->subscriptions->remove($subscription); $subscriptionpage->of(false); $subscriptionpage->save(); But this code does not works. $subscriptionpage = $pages->get(1442); $subscriptions=$subscriptionpage->subscriptions->find("email={email@mysite.com}"); echo $subscription; $subscriptionpage->subscriptions->remove($subscription); $subscriptionpage->of(false); $subscriptionpage->save(); I checked the value of $subscriptions. Both has the same value. Could you please suggest. Thanks
  7. I need to get json out put to configure calendar events. I am using fullcalendar ( https://fullcalendar.io/ ). To configure event url I am using a PHP page. If I configure a url like http://wwww.mysite.com/news-events/events/ this is not working. So I created a PHP page in root and accessing the same using http://www.mysite.com/fetch-event.php. The code is as below .......... var calendar = $('#calendar').fullCalendar({ editable: false, events: "http://mysite.com/php/fetch-event.php", displayEventTime: false, ............ While using the PHP page 'fetch-event.php' in root directory 'Text (Multilanguage)' filed is not working correctly. The PHP code is as below. $events_pages = $pages->get(1085); $events_array = array(); $events_pages = $pages->get(1085); foreach ($events_pages->events as $event) { $events_detail = array(); $event_start_tmp = strtotime($event->event_start); $event_start = date('Y-m-d',$event_start_tmp); $events_detail["id"]=$event->id; $events_detail["title"]=$event->title; //This is text - Multilanguage field $events_detail["start"]=gmdate("Y-m-d",$event->event_start); $events_detail["end"]=gmdate("Y-m-d",$event->event_start); array_push($events_array, $events_detail); } print_r($events_array); Out put is Array ( [0] => Array ( [id] => 1411 [title] => ProcessWire\LanguagesPageFieldValue Object ( [default] => School Resumes [chinese] => ) [start] => 2018-01-06 [end] => 2018-01-06 ) But I want the out as Array ( [0] => Array ( [id] => 1411 [title] => School Resumes [start] => 2018-01-06 [end] => 2018-01-06 ) Please suggest how can I do this Thanks
  8. I have changed the field type as option and included the needed values. So I can able to populate as below. Now this is working as expected. Thanks <?php $get_field = $fields->get('teacher_name'); $field_options = $get_field->type->getOptions($get_field); foreach($field_options as $option) { echo $option->id; } ?>
  9. I have a repeater field called 'class_offerings'. In this I am having the fields class_offering_title, teacher_name and term I would like to populate a drop down with non empty unique values available in teacher_name. I' m using below code. But this is displaying with duplicates. Could you please suggest on this. Thanks <?php $list_teacher=$page->class_offerings->find("teacher_name!='', sort=teacher_name"); $list_teacher_unique=$list_teacher->unique(); foreach($list_teacher_unique as $class_teachername) {?> <option value="<?php echo $class_teachername->teacher_name;?>"><?php echo $class_teachername->teacher_name->title;?></option> <?php }?>
  10. Thanks. To get the text of the option field I am using below code $title_txt = $fieldtypes->get('FieldtypeOptions')->getOptions("item_category")->get('id=1')->title; I have also included Chinese version also as below. But while accessing the chinese url this is not showing chinese text. Is there any thing I need to do additionally
  11. I created a checkbox field as below. How to display the list of check boxes in a form in front end for the user to choose from. Thanks
  12. I am getting warning as below after login as admin Please suggest can I include ‘en_US.UTF-8’ against English -> /wire/modules/LanguageSupport/LanguageSupport.module as in below screen shot. But against ‘Chinese’ the same corresponding file does not exists. Thanks
  13. Thanks, 'Restrict Tab View' module is working fine Is there a possibility to list only the pages which have edit access. Currently this is listing the pages which have both edit and view access alone.
  14. I would like to give edit privileges to client for editing content in my processwire site. They should have privileges to edit only the content. Thanks I created a role as ‘editor’ and assigned ‘edit pages’ and ‘view pages’ privileges to corresponding templates Once logged in as ‘editor’ this is displaying all pages with both ‘edit’ and ‘view’ privileges. Is it possible to list only pages ‘edit’ privileges after login Is it possible to disable ‘Settings’ from those editable pages
  15. So not at the same time. The user has to decide/switch to its favourite language. -- Yes To get this done please read the article I linked above. You may although want to create a new ProcessWire instance with the Multi-Language Profile. In that profile you will find almost everything you want and need. -- Ok, will check on this. Thanks
  16. So you want the homepage to be displayed in both languages at the same time? - Yes I would like to have all pages of the website (the front end of the website alone not admin panel) in both 'English' and 'Chinese' with a language switcher provision.
  17. Hi, Thanks for your reply The field that you referred inside 'Setting' was empty. Then I updated with the value 'cn' as referred in attached screen shot. Now in view->New window/Tab->Chinese this is displaying the Chinese version that I created. And in view->New window/Tab-> English this is displaying the English version. Actually I would like to have the front of the site alone in both 'English' and 'Chinese' version. I have attached the steps what I am doing in my first post (pw-reference-09052018.docx). Could you please confirm what I am doing is the correct way. Thanks ref-24042018.docx
  18. Sorry. By mistake this happened. Actually I thought to post this in 'Multiti language Support forum'.
  19. I want to display the web site in English and Chinese. I have the ‘English’ version of the site. After following attached steps the both versions are displayed in English only. Could you please suggest on this. Thanks. pw-reference-09052018.docx
  20. Hi Thanks, below code is working fine. The issue is due to incorrect name foreach ($bookeddetails as $bookeddetail) { $bookeddetail->bookings_done=10; $bookeddetail->of(false); $bookeddetail->setAndSave('bookings_done');}
  21. Hi I also tried to remove an repeater item. This is also not working. Please suggest is there any permission issue. If I run the below code Id value is getting displayed but not able to delete $page = $pages->get(1128); $datetofind=strtotime("2018-05-11"); $timefromfind="10:00 pm"; $bookeddetails = $page->booked_days->find("date_value={$datetofind}, time_from={$timefromfind} "); echo "Id ".$bookeddetails."<br/>"; $page->booked_days->remove($bookeddetails); $page->save(); Thanks
  22. Thanks I tried but this shows error as 'Error: Call to a member function of() on null ' Now the code is foreach ($bookeddetails as $bookeddetail) { $bookeddetail->bookings_done=10; $bookdetail->of(false); $bookdetail->setAndSave('bookings_done'); }
×
×
  • Create New...