-
Posts
4,296 -
Joined
-
Last visited
-
Days Won
79
Everything posted by diogo
-
"Everything has to be a thing, even if you don't use it as a thing"
-
Web designer gone; I need help changing home page.
diogo replied to AndreaPT's topic in General Support
Let's focus on solving the problem without making too many assumptions. -
You could also get the images directly from the assets/files directory with PHP.
-
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... } } }
-
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.
-
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; }
-
PW 3.0.56: core updates + Uikit admin theme updates
diogo replied to ryan's topic in News & Announcements
The sidebar is incredibly useful! Just tested it and it's really slick to edit a bunch of pages in a row -
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);
-
Next and Prev article - how to get it based on the backend structure
diogo replied to Jays's topic in API & Templates
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"); -
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
-
@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
-
How to: DIfferent links in one DIV - HTML CSS question
diogo replied to kuba2's topic in General Support
You can put three links inside a div and make them squares with css. -
-
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...)?
-
"Vanilla ProcessWire", love it!
-
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.
-
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
-
Better yet, show us your HTML and I'll tell you how to do it.
-
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.
-
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.
-
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!
-
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.