Jump to content

LostKobrakai

PW-Moderators
  • Posts

    4,956
  • Joined

  • Last visited

  • Days Won

    100

Everything posted by LostKobrakai

  1. If it's single page than use "$page->category->id == $child->id"
  2. hanna code snippets are evaluated multiple times in the lifetime of a single pageview, which means the function declaration is called multiple times, which is not allowed. Try creating the function in _init.php or another file which is called only once on for each request and just execute the function in the hanna code snippet.
  3. What's the intended structure the code should produce?
  4. Alternative would be to allow slashless urls for the specific template.
  5. If urls without trailing slash are not allowed in the template's settings then it will redirect to the url with slash swallowing the get parameters.
  6. True, but a hidden css file cannot power a public website because – well – it's hidden. That's why I asked for specifics.
  7. Essentially the places to look at are Pages::getById and Page::getFieldValue.
  8. I'm also curious what october cms does (trys) to hide your css. Do you have any examples?
  9. Somas issue is totally different (also over a year old) in that umlauts would need to be stored as umlauts in his case. Pagenames on the other hand are encoded as ascii chars by using the puny code encoding, which is also used for international domain names (IDN).
  10. Even pages are most of the time queried once and after that cached. And their fields are as well only loaded once on first demand of it, as long as it's not autojoin field, which are automatically loaded with the pages native data (id, template, …).
  11. There's FieldtypeSecureFile, which allows you to store files off the webserver root directory and therefore denying direct access to the file. You can then serve the file through your php code, which can check your rules for allowing access to it, before sending anything. I just want to emphasis, that this will need good configuration of the webserver and returned header data, otherwise you'll considerable increase the load on your webserver as content served this way is essentially not server-side cacheable as well as loading php for static files does need more computation. Client side caching can work, but depends on how fast you want to be able to revoke access again. I'll just add this part, because you didn't add a specific intend in your post: You shouldn't and really can't encrypt / hide content for unauthenticated users. If it needs to be publicly readable / accessable on your website then it's public no matter what you do. As long as the browser needs to have unauthenticated access everyone else has access, too.
  12. Yeah. But there are way to let autoloading be determined conditionally, but I haven't used them by now.
  13. I've seen a few of people recommending Blue Yeti for podcasting.
  14. I've used such limitations in the past and I can only advice you to be careful with the code. Surely users might only see their own categories in those pages, but you also need to consider what you're seeing (as superuser) when editing these pages or you'll empty out this field everytime you'd save the page. Also it's always to consider that for example processwire's lister will try and load the select box without specific user or page context for displaying it in it's filters.
  15. Since it's now listed as working in 2.7 I've to try it out, too.
  16. Opcache (as really any cache) is useful for production sites, but the least in development.
  17. The second change could easily be made by a hook to FieldtypeComments::getConfigInputfields, where $event->return is the form you can edit. $f->insertAfter() will make this really easy to add in.
  18. It doesn't even need to be stored in a custom db, as most template data is stored as encoded json string anyways, which can be used for custom fields as well.
  19. You can hook into ProcessTemplate::buildEditForm and add your fields there and ProcessTemplate::executeSave to persist any entries to those.
  20. You could always use the separate module config as long as your module is in any subdirectory. It's named after your modules, so there cannot be any conflicts and it makes things a heck of a lot more streamlined and less static-y.
  21. I'd recommend reading this: https://processwire.com/blog/posts/new-module-configuration-options/
  22. $session->redirect('./?nocache=1', false); Add that GET variable in your cache settings. Alternatively use one time csrf tokens for double submit prevention: // For your form $name = $session->CSRF->getgetTokenName('contact'); $value = $session->CSRF->getSingleUseToken('contact'); // On submission, will throw after the first validation try{ $session->CSRF->validate('contact'); } catch (WireCSRFException $e) { // Double or invalid submit }
  23. The blue-vr template should probably also work with 2.7 as there weren't any mayor changes, like with 3.0, just try it with that version.
  24. // project $class2 = $page->category->has($child->id) ? " class='on2'" : '';
  25. Why would a hidden field not be submitted? Keep in mind that the caching does work on post/get data in the http request, so it does need to be submitted.
×
×
  • Create New...