Jump to content

teppo

PW-Moderators
  • Posts

    3,227
  • Joined

  • Last visited

  • Days Won

    109

Everything posted by teppo

  1. Hopefully we won't be going to 2.6 without, at least, merging some things from current dev branch to master (2.5). Just saying. New features are one thing, but there are also bugfixes there, as far as I can remember correctly. IMHO minor versions (x.x) should always be stable and contain no known bugs. Unless support for 2.5 is dropped instantly when 2.6 comes out, which I hope we won't be doing -- upgrading from one minor version to another shouldn't be required just to get bugfixes in
  2. The gelocation snippet I built earlier was purely on the frontend (JS). Didn't want to host (and keep up to date) the IP database locally, and wanted to avoid extra load and delays server-side. Drawback, of course, is that it might not work (sometimes the user just won't get redirected) and the redirect always happens after the page has been loaded (whether the delay is noticeable or not). Whatever way you go, there are still issues to deal with
  3. Looks like this could come in handy. Just recently wrote a snippet to do the same via ipinfo.io, but db-ip.com seems to be at least cheaper. Do they provide HTTPS support, or is it just plain HTTP? Didn't see that in the docs Also, is there particular reason not to use WireHttp? Mostly out of interest; probably won't matter much in real use.
  4. No worries, we've all been there. Glad to be of help
  5. @mrkhan, there seems to be a slight misunderstanding here. Your $pid isn't page ID, it's a Page. You don't need $pages->get() to grab the page, you already have it. // title of the page echo $page->page_side_menu->title; // URL of the page echo $page->page_side_menu->url; // body field of the page (assuming that it has field called body) echo $page->page_side_menu->body; // .. or, if you really want to store it in $paged first: $paged = $page->page_side_menu; echo $paged->title; See what I mean?
  6. There's no need for $pages->get() there; if your page_side_menu field is a page type field, it should already contain reference to said page. In your case "echo $page->page_side_menu->title" should be enough, though you'll first want to check that it actually has something selected. This also depends on how this field is set up, i.e. can it contain one page or multiple pages, does it return NullPage or just null when empty, etc. Check the field settings for these. .. oh, and the source of your problem is actually that if you output (echo) a Page object, which this field probably contains, ProcessWire will automatically output it's ID (see the ___toString method of Page object), but if you give it as an argument to $pages->get(), it's used in it's original object form, which probably won't work there (because it makes no sense at all).
  7. @kixe, have you seen this thread already: https://processwire.com/talk/topic/741-a-guideline-for-module-naming/? That's a good start, especially when it comes to "reserved module names", though for something like your module it doesn't exactly give any foolproof answers.
  8. Was just reminded of this module as I stumbled upon the Wild Beasts x Mattis Dovier GIF-novel. Also read an interview where the artist (at least I think it was him..) declared that GIF is making a come-back, or something. Can't really disagree after seeing the GIF-novel
  9. RT @lukew: Dear Europe,Please don't legislate away the open Web. https://t.co/ZjLBnJPwfVThanks.

  10. RT @EFF: Spain's misguided "ancillary copyright" law restricting linking has claimed its first casualty: Google News https://t.co/jdVPINv6w8

  11. Whether or not you change your mind, the issue you had is actually well explained in that puke you mentioned: you're trying to use method count() of something that isn't an object, and thus can't have its own methods. This non-object in your case is the $pages, used in a function. The reason for this is that in functions and class methods you have to use API vars with the wire() function -- wire('page'), wire('pages'), wire('session'), etc. In other words, your code should work just fine if you just replace $pages with wire('pages') You're right in that ProcessWire has built-in pagination support: https://processwire.com/api/modules/markup-pager-nav/.
  12. RT @PHPWomen: All sales go towards funding diversity initiatives for the PHP Community: http://t.co/cSqC9HLOLn #communityworks http://t.co/…

  13. RT @dhh: It's sickening to read how many place their outrage on torture because "it didn't work". SO WHAT IF IT WORKED?! IT'S FUCKING TORTU…

  14. @kixe: are you using the latest version of this module? Could you make sure that the Google Maps URL is properly embedded, i.e. on it's own paragraph in a field with this textformatter enabled, not really a link, etc.? Are there any other textformatters before/after this one? I can't seem to reproduce your issue: http://www.flamingruby.com/blog/testing-google-maps/. This is what the "view source" mode (in the RTE) for the main column of that page looks like: <p>https://www.google.com/maps/place/The+Great+Pyramid+at+Giza/@29.9797402,31.1351772,17z</p>
  15. RT @_marcusherrmann: You can now subscribe to incoming ProcessWire Recipes via RSS http://t.co/xbYgOpBinA or Twitter: @pwrecipes

  16. RT @johnolilly: This video of Wozniak is wonderful, wonderful, wonderful. http://t.co/TLxXVJl1vx

  17. RT @BigMadKev: "Why we never forget our fellow coders" http://t.co/9CVt8gSnPX

  18. Agreed with Martijn, that's probably better in most (if not all) cases. If you really want to use this module, something like this should work too: if ($page->your_field) { $value = "<p>" . $page->your_field . "</p>"; $modules->get('TextformatterVideoEmbed')->format($value); if (strpos($value, "<p>") !== 0) echo $value; } Only benefits of that approach would be having a common way to present videos on your site, and using oEmbed instead of relying on your own case-by-case embed codes. Other than that, I don't really see much value in it
  19. Horst is right, as far as I can tell, but I'd also like to point out that stacked ternary expressions are a PITA. PHP manual itself suggests avoiding them, and so would I -- not only does your first example work, it also looks better and is much easier to read than the latter one. Getting everything on one line is hardly a goal worth striving for For more details I'd suggest taking a look at http://php.net/language.operators.comparison#language.operators.comparison.ternary and specifically the part about stacked expressions, "non-obvious ternary behaviour".
  20. RT @mikko: I am happy to announce that the video of my talk in TEDxBrussels 2014 has just been released: http://t.co/s4OksozIzJThank You @…

  21. RT @_marcusherrmann: Suddenly, a wild side project of @owzim and me appears: meet http://t.co/iDjnCvIxU6, a directory of spot-on mini tutor…

  22. Sorry, just trying to get an idea of what's going on here. So far it sounds like your domains are configured correctly, or at least they work (mostly) as expected. The fact that hortonsshortuns.com is identical in content to www.hortonsshortuns.com and both versions work is a problem (for this module and from SEO point of view) but as long as you use the version that you've configured this module to use, it's not really the issue right now. Anyway, this makes me think that there could be something wrong with the Multisite module config or the page it's trying to point the user to. If you're using Soma's variation of Multisite, I don't really know anything about that (never used it), but: It might be helpful if you could post here literally how you've configured the module (every config setting and value exactly as they are on your site, either as text or screenshots)? Also, just to rule out any inconsistencies, please double-check (or triple-check, or whatever) that the related page branch is correctly named (name field, not title) and placed in the page tree below the root page, something like this: - Home - whatever - whatever - hortonsshortuns.com - whatever - whatever - ... and so on Looks like this has been way more difficult than it should've been, but hopefully we'll get this sorted
×
×
  • Create New...