Jump to content

ryan

Administrators
  • Posts

    16,715
  • Joined

  • Last visited

  • Days Won

    1,515

Everything posted by ryan

  1. You'd need to use URL segments. See the CMS Critic case study (section on template file structure) for an example of doing this.
  2. I haven't been able to duplicate this one yet. You might want to see if updating your dev branch version helps at all? We're in a bit of a transition with the admin theme, so you might also see if using the new admin theme (copying /site-default/templates-admin/ to your /site/templates-admin/) makes any difference?
  3. Thanks guys, I have updated the module to 1.0.4 with these fixes in place.
  4. Pete already said it well, but I'll put it another way too. URL segments don't have anything to do with queries or filtering or anything like that (unless you choose to make it do that with your own code). They are just something your code can look for to do something, like Pete's example above. It's no different than checking the value in a GET or POST variable for instance. The benefit of using URL segments over GET vars is that the URLs look prettier (and probably more search friendly), and they are cacheable.
  5. "today" is something you could use within a ProcessWire selector, like below (so long as you are querying a datetime field): $garagesales = $pages->find("town_select=$town, Date>today, sort=-Date"); …but it's not a PHP language construct, so you couldn't do this: if($c->Date>today) { Like maba mentioned, you'd want to use the time() function instead, which returns the current unix timestamp. You'd also want to retrieve the "unformatted" version of "Date", as you may have it configured to output a date string rather than a unix timestamp. And you'd nee the unix timestamp (which is an integer) in order to properly compare it with time(): if($c->getUnformatted('Date') > time()) {
  6. The double click thing was annoying me too. I removed it on dev.
  7. Thanks for the PR on this. I will go ahead and implement it. Glad to see you moved the hook to a separate function, as __toString() is a native PHP thing that we can't change the name of. But this is also a high-volume function, so one that I might need to add a little extra bits to keep things running fast.
  8. I plan to collapse them to a "=" icon (pretend it has 3 horizontal bars rather than 2). But I'm also not sure how important it really is, as the navigation remains fully functional either way. I think it'll be fine to let the content tabs (WireTabs) wrap this way at least. I thought they looked pretty good the way they were, but if you guys think they look better on top, I'll switch it. It should be translatable from /site/templates-admin/default.php, at least it does appear in our translation list in that file. I'll test it out to be sure though. Thanks, I'll try this one out. I was able to test on Windows Chrome this week, and can now see the font-rendering issue. Though from my perspective, all fonts looked pretty poor, including Arial. Maybe I'm just used to the antialiasing in OS X, but wondering if Chrome/Windows just has issues here in general. Not sure how far we should go with it if even the native fonts look bad. Fontsquirrel says that the font's license doesn't allow them to create a webfont version of it, so it has to be done manually. If they can't distribute the webfont version, i'm assuming we can't either. When we put something in ProcessWire, we're distributing it. However, I'd love to be wrong about this, as I'm really enjoying the look of Arimo (on the mac at least).
  9. We could do that, but I'm not sure it would matter in this case. The time you spend waiting is not for animation. It is the time spent generating and processing the ajax request (multiple requests, if drilling down multiple levels). I'll test it out to be certain though.
  10. $form = $forms->get("reconocimientos"); echo $form->render(); $form->get("reconocimientos")->addHookAfter("processInput", null, 'hookEmail'); A couple things to mention about the above code (quoted from above). You are adding a hook after the render(). You would need to add the hook before the render. That's because processInput is triggered from render(). Secondly is that you are hooking the wrong thing, as I don't think there is a 'processInput' method on $form (since it's not an InputfieldForm). What you'd want to do instead would be this (in your form-builder.inc file): wire()->addHookAfter('FormBuilderProcessor::processInput', null, 'hookProcessInput'); function hookProcessInput(HookEvent $e) { $processor = $e->object; if($processor->formName != 'reconocimientos') return; $inputfields = $processor->getInputfieldsForm(); // your code here. }
  11. I'm not able to duplicate this one. Anyone else seeing it? I've tried on both PW 2.3.0 stable and 2.3.5 dev, with both TinyMCE and CKEditor. "No Alignment" is not intended to be a CSS class. It sounds like somehow the option label is ending up as the CSS class in your case rather than the option value.
  12. Diogo, would the Pages::added hook be what you are looking for?
  13. Being able to link to hidden pages is important. Often times we make pages hidden specifically because we'd rather make our own contextual links in text rather than have them in the site's navigation. As for unpublished pages, there are situations where we may be working on a group of pages that get published together, so not sure it's good to prevent linking. I think the best thing to do here is inform the client what it means when a page has a strikethrough. If it's a strong need there, I can show you how to accomplish it now with a hook. I don't know if it's a bug in CKEditor or not, but I couldn't find another way around it. DIVs aren't acceptable replacements for <p> tags, so that's why I put in that fix. Hackish I know, but solved the issue here. I'm always on the hunt for a better solution though.
  14. Thanks for testing it out. 2.3.5 is the current dev branch version (soon to be 2.3.6)
  15. I'm guessing it doesn't have anything to do with the spiders, other than that they tend to make a lot of requests in a short period of time. It sounds like your web host is limiting the number of DB connections to a number that's not appropriate for your site. It may be helpful for you to enable template caching (or better yet ProCache) to reduce the amount of time spent on each request. Or ask them to increase the resources available to your site (which may be futile if it's a large/budget host).
  16. I'm not positive on this one and not at a place where I can check it just yet, but LanguageSupport does repeat several function calls for each language, and this may be one of them. Though not immediately sure why it would be (I would think it would be FieldtypeTextarea's wakupValue that gets called 3 times, not FieldtypeTextareaLanguage). It's also possibly the result of something to do with a repeater? If you add another language, is it then called 4 times?
  17. I'm confused because you can't change the default language per-se. You can change what you consider to be the default language, but it still has to have the name "default". In fact, ProcessWire doesn't (or isn't supposed to) let you change the name of the default language at all.
  18. Sorry, I should have clarified that the text-shadow should be added to the body tag... body { text-shadow: 0 0 1px transparent; /* google font pixelation fix */ }
  19. For you guys where Arimo is looking bad, can you try adding this to your /site/templates-admin/styles/main-[colors].css file and see if this fixes it? I found this in HTML Kickstart's stylesheet, so was thinking maybe Joshua already figured this one out for us: text-shadow: 0 0 1px transparent; /* google font pixelation fix */ Horst–thanks, I'll check out Muli too.
  20. I'm not aware of any bugs here, and I do these kinds of API replacement of images daily. But you might try and see if using the dev branch makes any difference here. Also it would be good to know of any modules you have installed in case anything is hooking into any of this.
  21. You might want to move this into a PW template file (the exact code, minus the require_once at the top). This would ensure things are output formatted and you can take advantage of PW determining the language for you and such. Though the way you are doing it is just fine, but since you are bootstrapping PW output formatting is not enabled by default. You can enable output formatting for your $affiliate pages, so that you are dealing with formatted values. In your case, that would mean $title would be a string rather than an object. $affiliate->of(true); You may also want to add a header before outputting your JSON: header("Content-Type: application/json");
  22. Peter, have a look at /wire/core/Sanitizer.php and the selectorValue() function in there, as I think it'll answer your questions better than I can here. But to attempt an answer here, these are the lines where the character replacement occurs, which shows which characters it replaces. For the most part, these are characters that might be used as operators. Technically, it doesn't need to replace them anywhere other than at the beginning or end of the string, but it currently replaces them no matter where they are (it's on my todo list to optimize that): $value = str_replace(array('*', '~', '`', '$', '^', '+', '|', '<', '>', '!', '='), ' ', $value); $value = str_replace(array("\r", "\n", "#", "%"), ' ', $value); using $sanitizer->selectorValue() is going to be valuable primarily when dealing with user input. If you are dealing with API-level stuff that doesn't involve user input, then it should be just fine to sanitize yourself rather than using selectorValue. I would just quote your value and make sure it doesn't already have quotes in it: if(strpos($field_value_search, '"') !== false) throw new WireException("Sorry value can't have quotes"); Quote the value in your selector. Since the value is already surrounded in quotes, PHP requires you to escape the embedded quotes: $check_field_dupe_id = $pages->get("$field_name=\"$field_value_search\", include=hidden, check_access=0" )->id; In cases where you are using $sanitizer->selectorValue() and it surrounds the value with quotes, then you don't need to worry about escaping embedded quotes as they are already present in the string. Meaning, you can do this: $cleanValue = $sanitizer->selectorValue($dirtyValue); $pages->get("field_name=$cleanValue");
  23. I'm not aware of such a module, but the existing ProcessPageEditLink might be a good starting point. Note that if using with TinyMCE, you also have to write a custom TinyMCE javascript plugin to connect with it. For instance, the "pwlink" plugin that comes with PW's install of TinyMCE is what connects to ProcessPageEditLink.
  24. You can copy the entire ProcessPageEditImageSelect module to your own directory in /site/modules/, but make sure you rename it to something of your own, like ProcessPageEditImageSelectCustom (or whatever you want). You'll have to rename not only the files, but the class name in the module file as well. Modify the module as you'd like, then in your admin: 1. Install your new module from the Modules menu. 2. Go to Pages > Admin > Page > Image Select. Edit that page, and select our new module as the "process" rather than ProcessPageEditImageSelect.
  25. They will be presented in whatever order is used by the parent you are pulling them from. I'm guessing in your case that the parent page used for your selectable options is configured to sort the children by date. You could change this by configuring your Page reference field to use a selector string rather than a parent. This should do what you need: parent=/path/to/your/parent/, sort=name
×
×
  • Create New...