-
Posts
17,232 -
Joined
-
Days Won
1,700
Everything posted by ryan
-
Thanks for the additional details Sevarf2, I will keep trying here.
-
I think this is a good example of why I'm a little scared of supporting context for any factor. If you set "max files" to "1" in one context, and "0" in another, then those fields are going to behave differently from the API (Pagefile vs array of Pagefiles). Same thing with a Page reference field, where you can define its type with the field (Page, PageArray, NullPage, false). I think it could cause a confusion and bugs in people's code. Another example is just a plain text field. It might have an entities encoder added to it in one context, and not in another. That could be not just confusing, but an output and potential security issue (depending on the source of the text). Uncontrolled field contexts are a bit of a can of worms. So before we open up context beyond the existing built-in factors, I want to come up with a way for fieldtype authors to identify a factor as being safe (or not safe) for multi-context.
-
I think it'd be worthwhile for marketing, but not sure how useful it would be unless it can make some assumptions about the service API (like PW-to-PW or something). The reason I question the usefulness is just because outside of a known service API, the read-only aspects don't amount to much more than this: $data = json_decode(file_get_contents('http://domain/path/to/service?a=b')); I'm just not sure a wrapper class adds much value here? But once we know about the service, then a wrapper class seems to start adding value. So perhaps the value comes from defining an interface or abstract class to be extended, rather than adding a layer to something that doesn't need it. While I've built a lot of web services, and built tools to read from a lot of services, I'm not an expert on web service standards by any means. Someone correct me if I'm missing anything obvious. I also agree that it looks interesting. I like the ideas behind it for sure. But I've not been able to make much sense of it after half an hour, so I guess I'd say it's a bit muddy for me too. Anything makes sense after enough time reading, researching, etc., But my brief exposure gives me the impression that CMIS seems like a complex answer for a simple question (and I admit that's an uninformed opinion). I might feel differently after more time. But initial impressions are that it's something to watch and follow, and put on the roadmap if there is high demand for it someday in the future.
-
Thanks AlexV! This module was written before multi-language support in PW, and hasn't yet been updated to support multi language title/text/textarea fields (though does support multi language alternate fields). However, even if it had been updated, you would still need a title specified for the page in the 'default' language (since it is a required field). It doesn't care what language the 'default' language is, whether English, Russian, etc. But when you are importing with this module, it is assuming that default language for any multi-language fields. It sounds like in your case, you may want to have Russian as your default language, and English as an add-on language. That way you don't have to translate to English before importing.
-
I think there were good intentions behind them and I understand the original purpose, but i've just never come across anyone actually using them in their API. Though I'm sure they are out there. But there's nothing you can't do with them that you can't already do without them, so I think many see them as unnecessary barriers to adoption of their API.
-
PW is a perfect platform for your RESTful APIs or any kind of web services. Some of my clients keep multiple sites that need to talk and share data with each other at regular intervals, and I always build "RESTful" web services with ProcessWire to accomplish this. PW was designed to make this particularly easy. But I'm not a fan of the terms "REST" or "RESTful", as I think it implies that there's something more than what it is. This is the way we were doing web services before those terms existed, and it is basically the way you would think to do it even if you never heard of it. If you are dealing with primarily GET requests (which covers most of my needs), then you don't need anything other than ProcessWire and PHP's standard file_get_contents(), json_encode() and json_decode() (or simple_xml) functions. If your needs also involve POST requests (or your PHP doesn't let you load URLs with its file functions), then I recommend grabbing the really simple and easy-to-use Snoopy class too. I don't personally bother with PUT or DELETE requests, or understand why they would be necessary or preferable over authorized GET/POST requests doing the same thing. Let me know if you'd like me to supply any simple code examples of how you might use ProcessWire in this manner.
-
Template editor fieldset indentation and checkbox columns
ryan replied to ryan's topic in News & Announcements
Actually those were added at the same time as this update. I experimented with it and it works nicely, but decided just to make them bold rather than changing the color. But you can change the color, background color (or the entire row) or anything else with it from an admin theme. Here are the relevant classes: #ProcessTemplateEdit .asmFieldset - applies to both starting and ending fieldsets or tabs #ProcessTemplateEdit .asmFieldsetStart - applies just to starting fieldsets or tabs #ProcessTemplateEdit .asmFieldsetEnd - applies just to ending fieldsets or tabs #ProcessTemplateEdit .asmFieldsetIndent - controls the width of the indent, adjust with css width property -
I committed a couple small additions this morning: 1. Fieldset indentation in the template editor. Hard to describe, but I needed some way to make the grouping of fieldsets a little easier to see in the asmSelect list in the template editor. Here's a screenshot which describes it better than I can: 2. The InputfieldCheckboxes field now supports columns. This would typically be used if you had a Page reference field using the Checkboxes input. When editing the field, you'll see a new option on the 'input' tab where you can specify a number of columns you want it to use. This is just a way to tighten things up for when you have lots of short-labeled checkboxes (see bottom of screenshot).
-
Not at present, but definitely interested in doing that for the future. It's just a matter of time/resources and putting it towards the stuff that matters most in the short term. Longer term it would be really nice to have something like this, especially as PW gets used more and more as a framework. I would version control your /site/templates/ and /site/modules/, but not your /site/assets/ as they are tied to DB entries. Though if you combine it with a DB export for each commit, then that would solve it. But this is something we'll have built-in version control for, further down the road.
-
I think this makes sense, but a little clarification to that message. It's taking about making it non-writable to the web server, not non-writable to you. I don't suggest removing your own write access from any file. But I think you are talking about the situation where Apache runs as the same user as your account, and it makes sense there. I will plan to combine these messages in a manner that fits that situation --good suggestion.
-
Wow how did you find that fix Pete? Good find! I will add this to the core, but just want to make sure the issue goes beyond one case, just to be on the safe side (?) Unless there's something out there that says this is a safe/expected header for this context. I'm not yet familiar with this octet-stream. Someone correct me if I'm wrong, but I don't think it matters if it's X-FILENAME or X-FILE-NAME. It's just a matter of what we're looking for on the PHP side, i.e. $_SERVER['HTTP_X_FILENAME'] vs $_SERVER['HTTP_X_FILE_NAME'].
-
Adding and Assigning Fields without using gui?
ryan replied to neildaemond's topic in API & Templates
Another option (though one I don't use often) is the 'global' checkbox available in the 'advanced' tab of the field editor. (Though I think this one may only be available if $config->advanced is set to true in your /site/config.php). Anyway, once you check that box and save the field, it then requires all your templates to have that field. And it will add it to any templates that don't. -
Rob, how about this? # block everything except actual files/dirs that exist # for instance, JS/CSS files used by admin and modules, etc. RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule !^processwire - [F] # block access to root and /index.php file # if running site from subdir, replace '/' with '/subdir/' RewriteCond %{REQUEST_URI} ^(/?$|index.php) RewriteRule !^processwire - [F] Place right after your "RewriteEngine On" line.
-
Great to hear about the addition of fulltext indexes to InnoDB! Once MySQL 5.6 is more widespread in web hosting, I look forward to testing out and comparing to MyISAM in ProcessWire. Though my understanding is that InnoDB is technically superior in many ways. If that also translates to PW performance equal (or better than) MyISAM, then it would make sense to use that where appropriate and possible. Fulltext indexes really were our own MySQL/MyISAM dependency, so with PostgreSQL, MySQL/InnoDB and even SQLite now offering support, it will be possible to get PW going in more database platforms without too much effort.
-
That's correct, you should use has($child). The isValidItem() is meant for internal PW type checking. It only validates that the given object is a Page (any Page).
-
With the new field-template context, you can name it differently with labels and descriptions. But changing the actual 'name' of a field is something you can't do. Though even if we could, I think I might find that a bit confusing. Being able to change the other field settings (beyond label, description, columnWidth, visibility) is actually supported in the core, but I've got the system blocking it right now because I'm worried about side effects here. I figured we'd open this up in advanced mode soon, and then roll it out for everything once we're sure it's not creating major new issues or complexity. But it made my mind hurt just thinking about all the possibilities it could open up (good and bad). So decided to make field-template context contain only known variables to start, and then jump into the rest after marinating a bit.
-
This is the route that ProcessWire takes with the admin too (you can see it by view source in browser when in PW admin). PHP-powered JS files are definitely cool in the right places. But I worry a little about browser cache issues. You generally want your browser to cache those JS and CSS files. If you are outputting dynamic data with them, you may be preventing the browser from caching them, or battling it over caching them when you don't want it to. There are ways around it (managing cache headers and keeping track of when stuff changes) but it just seems like kind of a pain to me, though I've not done a lot of it.
-
Sorry for the typo, I've corrected my original post. Thanks for finding it Adam.
-
I don't know if there is a way to do that, but I also use MAMP here and it only prompts me for the password when I restart apache or reboot. I might do this once a month or so. The password isn't too bothersome if you don't reboot often.
- 14 replies
-
- root
- sub folder
-
(and 1 more)
Tagged with:
-
We may have to add a button like that soon. Currently it restores defaults when you set it to the blank/original unset value. But of course that prevents you from overriding a default populated value with an unpopulated one. So currently it's best to leave the default (no context) value blank if you want it to be blank/unset in any alternate template contexts. Luckily, I don't think that's a common situation (at least not here). I'm not sure that I understand? There isn't a foundation for context outside of multiple template/fieldgroups, but maybe I'm not reading this right. Can you give me a more specific example or what you mean?
-
Actually this sounds familiar now, I think I remember that Safari for some reason does not support drag-drop file uploads. That was awhile ago that I remember talking about this before, and figured they would have fixed it by now. It seems like Apple is not giving much love to Safari lately.
-
Ray this is fantastic! Thanks so much for writing and sharing this with us. I am setting up a case studies forum as a subforum of showcase (unless you guys think it should go elsewhere?) and will move this there. Thanks again!
-
Sevarf2, I tried to duplicate this over the weekend, but so far not having luck. My repeater had an datetime field that auto-populated the current date and also had a datepicker on it. I tried saving them, deleting them, etc. I tried this with both setting the "ready pages" number and 0, 1 and 3. I'm wondering if there might be any other factors -- Are there any other fields in your repeater? Are you using the default admin theme or another? And any other modules installed? Thanks, Ryan
-
It sounds like it really is a Page object then, as it should be. The question then is why PHP is throwing a "not object" error. I'm wondering about the eAccelerator that your phpinfo said is installed. I have a feeling that line 78 isn't really line 78, and that it's line 78 of a cached file or something. I look forward to getting a closer look at the install (per your PM).