Jump to content

dhruba

Members
  • Content Count

    38
  • Joined

  • Last visited

Community Reputation

3 Neutral

About dhruba

  • Rank
    Jr. Member

Recent Profile Visitors

2,102 profile views
  1. 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...
  2. Thanks kongondo and ryan I will go through all this.
  3. 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.
  4. 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.
  5. 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 .
  6. Hi kongondo I thought this is an important topic those who are new in PW so i posted in different thread. Thanks
  7. 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.
  8. Hey when I try to delete repeaters I got n error Call to a member function hasRole() on a non-object Please Help.
  9. When I wnat to save or edit repeater field sometime it shows error Maximum function nesting level of '100' reached, aborting! Need Help
  10. Sorry I got the answer.......... the query should................ $page->get('/item/')->children('title^='.$input->get->q);
  11. 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
  12. Ok it Works thanks. I have Corrected the the Previous code for others who want to edit page with file field.
  13. 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>"; } }
  14. Hi How to delete file before edit the file field in page means How to edit FieldTypeFile using API.
×
×
  • Create New...