-
Posts
38 -
Joined
-
Last visited
Everything posted by dhruba
-
Thanks..... it works.
-
How count/find the no of page created by user I use selector but it didn't work. my code is.......... $pages->count("template=post, createdUser=$user"); OR $pages->find("template=post, createdUser=$user"); Thanks...
-
Thanks kongondo and ryan I will go through all this.
-
Hi I want to develop a new field type to store more complex but lightweight data as json. I could do that using text field but I m loosing the cool way (means object oriented way like $object->property1->property2->property3 ) to add and edit those fields. So I want a new field type to do that and it should support the admin also. How to write a module for that I need a help THANKS.
-
Quick Fix.................. I m able to solve by commenting on line 1275 in wire/core/page.php public function isPublic() { if($this->status >= Page::statusUnpublished) return false; $template = $this->getAccessTemplate(); //if(!$template->hasRole('guest')) return false; return true; } I think this error for admin templates like repeater_template_name that has no method like hasRole. I hope Ryan can fix this.
-
Thanks kongondo But I m not able to solve my problem so I manualy deleted from database. But when I creat new page with repeaters I got two entry in admin--->repeater--->repeter_item one is for mypagetitle and one is for for-page-0 (I don't know from where it comes) and when i delete the page the for-page-0 remains in admin--->repeater--->repeter_item .
-
Hi kongondo I thought this is an important topic those who are new in PW so i posted in different thread. Thanks
-
Hey when I try to delete repeaters I got n error Call to a member function hasRole() on a non-object My code is $items = $pages->find("template=repeater_items,include=all");// I tried wire('pages') also foreach($items as $item) $item->trash(); ?> Please Help.
-
Hey when I try to delete repeaters I got n error Call to a member function hasRole() on a non-object Please Help.
-
When I wnat to save or edit repeater field sometime it shows error Maximum function nesting level of '100' reached, aborting! Need Help
-
Sorry I got the answer.......... the query should................ $page->get('/item/')->children('title^='.$input->get->q);
-
Hi I have a autocomplete field for frontend users I want to search page by their title(by 1st letters) match word in autocomplete field for example I have page structure like........... items --aaa --aab --abb --baa --bba So I want to search aaa, aab and abb when user type a and aaa, aab when aa and when user type b it should return baa and bba . I thik we got the Idea. I use $page->get('/item/')->children('title%='.$input->get->q); but it returns all the pages need help. THANKS
-
Ok it Works thanks. I have Corrected the the Previous code for others who want to edit page with file field.
-
I tried but I got some error like Pagefile::deleteAll does not exist or is not callable in this context Or how can I enforce File field to have recent one when I try to re-upload the file to that field. My file field name is document and I try to edit page using id from different page. My code Is................... $message = ''; if($input->post->edit){ $upload_path = $config->paths->assets.'uploads'.$pages->get($input->get->id)->parent->path; $wu = new WireUpload('upload'); $wu->setMaxFiles(1); $wu->setOverwrite(true); $wu->setDestinationPath($upload_path); $wu->setValidExtensions(array('jpg', 'jpeg', 'gif', 'png', 'pdf', 'doc', 'docx', 'xls', 'xlsx')); $documents = $wu->execute(); if(!$wu->getErrors()){ $ep = $pages->get($input->get->id); $ep->of(false); $ep->document->deleteAll(); foreach($documents as $document) { $ep->document = $upload_path . $document; } $ep->setOutputFormatting(false); $ep->save(); $ep->setOutputFormatting(true); $message .= "<p class='message success'>Files uploaded!</p>"; } else { foreach($documents as $document) unlink($upload_path . $document); foreach($wu->getErrors() as $error) $message .= "<p class='error'>$error</p>"; } }
-
Hi How to delete file before edit the file field in page means How to edit FieldTypeFile using API.
-
What is the best way to edit a page using API. Why we need to call $page->setOutputFormatting(false) before saving the page. Need some clarification.
-
It works but I want It to use in my client page(not in admin). and it returns only children pages but I need all grandchildren pages. Items cetegory1 item1 item2 cetegory2 item3 item4 I need item1,item2,item3,item4 in my autocomplete list Thanks.
-
Hi Is there any easy method to use autocomplete input text field to select a page in client pages for FieldTypePage.
-
Thanks great fan of PW.
-
->first() This works but I don't Understand why. $orders = $page->children(); foreach($orders as $order){ $c = $order->customer; //$c = $order->customer->first(); works $order->customer why return pagearray I have only one page linkd $cp = $pages->get($c); echo $cp->title.'</br>'; }
-
This also doesn't work.................. $c = $order->customer; echo $c.', '.$c->title.', '.gettype($c->title).', '.gettype($c); output.............. 1024, , NULL, Object may be this is a bug;
-
Hi I got some strange problem need help. I have two template order and customer , order has customer FieldTypePage. When I want to retrieve the customer information ............... $orders = $pages->get('/orders/'); foreach($orders as $order){ $c = $order->customer; $cp = $pages->get($c); echo $c.'/'.$cp->title.'</br>'; } output................ 1042/Home 1043/Home but when I put $pages->get(1042); I got correct ans. Thanks............
-
Hi Not able to add image fields in FormTemplateProcessor................HELP Error: Exception: New page '/CMS/ProcessWire/embedded-c//' must be saved before files can be accessed from it (in Z:\web\CMS\ProcessWire\wire\core\PagefilesManager.php line 167)
-
Hi Not able to add image fields in FormTemplateProcessor................HELP Error: Exception: New page '/CMS/ProcessWire/embedded-c//' must be saved before files can be accessed from it (in Z:\web\CMS\ProcessWire\wire\core\PagefilesManager.php line 167)
-
Thanks I will try that. I am just exploring the power of PW. After that where should I post the module for others.