Jump to content

adrian

PW-Moderators
  • Posts

    11,097
  • Joined

  • Last visited

  • Days Won

    365

Everything posted by adrian

  1. No problem here on 2.5.10. Did you remember to configure Modules > Core > InputField > Page and SelectInputfieldSelectMultipleTransfer as an allowed Inputfield for Page selection, and save? See the instructions here: https://github.com/ryancramerdesign/InputfieldSelectMultipleTransfer EDIT: I don't know how I missed your edit at 4:50 when I posted at 5:00pm - oh well, glad you got it sorted regardless
  2. Thanks for this - awesome. I have used OpenWeather, but not yet with PW and will need to in the next few weeks, so this will be a big timesaver. Another nice set of icons that work seamlessly with OpenWeather are Skycons: http://darkskyapp.github.io/skycons/
  3. Sorry - I figured the lazycron was a typo - I should have phrased my comment as such I have another thought for you which I think is important. You are setting the status directly as statusHidden and StatusOn, but really you should be using addStatus and removeStatus to add/remove Page::statusHidden Otherwise you will override unpublished, locked etc.
  4. Google will use the content inside the page's <title></title> tags. There isn't anything you can do to change that, but you can change what goes in here in a PW template. eg: <title><?php echo $page->google_title; ?></title> assuming you have a field called "google_title" in the template for that page. Of course this will also be the title that is shown as the label for the tab in the user's browser as well, so bad choice of field name, but you get the idea Does that help?
  5. Looks very handy - thanks! A few minor comments: I don't see why it requires LazyCron I think you have the messages reversed - it says "Changed page status to 'hidden'" when it should say "visible" It would be nice if the message told you what page had its status changed I'd love to see this work via ajax, rather than a page refresh, or at a minimum, it would be great if the EDIT / VIEW etc links were turned on for that page after the reload I am not sure whether the obscurity of the tick/cross is really worth the reduced space usage - I would rather see hidden/visible, but maybe that's just me. Thanks again!
  6. Have you seen these posts: https://processwire.com/talk/topic/7441-using-git-instead-of-ftp-in-shared-hostings/ https://processwire.com/talk/topic/2885-what-filesfolders-should-be-added-to-gitignore-for-regular-development/ https://processwire.com/talk/topic/5417-using-git-with-a-cms-for-version-control-and-deployment-on-multiple-machines/ Might get you started.
  7. There is a bug in the current stable that is causing your problem trying to install TinyMCE. It was fixed in the dev version 8 days ago: https://github.com/ryancramerdesign/ProcessWire/commit/68acd61f7327ad4529fe15b25f388c6dc49ae38d If you don't want to run dev, I think you could probably just make those changes shown in the above commit that are in the wire/core/Modules.php file. As for the hidden pages showing up in your page field - there is a note with the custom PHP code that says: " NOTE: Not compatible with PageListSelect or Autocomplete input field types." Not sure if there is an easy way to not show hidden pages. I am in a rush, but I think you might need a little helper module to remove them from the list. Maybe someone has time now, otherwise I'll try tomorrow.
  8. All PW variables (incl. $page) are not available inside modules, or functions in templates. You need wire('page')->editable() etc, or often in modules, depending on the context you can use $this->page, but wire('page') always works.
  9. I think this module from Martijn will do what you are looking for: http://modules.processwire.com/modules/textformatter-image-interceptor/
  10. Hey Ivan - if I am becoming an expert on character encoding, then we should all be very scared - I still have no clue But anyway, I have committed a fix which seems to work fine now in some limited tests. Can you please take a look and let me know.
  11. @hellomoto, I don't really think there is a security risk, especially given that you can limit this module's actions to specific templates and pages if you wish. Anyway, hope it works as you expect!
  12. The other option would be to change the regex in the module. This is what I use in Get Video Thumbs and it works fine with plain text (URL) and Textarea fields: /\s*(?:http(?:s)?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(??:watch)?\?(?:.*&)?v(?:i)?=|(?:embed|v|vi|user)\/))([^\?#&\"'<>]+)/ That said, I agree with Martijn's approach
  13. Actually, if I use $event->object, I get "Method Pages::of does not exist or is not callable in this context" But it works fine for me with: $event->arguments[0]
  14. Good point about my admin user account showing up and also the admin url being wrong - sorry about that - it really was meant to be a fun option - I didn't think it through fully I am going to remove the attachment from the above post so I don't confuse anyone else. The install process really is very simple, so glad you're heading that route.
  15. Can you show us the full code for the module that you are using now. The code chunk I posted works if used with the rest of the module that Phillip posted. i am not completely sure it does what you want, but it definitely does what it is supposed to do
  16. I think Phillip inadvertantly forgot the actual save part Try this: public function saveShortUrl($event) { $page = $event->arguments[0]; //#todo Rename to your field names. $page->domain = parse_url($page->source_url,PHP_URL_HOST); //#todo Maybe some more error handling. $page->of(false); $page->save("domain"); $this->message("Save the domain {$page->domain}."); } As Phillip mentions - you need to have a field called "domain", or rename both instances of "domain" in the code above. Hope that helps.
  17. That "-is" suffix is a fairly new addition to PW I think. horst is the one who can explain it properly, so I might defer to him, unless someone else knows anything more about it.
  18. Great minds "almost" think alike: https://processwire.com/talk/topic/7274-are-there-better-fields-naming-convention/?p=70106 Similar suggestion, but for adding fields to templates.
  19. Ok, I should have just looked at the source for that function in the first place This is what you need: $image = $event->object->getPageimage(); $width = (int) $this->input->get->width; $height = (int) $this->input->get->height;
  20. I think it must be something in your sizeCloud method, because my quick testing with the ProcessPageEditImageSelect::executeResize hook seems to be working fine. Sorry about pointing you to the wrong function by the way. It is to do with your: $resizedImage = $image->size($width, $height, $options); Which means that $image is not the object you are looking for. Let me go on my way - to investigate a little more
  21. Hey @mike131 - this is a duplicate post - no need - we'll find you Please lets all stick to this one: https://processwire.com/talk/topic/8491-admin-controller-what-file-is-it-calling/
  22. Is this what you are looking for? https://github.com/ryancramerdesign/ProcessWire/blob/dev/wire/core/ImageSizer.php#L281
  23. Page fields are about as core as anything in PW. PW without free Page fields would be unspeakable
  24. You need to get the URL from the field: $slide->slide_link_url->url; But to make things a little less confusing, I would rename your field from slide_link_url to slide_page or something like that By the way - I am not sure why this is in the Profields board - do you mind if I move it to general support or API? PS Soma - I edited my mistake before your reply came through - wasn't trying to hide my initial mess
  25. I would say you need two fields, one for internal PW pages - use a Page field with Deref in API set to: Single page (Page) or empty page (NullPage) when none selected and Inputfieldtype set to PageListSelect+ You can set the Parent of Selectable Pages to Home or any subbranch. For the external URL option, use the URL fieldtype so your editors can manually enter a URL. Then in your template code, check which one has a value and use that for the link. You may want to add a showif dependency so that as soon as one field has been populated, the other one is hidden.
×
×
  • Create New...