Jump to content

dragan

Members
  • Posts

    2,007
  • Joined

  • Last visited

  • Days Won

    21

Everything posted by dragan

  1. dragan

    PW Review

    Well, that's easy to spot: For some reason there's a margin-left override: @media (min-width: 1200px) { .uk-grid-large { margin-left: -70px; } } default being -40px or... make the body background color white ?
  2. oh, and for accessibility's sake, don't jump over heading hierarchies, i.e. don't use an h4 right after an h2. Use h3 instead. https://www.w3.org/WAI/tutorials/page-structure/headings/ Plus, I'd suggest to place your anchors inside h2, not outside.
  3. I guess what you want is: $planet->planet_foto->httpUrl instead of prepending url it with $_SERVER['SERVER_NAME'] ? (not sure)
  4. You have defined this field as editable in the frontend. Check the field settings in tab "input" at the very bottom. Only logged-in PW admins with the necessary rights see these additional tags.
  5. I don't recall ever having seen this particular error, but I suggest you hit the "clear compiled files" button every once in a while. (at the very bottom of the modules overview page, where it says: "The button below clears compiled site modules and template files, forcing them to be re-compiled the next time they are accessed. Note that this may cause a temporary delay for one or more requests while files are re-compiled.")
  6. I would try to upgrade PW. If that doesn't solve it, switch to PHP 7.1 locally and see if the error persists. Is this only in debug mode or also when disabled? Backend is fine?
  7. If that's indeed the case: To avoid this, in your pageref field definition, use "selectable pages" > "selector string" and then insert this condition: id!=page.id to avoid references to itself.
  8. Wow. It's 2019 and people are still using this? @neonwired please read this: https://stackoverflow.com/a/1293130
  9. Is this field set up to only accept one image or multiple? And what did you define in the output settings? (single image or multiple, string or array) You would use this if you only allow one single image. But in your screenshot I see multiple images. In that case, you would rather use something like $page->headimage->first()->url to get the first image only.
  10. Actually, I just tried out your code, but got this error: Exception: Call to a member function add() on boolean on line: 13 line 13 is $selected_page->page_field_b->add($p); o_O
  11. Nice use of AJAX. Speeds up page loading to nearly instantly.
  12. With similar, do you mean simply replacing field A and B? Or would I have to do some addtl. checks or queries? In my case, I have much more existing items where B was populated, before field A was even created...
  13. one-to-many would look something like this if($input->urlSegment1) { $seg = $sanitizer->name($input->urlSegment1); if($seg === 'clinics') { $loc = $page->name; } $clinics = $pages->find("template=clinic, location=$loc"); foreach($clinics as $clinic) { $content .= "<p><a href='{$clinic->url}'>{$clinic->title}</a></p>"; } } e.g. a location can have multiple clinics
  14. I was assuming you only have a one-to-one relationship when I quickly wrote this, so you'd probably have to slightly alter this basic code: if($input->urlSegment1) { $seg = $sanitizer->name($input->urlSegment1); if($seg === 'clinic') { $loc = $page->name; } $clinic = $pages->get("template=clinic, location=$loc"); $content .= "<p><a href='{$clinic->url}'>{$clinic->title}</a></p>"; }
  15. Hello @kkalgidim and welcome to PW. Do you use a page reference field to map a clinic to a location?
  16. @B3ta I'm not sure if Hasura would be a good candidate; apparently it runs on PostgreSQL (after a quick glance).
  17. @Peter Knight Alright, I found the code-bit I mentioned before:
  18. It's actually not that hard to customize it via CSS. I posted some example code in the forum some time ago, but can't find it right now... Also, maybe check out this thread:
  19. With all the hype around headless CMS, maybe a new GraphQL module? The only one we already have, uses an abandoned PHP library, and is much too slow for productive use imho.
  20. Perhaps this will help? Oh, and welcome to the forum! ?
  21. This is really just a quick'n'dirty script, but I guess it should keep you going... $userlang = $user->language->name; echo "$userlang <hr>"; $g = $page->gallery->sort('tags'); // all images, sorted by tag (just for debugging) echo "all: <br>"; foreach($g as $pic) { echo "{$pic->tags} {$pic->url}<br>"; } echo "<hr>"; $g = $page->gallery->find("tags=$userlang"); // only images having current user language tag echo "userlang: <br>"; foreach($g as $pic) { echo "{$pic->tags} {$pic->url}<br>"; } $g = $page->gallery->find("tags!=$userlang"); // only images NOT having current user language tag echo "NOT userlang: <br>"; foreach($g as $pic) { echo "{$pic->tags} {$pic->url}<br>"; }
  22. Yes it would. In the link I posted you'll find some hints. But of course you would have to adjust code to your specific setup. Maybe I'll post some example code later (have to hurry now).
  23. There's lots of forum posts with hooks (see my 1st sig link)... here's a bunch of them: First link there is the official docs.
×
×
  • Create New...