-
Posts
6,808 -
Joined
-
Last visited
-
Days Won
159
Everything posted by Soma
-
I think this module has a little bit too much categories http://modules.processwire.com/modules/page-edit-per-role/
-
I'm not sure I understand, but can't you just set them "hidden"? The include this and that ID approach won't work with hierarchical tree of course, but exclude would. "id!=1001|1005" "parent=1002|1003" would also work but only for direct children. "has_parent=1002" only works for 1 parent, but would include all children levels. So best option is the one built for such things, make the pages "hidden".
-
If you're no aware of this, you can get the selectors string that is used to produce a resulting PageArray with $a->getSelectors(). http://cheatsheet.processwire.com/?filter=getSelectors&advanced When printing this out in your templates html, I noticed that if you have used a "<" operator it will cut off the string from there, because it's rendered in html. To get around this simply use: echo htmlentities($result->getSelectors());
-
Pull today's events to home page from fullcalendar event page fields
Soma replied to ljones's topic in General Support
The output formatting of date field you can define in the field settings "Details" and "Input" for in and output format. To get the timestamp value you have to get around output formatting: $timestamp = $child->getUnformatted("date_start"); I'm not sure about your problems with strftime. %i for strftime doesn't exist. http://www.php.net/manual/en/function.strftime.php To get pages from today you'd have to get the 00:00 and 23:59:59 from the day and compare it in the selector. Or you can use "today" or any strtotime keyword and PW will take it. $start = strtotime("today"); $end = strtotime("today + 1day"); $pages->get("/events/")->children("date_start>=$start, date_start<$end"); or $pages->get("/events/")->children("date_start>=today, date_start<tomorrow"); -
Turn off your Adblocker and it should be fine
-
Looks like a very useful module, thanks for sharing it Ryan. I just tried to install it using ModulesManager, and I can't install it right after downloading as it requires Textformatter module to be installed. TemplateFile: Module ProcessHannaCode requires: TextformatterHannaCode #0 [internal function]: Modules->___install('ProcessHannaCod...')... Couldn't it be installed when installing the process module? Edit: When I create a new hanna code and not enter a tag name and save I get an error and can't see the form.
-
Very cool! And it load so much faster than before!
-
I'm not sure what you're trying, but the module expects a "root" page from where it renders the children of that page. On a side note "has_parent" only accepts one id and only makes a difference if the parent is one of the children of the root page. To understand a little better, can you explain what you want with those id's? Are those the only page that should show up, or are they the "parents" from where it should render a nested navigation?
-
And they're not errors but warnings.
-
Yes you have to make sure it posts to a url with a trailing slash. Or it will redirect to the /test/ and change to GET. If urls segment is enabled, its without trailing slash like /test/segment. It doesn't get redirected without trailing slash.
-
1. The upload max width and height setting is a way to avoid having the user upload 4000x10000px images. Remember it's a "max" size setting not a "thumbnail" setting. See it more as a original image that should be un-cropped. This keeps it flexible and simple to start with and if you maybe want to change the image size you still have the original image. Note that there's also several API calls in the image file to check for original and variations. Theres modules or simple ways for creating cropped images - as per Thumbnails module http://mods.pw/1b - or to requires a certain format http://processwire.com/talk/topic/3476-fixed-image-size/?p=34110 (add "min" size settings to image fields) - or a way to resize images on upload using simple module http://processwire.com/talk/topic/3718-lots-of-images-to-resize-timeout-in-frontend/?p=36291 2. Again it's not meant as a cropping setting for uploaded images. It works this way that if you set width "1000" and height "500" the image upload will be resized either in with or height or both depending on which side is larger than 1000px or 500px. That's why it checks both separate, at least I think so. 3. Most of the times you upload images and on output in the template file you generate the image size $image->size(520,261)->url and it will only create it if it's not already found and it will also recognize your crop settings. It creates a new copy and names it with the size you specify beside the original. This is the most straight forward way to work with images and there's not much more about it. But the system still allows to build on that and extend and change behavior of the image field if you wish.
-
Lots of images to resize -> timeout in frontend...
Soma replied to titanium's topic in General Support
A field's name is almost like an id and it shouldn't be changed. This might happen when you start but once you setup your fields they most likely also are referenced by their name in template files or other settings and changing the name will break your code or output. In a perfect world this module maybe would have some configuration you could define the field by reference. Using the id here you'd have to get the field first. I changed the code var $field to $inputfield, to avoid confusion as it's actually the inputfield and not the field (as the hook already suggests). Inputfields have no id. They serve mostly as the input that interacts with the user. If you get the id of the inputfield you'll get the Inputfieldimage_fieldname, which is used for the markup when it's rendered. It's the fieldtype that is the one that has a id property, the id you see when editing a field and in DB. To debug the module it's a little special, but it can be easily done by using a simple trick. Add this in the hook function echo $inputfield->id; exit(); or die("id:" . $inputfield->id); Now if you upload an image it will stop there and you should see what it outputs. If you're using ajax upload, this is seen in the ajax request response if you look in the developer tool. It will show "InputfieldImage_yourfieldname". Now to get the actual field you get it via the "name" of the field using $fields API. $fieldID = $this->fields->get($inputfield->name)->id; -
Try adaptiveimages.com by matt wilcox. Works fine for what you try to do. I used it myself on a pw project.
- 3 replies
-
- javascript
- sessions
-
(and 1 more)
Tagged with:
-
Cropping option is meant for when using size(100, 100) on images on front end. You changed the max width and max height resizing which isnt meant to crop but limit image sizes the user uploads. So it's all fine as it is.
-
Lots of images to resize -> timeout in frontend...
Soma replied to titanium's topic in General Support
Does it work, means is there no timeout? I just removed a line that was not needed. -
Ahh, it doesn't redirect if LanguagePageNames module is installed...
-
I also wanted to try this, but in my install here it doesn't redirect to a trailing slash!?
-
Sorry to hear, but I can't reproduce... It's always post (of course) when the form method submitted is set to post. The request method is only GET when loading the page. urlSegments doesn't have any effect. I'm on XAMPP Mac.
-
Lots of images to resize -> timeout in frontend...
Soma replied to titanium's topic in General Support
This is the only way I know to create different sizes when uploading images: <?php class ImageCreateThumbs extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'ImageCreateThumbs', 'version' => 100, 'summary' => '', 'href' => '', 'singular' => true, 'autoload' => true ); } public function init() { $this->addHookAfter('InputfieldFile::fileAdded', $this, 'sizeImage'); } public function sizeImage($event) { $inputfield = $event->object; if($inputfield->name != 'images') return; // we assume images field $image = $event->argumentsByName("pagefile"); $image->size(120,120); $image->size(1000,0); } } https://gist.github.com/5685631 What I don't know is if it really makes a difference (I guess), and if using drag and drop ajax upload and old school upload would process image one by one. My suggestion is to also upload image already in 1000x* pixels because if they upload 3000+ px images it will just takes a lot longer.- 25 replies
-
- 13
-
-
$page->next($pageArray); As I said Ryan must have reasons, but I don't know really and haven't analysed all those traversal methods just thinks it isn't that trivial.
-
And does you method work with PageArray?
-
And the sorting and selectors? As you can also do next('selector'). And next() also is for in memory (PageArray) usage not only direct query. I'm sure Ryan has reasons Edit: but if performance matter you could create your own next() methods.
-
No problem, I just confused by terminology I guess. This should get you there: $language->getUnformatted('title')->getLanguagevalue($language->id)
-
I dont get it really...
-
Well then just enter the same for each language.. no need to go fancy..