Jump to content

sam13579

Members
  • Posts

    26
  • Joined

  • Last visited

Everything posted by sam13579

  1. You can create a template from your HTML and then use it.
  2. Go to this link: https://processwire.com/docs/modules/development/#using-an-autoload-module-to-add-new-methods-to-existing-classes This summarize() function is not working. And could you please explain this portion of code? $this->addHook('Page::summarize', $this, 'summarize'); This is also not working. I tried from the tutorial! Am I missing something?
  3. I wanted to add FontFamily option in CKeditor. But I couldn't add it or make it work. How do I do this?
  4. I want to create a form field with which I can upload the image/file. But it is not working. Is there anyone to guide? $saved=""; echo $_FILES['pp']['name']; if ($_SERVER['REQUEST_METHOD'] == "POST") { $upload_path = $config->paths->assets . "files/.tmp_uploads/"; print_r($tempdir); $doc = new WireUpload('pp'); $doc->setMaxFiles(1); $doc->setOverwrite(true); $doc->setDestinationPath($upload_path); $doc->setValidExtensions(array('jpg', 'jpeg', 'png', 'pdf')); $files = $doc->execute(); print_r($files); $uploadpage = new Page(); $uploadpage->template = "progr"; $uploadpage->parent = $pages->get("/add-progr/"); // add title/name and make it unique with time and uniqid $uploadpage->title = "Some Text"; $uploadpage->save(); foreach($files as $file){ $uploadpage->programme_photo=$uploadPath.$file; print_r($file); }; $uploadpage->save(); $saved="Saved";
  5. Thank you for your reply. But I need a dropdown in a page(template) where I can select other pages. You gave me a solution for menu building. I am sorry it won't work in my case.
  6. I wanted to find a way to make list of selections of pages on another page? A drop down field where the page names are enlisted with id. Is there any module like that?
  7. I want to get a list of pages that is particularly editable by users that has permission. I am using the per page edit module but I can't get the list with it.
  8. I am a noob at this framework. While looking for dynamic options I found many modules have options/settings in the module. While I wanted to develop a module I found that I lack the knowledge of adding options in a module setting page. How to add options (radio buttons,selectors) in my processwire module?
  9. Is there a documentations for all these things?
  10. @ryan it would be really helpful if you could help me with it. Thanks is advance.
  11. This is the code $thanks = ""; $tempDir = $config->paths->assets . "files/applications/"; if ($input->post('title')) { print_r($input->get('doc')); $p = new Page(); $p->template = 'Application'; //or whatever your template is called $p->parent = wire('pages')->get('/applications/'); //or whatever the parent page is called $p->application_title = $input->post->text('title'); $p->application_first_name = $input->post->text('fname'); $p->application_middle_name = $input->post->text('mname'); $p->application_last_name = $input->post->text('lname'); $p->application_position = $input->post->text('position'); echo "<script>window.alert('".$input->post('doc')."');</script>"; $p->application_email = $input->post->email('email'); $p->application_reference_no = $input->post->text('ref_no'); $p->application_telephone_no= $input->post->text('tel_no'); $p->application_date= $input->post->text('date'); $p->save(); $files = explode("|",$input->get('doc')->value); foreach($files as $file){ if($file && file_exists($tempDir . $file)){ $p->application_document->add($tempDir . $file); print_r($p); } } $p->save(); } ?> And the html part is : <form action='' method='post' enctype="multipart/form-data"> <div class=''> <label for='title'>Title</label> <select name='title' id='title'> <option value='Mr.'>Mr.</option> <option value='Ms.'>Ms.</option> </select> </div> <div class=''> <label for='fname'>First Name</label> <input id='fname' type='text' name='fname' /> </div> <div class=''> <label for='mname'>Middle Name</label> <input id='mname' type='text' name='mname' /> </div> <div class=''> <label for='lname'>Last Name</label> <input id='lname' type='text' name='lname' /> </div> <div class=''> <label for='position'>Position</label> <input id='position' type='text' name='position' /> </div> <div class=''> <label for='ref_no'>Reference No.</label> <input id='ref_no' type='text' name='ref_no' /> </div> <div class=''> <label for='email'>E-mail</label> <input id='email' type='email' name='email' /> </div> <div class=''> <label for='tel_no'>Telephone No.</label> <input id='tel_no' type='text' name='tel_no' /> </div> <div class=''> <label for='document'>Document(PDF)</label> <input id='document' type='file' name='doc' /> </div> <div class=''> <label for='date'>Date</label> <input id='date' type='date' name='date' /> </div> <button type='submit' class="btn btn-bronze-outline rounded-pill">Apply Now</button> </form> Evrything is stored except for the file. What might be wrong here?
  12. How did you setup the CKeditor for Image?
  13. I was looking for a way to make template with fields programatically. But I think this is not happening. What you are suggesting is adding fields that are already made inside database. But thanks.
  14. And how to create "yourfield" with program?
  15. Is there a way to do it by code?
  16. I was looking for code sample where I can attach a textarea for setting up a content in my page. And I wanted to do it programatically. But I can't find a way to do that. Is it possible to add a content textarea with program?
  17. Sorry for posting it again. I posted the same thing it in another forum. There I found some basic tutorial from a person. That was helpful, but still I need some direct answers. I need to understand how I can, 1. Submit a form ? 2. Then load it into a table from database. Can anyone there simply teach me this?
  18. This means I have to save form data as a page?
  19. Like most of the people I started with WordPress. But for some reason WordPress was too hard for me. Then I found Processwire and it seems very easy for me. But still I have some problems with many small things. I think programming is mostly about input, output and how do we process things. But I am facing many holes now and then in the tutorials. I am going to give some specification: 1. I found a tut where form submission was demonstrated . There I found that there is a special way to get the form input. It was with processInput() method. But that method is not working correctly. 2. I found no specification about how I save a form data into database . 3. I have to use $this->modules->get() , $modules->get() I think I will face many more problems later. What is wrong with me? Am I too beginner for this? Or am I missing something?
  20. Could you please give me some more insights about basic form submission?
  21. I want to create this same thing where I can add attributes to the program like the program I gave. I want to do this for frontend text input field.
  22. This thing might sound weird , but I would like to make a similar class that can make HTML element like this: $inputfield = $modules->get('InputfieldText'); $inputfield->label = 'Your Name'; $inputfield->attr('name', 'your_name'); $inputfield->attr('value', 'Roderigo'); // Add to a $form (InputfieldForm or InputfieldWrapper) $form->add($inputfield); How can I make a class so that I can make simple text input fields with the code. I am not very good at OOP. It would be a great thing to learn.
  23. This is the exact thing that I was wanting. Thanks for the share. ?
×
×
  • Create New...