Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by rick

  1. Hi @Zeka, Thanks for the help. I can check whether the page is present or not. The issue is imho one of consistency. Let me elaborate... Only the 'file' field types have this 'gotcha'. For example, in PHP the procedure is as follows: Create a form User completes the form and submits (including any uploaded files) Data is then sanitized, uploaded tmp files are moved, and data written to the database or The user cancels the operation Data and form are destroyed The PW way: Create and save some dummy page Create a form User completes the form and submits (including any upload files) Data is then saved and files are moved to that page asset or The user cancels the operation (No cancel function, so navigate away) Data and form are destroyed *Page is now orphaned* You get the notice that a page with that name already exists when attempting to create another page. Interesting is that page doesn't have a title field (which is required). Using any other field type, I can perform the following procedure within my process module: Create a form User completes the form and submits Page is saved with user data and user is redirected to previous page The steps are: 1) Create blank new Page. 2) Assign Parent. 3) Assign Template. 4) Build form from Page->getInputFields() or User cancels operation Data and form are discarded and user is redirected to previous page The problem is pre-defining a page just so an empty input field has a reference before any data is provided. This only occurs when there are 'file' fields present in the template.
  2. Howdy y'all, I have created a set of fields via the api, added them to a fieldgroup, then assigned that fieldgroup to a template. One field is FieldtypeImage. When I attempt to create a form using $page->getInputFields() the following error is displayed, New page '//' must be saved before files can be accessed from it This only happens when fields relating to files are present. All the other field types are created correctly on a form. How can I 'bypass' this 'must be saved' issue?
  3. Howdy @Stefanowitsch, Have a look at this topic. Maybe it will help.
  4. Hi @gebeer, Great point. I read those two articles back when they were published, but hadn't delved further because I haven't seen any forum posts regarding its use. I basically forgot about these two articles, so thank you for bring up the subject again. I may have a couple of cases where page class would be beneficial to my projects. That being said, I would be interested in seeing an example of your implementation of page classes as modules since I am more of a visual learner, if that is at all possible. I've stuck with using modules simply because what I believe is ease of installation. I can distribute a module without manually adding to, or changing a user's directory structure as it is implied in Ryan's article. I'm curious how page classes could be included in a process and/or module distribution and installation. I hope I made some sense as I am still a bit confused.
  5. That is an issue with your script. A form can only be 'submitted' by the user manually clicking the link, or by a script performing that action.
  6. I know what you are looking for. Unfortunately, there isn't any. However, there is another alternative search that might help. For example: site:processwire.com/talk your-query-here You can substitute "blog" for "talk" (talk == this forum) and get a listing of articles covering your specific query, which is the closest thing to the type of documentation you are accustomed to. I see by your post count you have been here a while, so you know how helpful all the members are when you have a question. That is one of the best things about ProcessWire; This community.
  7. You can use the query feature of Tracy (ProcessWire Info Panel) to search various categories, such as github... https://github.com/processwire/processwire/search?utf8=✓&q=PageTable
  8. Has anyone run into the actions set for MarkupAdminDataTable not being shown? // Example code: $table =$this->wire('modules')->get('MarkupAdminDataTable'); $table->setEncodeEntities(false); $table->setSortable(true); $table->action = array('Home' => './'); $table->headerRow(['Name', something']);// yes, i use two array syntaxes for testing $table->row( array( "Red Skelton", "some data" ) ); $table->render(); // End Example code // MarkupAdminDataTable.module // line 229: public function action(array $action) { foreach($action as $label => $url) { $this->actions[$label] = $url; } return $this; } // And line 317: if(count($this->actions)) { $out .= "\n<p>"; foreach($this->actions as $label => $url) { /** @var InputfieldButton $button */ $button = $this->modules->get("InputfieldButton"); $button->href = $url; $button->value = $label; $out .= $button->render(); } $out .= "\n</p>"; } return $out; The table is displayed correctly, minus the action. There is no dom reference in dev tools for the action -- as if it was ignored. Tracy (bd($table);) shows the action as defined. What am I overlooking?
  9. Kind of embarrassed to mention my setup as it is all old school style stuff. local and remote LAMP stack SSH + RSYNC for bidirectional comms No composer, etc. Live server is with Ethernet Servers Ltd. Great VPSs. Great support too And the only module installed is Tracy VSCodium (VSCode without M$ nose buttin' in) Front end is plain html/css/js.
  10. When you first got your pi, did you install LAMP successfully? Is it debian based? Did apache serve a test php file from the url (or IP) correctly? If you need help with that, the pi forums should provide advice and tips to get the pi running correctly. Once your pi is running correctly, install PW as normal, fixing only the issues the installer presents to you. If there is sufficient resources, everything should function as intended.
  11. Now that you have the conf file setup, you need to ensure your .htaccess file is correct. Remove the gibberish you entered when testing whether apache was reading the .htaccess file as @BillH recommended. Only enable the RewriteBase for your subdirectory as @Jan Romero mentioned.
  12. Your default apache config file (000-default.conf) should look similar to this... <VirtualHost *:80> #ServerName www.example.com ServerAdmin webmaster@localhost DocumentRoot /var/www <Directory /var/www/> Options -Indexes +FollowSymLinks -MultiViews AllowOverride All Require all granted </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> The file you posted is missing elements and has elements assigned incorrectly. The DocumentRoot value should be the location where PW was installed (/var/www/html/pwire). Note there is no slash at the end. Your file is missing the <Directory> element. This value should be the location where PW was installed -- Including the trailing slash. Read through this... apache docs
  13. Welcome to the forum. You can try grammarly.com Also, this is a processwire specific site. Were you looking for tools that you can use with processwire? Normally, the browser will provide that functionality for text and text area type fields.
  14. rick

    "Tag" naming

    As far as I know, Processwire has single-word tags only -- Unless someone else can jump in to explain how you can achieve multi-word tags. You do not need to restrict your tags to 'unique' items. Multiple items may have the same tag. As far as defining tags, that depends on your content. Education tag examples could be a subset of the course sub-category, eg, Category=Science, Subcategory="Astronomy", Tags="Telescopes","Planetary Nebula" (Notice the multiple word tag), and other astronomy related stuff. You can also define tags on the fly, rather than creating an initial listing. Hope this helps
  15. // after your loop if( array_key_exists( 'fieldname', $input->post ) ) { // add yes stuff to email } else { // add no stuff to email } or if( is_null( $form->getChildByName( 'fieldname' ) ) { // add no stuff to email } else { // add yes stuff to email }
  16. @neophronYou already know this, I'm just thinkin' out loud. There are three ways to present a segmented data entry interface: 1) A single form with all data fields displayed and editable at one time on the same page. Data is visually isolated usually by framing. 2) A single form with multiple sections (ie, viewable tabs or steps). For example, step 1 could be personal info (name, address, etc.), step 2 could be product customization, and step 3 could be payment information. Having data segmented like this implies a sequential entry method where the user must progress in order. 3) Separate forms for each section (obviously uniquely named) on the same page. Forms are again visually framed. This is random in that the user may complete none or more sections (forms) in any order. Personally, I don't care for this method. I only included it because it can be done (not that it should be done). You say the 'designer' wants the form displayed in the uikit switcher. This sounds to me like they want the second option as they believe the data to be segmented and sequential. I believe Ryan has (or is working on) the Pro Forms module which handles a sequential method rather than coding it yourself. I remember seeing that topic from Ryan but I do not remember the status. Maybe someone can educate me of that status. The first two presentation options are standard practice but depends entirely on the type of information you are trying to obtain and how you as the programmer want the user to perform. For example, an academic test application might be better suited for the sequential method. Since the user should be logged in prior to accessing the form(s) you already have the 'account' information to which the form data belongs. Saving the data from whichever presentation method is easily done to that account via ajax and/or a normal submit function. <Off Topic> I put designer in quotes above because it takes me back many years when I did instructional design work. It is not the designer's job to state how the interface should function. That is determined by you and the SME (subject matter expert). Now if that designer is also the SME, then you're good to go. Otherwise, you should provide the designer with the guidelines to create the necessary interface based off your needs analysis. </Off Topic> Anyway, I hope all this blabberin' helps you some way.
  17. Have you tried the actual path rather than docroot?
  18. No. If both sites are now functional, then your hosting doesn't need special treatment.
  19. As long as your virtual hosts file points each domain to the proper doc root, you should not have any issues moving domain2 over to the domain1 host and run it in a sub dir. I do this many times with clients. You may also need to update domain2 htaccess and config.
  20. Probably the easiest method would be having their clients each with their own page, and each report is it's own child page. One template for the client pages and one template for the pdf pages. You can add the necessary fields to the pdf template to facilitate searching. Personally, I shy away from building intelligence into a naming conventions. You might have your client person(s) doing the uploading select the client then select the pdf file, and enter any other necessary data associated with that report. If your client already has a data system from which the reports are generated at a specific interval, then you might tap into that workflow. You might also consider using the created user ids for access control. Your client has clients (customers). Each customer would be a user in the system. That customer user id is used for their page and subsequent report page. Now you can use the logged in user to determine which pages are accessible. Just some thoughts out loud.
  21. When pages are automatically sorted on a field, the move option is still enabled. Attempting to move one of those pages results in the following error: Your sort was not saved because these pages are automatically sorted by 'fieldname' PW .179 PHP 7.4 Personally, I think the move option should be removed when a field sort is defined, rather than just catching this exception.
  • Create New...