Jump to content

tpr

Members
  • Posts

    2,321
  • Joined

  • Last visited

  • Days Won

    44

Everything posted by tpr

  1. How is it not working? Do you have an error? Try setting debug to true in config.php. For input variables this is the PW way: https://processwire.com/api/variables/input/
  2. Probably the server, redirects urls without trailing slash to url+"/".
  3. Then you surely had a redirect beforehands (from "download-confirmation" to "download-confirmation/"). That's why I suggested to check the Network tab for any redirects - post variables are lost if there's any.
  4. This could come in handy, thanks. My only concern is the client's behaviour - they are rarely able to perform such a "complex" operation. For me as a dev perhaps it is easier to copy-paste and edit the source.
  5. No, in the file you have the "input" tags.
  6. Do you have a "form" tag around this snippet? (I guess so, just to make sure) Check whether you have a redirect before you try to access these post values (Inspector -> Network tab).
  7. typo? "select_you_case_studies" vs "select_your_case_studies"
  8. Another option could be Ajax-loading those pdf links. You could pass the selected pdf IDs in a url parameter. Of course this requires some frontend (js) work.
  9. Actually there are some useful tips on the checklist that are valid for many CMSes too (and also for WordPress ). Bashing WP is something people devs would normally do in a Pub - but wait, aren't we there?
  10. I'm using Nette Forms standalone for forms, it is very powerful but easy to setup: http://doc.nette.org/en/2.3/forms#toc-nette-forms-standalone Cool thing is that with Live Form Validation javascript it provides JS validation too: https://gist.github.com/Robyer/7948399 It is also capable to handle conditional fields, so for example show an input field only if you select an item in another select box, etc. And all this stuff works with live js validation, so you have to set rules once and both backend and frontend validation are done. 99% of the time the default form renderer is enough, but you can fine-control your forms if you need to: http://doc.nette.org/en/2.3/forms#toc-defaultformrenderer http://doc.nette.org/en/2.3/forms#toc-manual-rendering You can use Bootstrap style too: http://doc.nette.org/en/2.3/forms#toc-bootstrap-support For example, I use it with UIkit: <?php // load Nette Forms require_once(__DIR__ . '/../../../vendor/autoload.php'); // make a new Form instance $form = new Nette\Forms\Form; // optional tweaks $form->setAction($page->url); //$form->setMethod('GET'); // set "novalidate" and classes $form->getElementPrototype()->novalidate = 'novalidate'; $form->getElementPrototype()->setClass('uk-form uk-form-horizontal'); // set how form is rendered $renderer = $form->getRenderer(); $renderer->wrappers['controls']['container'] = 'div'; $renderer->wrappers['pair']['container'] = 'div class="uk-form-row"'; $renderer->wrappers['label']['container'] = 'div class="uk-form-label"'; $renderer->wrappers['control']['container'] = 'div class="uk-form-controls"'; // add fields $form->addText('name', 'Name:', 30) // ->setAttribute('autofocus') ->setRequired("Required field") ->addRule($form::MIN_LENGTH, "Please add at least %d characters", 3); // display form echo $form; ?> Processing form is another issue, you can start like this: if ($form->isSuccess()) { // get submitted values (true: array format, false: object) $values = $form->getValues(true); $sender_name = $values['name']; $sender_email = $values['email']; // ... // redirect // $session->redirect($success_page); // exit; }
  11. I like the "increase memory limit" part the best Btw here's an Advanced WordPress Development Checklist: DONT
  12. Nice and airy, thanks for sharing! One thing I noticed is that it isn't responsive (also checked on my mobile). Is it by design? It could be relatively easily made responsive (the site design would allow it). Of course if the target audience doesn't need that then it's unnecessary.
  13. Are you sure no error messages (notifications) are shown? Check the upper section of the admin page. Another issue could be PHP max_input_vars, see this topic for example: https://processwire.com/talk/topic/8345-deleting-large-number-of-images-silently-fails/
  14. @Pete If you reach the final page, then you use $page->siblings->first, that's fine. My concern is that does the "iterator" reset too? So after calling first(), will the current page be the first page, and calling next afterwards would be the second one? The OP wrote he is calling these pages via ajax, so the current $page imo wouldn't be the first one.
  15. And what if showing the first item? Would $page->next show the second item afterwards?
  16. Using the current module you can not exclude, you should use my modified version, see the post above. Check the examples on the linked github page.
  17. Seriously, first I considered the post as spam. I still think its very trollish.
  18. In a similar situation I grabbed page IDs first and then the pages, like this: // get all children pages ID $works = $page->children('artist!=null')->artist('|'); // get all artists with ID $t->allArtists = wire('pages')->find("id=$works, sort=date_birth"); It needs PW 2.6 or newer to work (because of "artist('|')"). I'm also interested in a more elegant way if there's any.
  19. Just niced you don't have "Nogajski" in the window title, only for the main page. Is it by design? (just showing your site as a speed reference btw )
  20. That depends on your current setup. If your categories are unique and provide the exact same relations that you need in your filter, then you could use them as classes too. Eg. if some items are children of "cars" page and others are children of "trains", then you could use classes like 'class="<?php echo $page->parent->name ?>"'. Otherwise yes, I would add an extra field to store these classes. This would make it more scalable. Here is a similar technique used in UIkit (note that it is only to demonstrate how it works - hide/show items if the item has the selected categories): http://getuikit.com/docs/grid-js.html#sort2
  21. How many items do you have? If not so many (maximum 30-50), perhaps you could add extra "filter classes" to the items so you could simply hide/show them. If you have much more items and a pagination then this is not an option.
  22. I know, but a static html fragment could serve as an archive imo. If future styling is an issue, some kind of JSON data could be generated (+required assets saved, like images).
  23. @BernhardB What do you mean on "archiving"? Only a static state (no publicly available), or a page that can be viewed on the site? If its only static, then generating a PDF or static HTML files (with all assets) isn't an option?
  24. You should mention WireMailMandrill earlier, see this: https://processwire.com/talk/topic/5693-new-module-type-wiremail/?p=96011
  25. 1: Edit the parent page and under the "Children" tab, there is a "Sort settings..." setting at the bottom. Select "created" from the dropdown and check "Reverse sort direction?" afterwards. 2: There's an autocomplete input field in the popup window at the top saying "Enter a URL, email address, anchor, or enter word(s) to find a page.". Start typing and pages will appear. (you need to enable "pwlink" plugin in your CKEditor field's settings ("Input" tab) to be able to add links) 3. In your actual template, see the "List of fields to display in the admin Page List" setting under the "Advanced" tab. I don't know how to truncate titles though. Using PW 2.6.0 here.
×
×
  • Create New...