Jump to content

diogo

Moderators
  • Posts

    4,296
  • Joined

  • Last visited

  • Days Won

    79

Everything posted by diogo

  1. "Everything has to be a thing, even if you don't use it as a thing"
  2. Let's focus on solving the problem without making too many assumptions.
  3. You could also get the images directly from the assets/files directory with PHP.
  4. Only thing I can think of is to limit the search also by template: foreach (wire('fields')->find("type=FieldtypeImage") as $f) { foreach (wire('templates') as $t) { foreach (wire('pages')->findMany("template=$t, $f>0, include=all") as $p) { // etc... } } }
  5. Welcome to the forum Sam. I'm not sure why you are using the @ in your selectors (or is it a glitch from the forum? ). Doesn't it work when you simply leave it out? eg: R.c.count=0 Edit: I guess it's not a glitch from the forum. Just saw that you have it in the title.
  6. Depends on the strategy that you are using , but you can do this on the top of your home template: if($user == $users->get("you")) { include("alternative_home_file.php"); return; }
  7. This is easily done with a page reference field. Here is a very old video demonstrating it https://processwire.com/videos/page-fieldtype/. The field became much more complete meanwhile, but the basics are there.
  8. The sidebar is incredibly useful! Just tested it and it's really slick to edit a bunch of pages in a row
  9. If there's nothing in curated, then $curated would be an empty page array, which is perfectly fine because it would just get filled with the 4 regular inspirations. The only doubt that I have is if the import will keep the order of the pages.
  10. I would probably do it like this (not tested): $curated = $page->global_inspiration_related; $nr_of_inspirations = 4 - count($curated); $inspirations = $pages->find("parent=/inspiration/, id!={$page}|{$curated}, sort=-global_published_date, limit={$nr_of_inspirations}"); $all = $curated->import($inspirations);
  11. @dweeda here is all the info you need https://processwire.com/api/include/ @abdus the info above is the official way to do this.
  12. To go a bit deeper in what Robin explained. When you are on the last page of a level, you want the first page of the next sibling of it's parent. For this to work, you have to be actually positioned on the child page, and not the parent — you can do that by redirecting to the first child when positioned on one of the parent pages. As for the next and prev links something like this should work to get the correct pages; $prev = $page->prev->id ? $page->prev : $page->parent->prev->child; $next = $page->next->id ? $page->next : $page->parent->next->child("sort=-sort");
  13. Be sure that we are all aware of that here, it's just that newcomers don't and may take it the wrong way. I'm certain that @theoretic will appreciate your kind apology
  14. @ottogal Independently of the opportunity of this suggestion, It doesn't sound at all like @theoretic is joking, you can see that there is some thought and work in that logo either you like it or not. There's too much trolling going around the world these days, let's try to keep this little corner of ours a nice and constructive place. I'm not trying to bash you down, but please try to be a bit more explicit about what you didn't like when criticizing someone else's post. @theoretic you might want to go through this thread to get a feeling of what was already discussed about this subject
  15. You can put three links inside a div and make them squares with css.
  16. Funny, today I went to something very similar with another avatar from this forum
  17. That doesn't sound right. A page field returns a normal page array, just like a $pages->find() call, and how many pages can you possibly have selected in a page field? Are you sure this is not caused by something external to PW (e.g. server config, some external library...)?
  18. "Vanilla ProcessWire", love it!
  19. The alerts work great, every time I edit some files I get an email. Until now I've never had false positives. I don't get any alerts for database changes, and I'm not sure you can do that. Their site is in maintenance right now, so I can't check that out. The alerts are available on the free version.
  20. I have to say I find Codeguard quite amazing. Independently of which method you will chose to backup locally, it won't hurt to have an extra backup in the cloud, and Codegard does backups for one website, with one database, until 1GB, for free. ps: I mentioned it on another thread already
  21. Better yet, show us your HTML and I'll tell you how to do it.
  22. It's possible to do :nth-child(n+6) on any kind of element, it's not the element that matters but the context it is in, particularly it's siblings. If you have a bunch of <picture> elements standing next to each other, then picture:nth-child(n+6) would certainly work.
  23. I agree with Adrian, there's no point on doing this with PHP when you can do it easily with CSS. Besides, if someone loads the site on a small window, and then resizes the window, you'll have less content on a larger screen. Is your reason purely layout related, or are you trying to spare mobile users from loading content? That can also be fixed with JS, and some browsers won't even load images that are not displayed. In your code you're trying to load a PHP file with javascript. for what I see, either you have those files on the root of the site without PW code, or it won't work at all. Anyway, I strongly discourage you to load content through AJAX if only for templating purposes. Here's how you can do it with CSS: @media only screen and (max-device-width: 720px) { .articles-parent article:nth-child(n+6) { display: none; } } This would hide the last 6 posts when the screen is narrower than 720px.
  24. Thanks for your opinions @tpr. When you visited the site we hadn't still implemented the images resizing, sorry for that , the projects overview page should be much lighter now. I'm a bit surprised with the menu problem. Although it's in German, the truth is that Menü is not that different from Menu, which is quite universal, and I also think the positioning in the right-top corner is also quite standard. Anyway if it confused you, it's great that you brought it up, your idea of referring to the projects page somewhere on the homepage might work pretty well as a guidance to where to go first. We'll consider this for sure!
  25. You have many options. One is to have the pages that you don't want on the main menu as "hidden", and build the second menu by hand. Another is to make a simple menu builder, for example on the home template, with two different page fields. There are more options, but I think those two are already pretty good.
×
×
  • Create New...