-
Posts
4,956 -
Joined
-
Last visited
-
Days Won
100
Everything posted by LostKobrakai
-
Serve Image variation only for print
LostKobrakai replied to louisstephens's topic in API & Templates
You might want to take a look at this or other resources on the topic: https://www.smashingmagazine.com/2011/11/how-to-set-up-a-print-style-sheet/ -
The most taken way to do that is probably using Amazon's S3.
- 1 reply
-
- 2
-
$files->include() don't get vars from _init.php??
LostKobrakai replied to Pixrael's topic in API & Templates
I've used all sorts of different styles in my projects, so really it depends on how flexible your markup does need to be and how you want to pass data to your partials. -
Can you show us the code where the images are used in your template and/or the markup, which does get rendered?
-
$files->include() don't get vars from _init.php??
LostKobrakai replied to Pixrael's topic in API & Templates
Only the native include() function does implicitly share variables with included php files. Any userland functions/methods cannot do that, which is why $files->include() cannot do it as well. $files->include() is there, because it's aware of processwire's filecompiler, if you don't need that you can simply use include() as well. -
Adding the setlocale statement is not a hard requirement, but you'd need to live with the pw notice each time you log in. It's been added not because of anything related to multi-language sites, but because of issues with file handling of processwire involving utf-8 characters like cyrillic ones. These can happen on all processwire sites not just multi language ones.
- 40 replies
-
- 3
-
- serverlocale
- 3.0.52
-
(and 1 more)
Tagged with:
-
Advanced mode is mostly meant to be toggled on just to edit the named settings and disabling it again (or at least for the live version).
-
https://processwire-recipes.com/recipes/resetting-admin-password-via-api/
-
These are such micro performance improvements, that I doubt these causing the cpu spikes.
-
There are various topics around this exact use case on the forums. The short version: there's no obvious solution, but things you can do.
-
The thumbnail generation does run when this code is executed and the file corresponding to the thumbnail does not exist at that time.
-
If you mean "per individual email" then it works like that for all WireMails $mail->header("Reply-To", $emailAddress);
-
Fetch all published and hidden pages with 200 response code
LostKobrakai replied to ---'s topic in API & Templates
You might want to use this instead of a hardcoded id: $config->http404PageID -
That's not correct. It's not populated by json data – which by the way is not really a standard or alike – but only by data formatted in application/x-www-form-urlencoded or multipart/form-data. Both is what a <form> can send, but ajax can also send data in that format. It's just that ajax libs nowadays favor json (, it's not like it's name would include xml :D).
-
I'm not sure this is the issue, because you're experiencing it locally as well as in production, but setlocale() can only work if the locale is actually installed on the running machine. If not it will silently refuse to change.
-
To be honest I've no idea where the error message did come from. It's certainly highlighting a some different thing.
-
// Page > Page > Page > PageArray > children() // There's no PageArray::children() method $result = $page->parent()->parent()->children('template=event-tickets')->children(); // Use this: $result = $page->parent()->parent()->child('template=event-tickets')->children(); // Or even $event = $page->closest('template=event'); $tickets = $pages->find('has_parent=$event, parent.template=event-tickets');
-
@Martin Muzatko Could you please share the code you're using.
-
There are various pages in the admin, which do not have the "admin" template. These are generally not accessable as backend page per se, but really checking for the rootParent is the most future prove way of handling that even if updates to processwire would change something with the templates. The backend parent page will more likely stay with it's id of 2.
-
Then you might want to try: $event->wire('page')->… I'm not sure, but page::render should not be called before ProcessWire::ready.
-
It depends on when you call that. Before processwire's ready state the current page might not yet be determined.
-
$isAdmin = $this->page->rootParent->id == 2
-
The PW Backend is basically a highly-specialized frontend to your data, so if you set your permissions correctly you can let whoever you want have access to it.
-
Redis is often not available in shared hosting environments and we have lots of users, where this kind of tech / performance gain doesn't make a real difference. It's certainly a really nice to have module, but it always depends on the use-case.
-
How to run a processwire site on a android-tablet?
LostKobrakai replied to panx's topic in General Support
Try it you'll quickly find out if it does support that. Also these requirements are only applicable to apache/lighttpd. There are also nginx rules somewhere on the forums, which do the same.