Jump to content

adrian

PW-Moderators
  • Posts

    10,912
  • Joined

  • Last visited

  • Days Won

    349

Everything posted by adrian

  1. Take a look at: https://github.com/ryancramerdesign/ProcessWire/blob/7b9730d43e6eda8bd27841a4811a1b9737bfe903/wire/core/Pageimage.php#L152 That is where the image dimensions are coming from. It is using the standard php getimagesize function. Unless you are uploading an SVG without width/height attributes, it should work fine if it is a legitimate image. I am actually just putting together a PR for sorting out the SVG image width issue and will send to Ryan tomorrow. Can you try inserting a debug statement in the getImageInfo function to check the filename it is working with is correct and to see whether $this->imageInfo is getting populated at this point. Also, can you explain your custom image upload - can you show us the code you have for it?
  2. Hi prototype and welcome to PW! What you are looking for is the PageTable fieldtype. It is in the core, but not installed by default, so go to Modules > Core and scroll down to ProFields: Page Table and install it. Even though it is tagged as a ProField, it is free and included by default with PW. Unfortunately we don't have any proper docs for this new fieldtype yet, but there are some good snippets of info throughout the forums: https://processwire.com/talk/topic/6546-pagetable-documentation/ https://processwire.com/talk/topic/8177-page-table-howto/ You should also take a look at the excellent extended version of it: http://modules.processwire.com/modules/fieldtype-page-table-extended/ Really opens up lots of great opportunities. Dive in and let us know if you need any specific bits of help.
  3. Just committed a small, but I think quite useful option. You can now choose to replace the SVG thumbnail in the admin page edit view with a rasterized version - primarily for speed of display. All the details about the image will still refer to the original SVG, and viewing the full sized version (in the lightbox) will still be the SVG. The reason I added this is that on one site we have been uploading many very complex SVGs and using the rasterize() API method to display them on the site. We still want the originals to be in SVG though so that resizing results in no loss of quality, and also so we can offer the SVG as a downloadable version. The problem was that during page edit, the SVGs were taking too long to render in the browser. Hope this helps others too.
  4. So I think what you are saying is that you need a different format for your site links (that is what google calls these links to sub pages). Not sure of the rules on this, but in my experience change the order of your title tag so it reads: About | Marinus de Beer - Spatial Design Using the pipe vs the dash is probably not critical, but I prefer it. Google should grab the "About" from that and use it for the site link for the about sub page. You should also make sure you have a sitemap.xml and register it with google webmaster tools. Remember that you won't see any changes in google's results until it reindexes your site, which could take hours to weeks depending on your site. Having all the pages of your site available in a sitemap.xml will help with this considerably. Here are a couple of links that might be worth reading (not really read thoroughly myself): http://honestppc.com/adding-sub-links-sitelinks-results-google-search/ https://support.google.com/webmasters/answer/47334?hl=en https://www.hochmanconsultants.com/articles/sitelinks.shtml
  5. 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
  6. 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/
  7. 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.
  8. 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?
  9. 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!
  10. 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.
  11. 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.
  12. 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.
  13. I think this module from Martijn will do what you are looking for: http://modules.processwire.com/modules/textformatter-image-interceptor/
  14. 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.
  15. @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!
  16. 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
  17. 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]
  18. 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.
  19. 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
  20. 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.
  21. 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.
  22. 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.
  23. 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;
  24. 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
  25. 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/
×
×
  • Create New...