-
Posts
4,296 -
Joined
-
Last visited
-
Days Won
79
Everything posted by diogo
-
Here is your one liner, but I wouldn't advise you to use it: if($imageUrl = $pages->get("/bxslider-pictures/")->images->get("name=hill.jpg")->width(200)->url) echo "<img src='$imageUrl'/>";
-
Does your hosting service charge per line?
-
You can also try $pages->find("parent=/about-us/") and $pages->find("parent=/about-us/, include=all") just to see what you get
-
Isn't that page set to "hidden"?
-
If someone asks someone in a language that is other than English, we usually ask to stick to English, but I don't think we are inflexible with it. I would say, if you have a concrete question, try to ask in English, also because it will raise the chance that someone will answer, but if it becomes too difficult for you to understand or express the doubt it's ok to mix a bit of dutch in between. We have enough Dutch people here to understand it, and probably the German(ic)s will also
-
Commented already on the video, but I'll say the same here. To prevent having the site down while moving the new files to the server, it's better to rename the new wire folder to "newwire" and do the switch only after all the files are moved.
-
And this can be easily removed. Any field can be or not required, title just comes as default.
-
Wait until Soma reads this and you'll have one more
-
That sudden sound made me nervous. Your website is totally NSFL (not safe for libraries) My first reaction was to press the bandolin with the bomb, but the effect of pressing several times on the other one is far more interesting
-
Simple but nice for small debuggings https://chrome.google.com/webstore/detail/vardumpling/aikblkmigebodlhkdepmfmgdgmbokkdn?hl=en&gl=US
-
Think of that home page as an aggregate of several pages on a "normal" website: In that case you would have something like this on the processwire tree: Home My work Aftershock Beyond Outrage .... Television appearances Colbert report, nov 2013 Daily Show, sep 2013 ... Posts Raising Most People’s Wages Why Ordinary People... ... etc Then, with the API, you can easily target those parent pages and display their children in your HTML structure. You need to know how to structure templates, fields and pages and learn the API You need to understand that in PW everything are pages, and pages are not necessarily representations of "viewable website pages" Consider going through the tutorials here http://processwire.com/docs/ Ahem! You don't need a framework to do something as simple as three columns. You can of course, but you don't have to. And welcome to the forums
-
Getting my head around the intermediate default profile
diogo replied to Russell's topic in Getting Started
I also tend to the "direct output". If I'm writing HTML, I prefer to see the HTML. On the other side, one day I want to build an entire website only by using PHPs DOMDocument http://runnable.com/VCkzbk2_lq8s39vR/domtest-for-php By the way, that runnable.com site is great! -
Google forms are great https://docs.google.com/forms/d/1Mb1wReBKt7QR1CDmxNlaHTBJ03x6UVvXoLKQ0pxsMWw/viewform
-
As I said here https://processwire.com/talk/topic/7728-module-firststeps/?p=74939 I think Blad's module would be perfect for showing around to our clients much more than new developers or designers. For those, Nico's is better because it shows the right places to learn. EDIT: hey, what happened to the link? This forum is crazy sometimes...
-
I don't think developers need something like this (I would be annoyed at least), but it's a perfect solution for showing clients around! I would focus on that, making the module completely configurable so the developer can prepare a nice presentation of the interface once the site is finished. I would use it for sure
-
Don't repeat data, connect it. I don't have time to go deeper than this now, but the post that Ivan linked to is very clear and easy to follow, give it a read and you will understand what I mean.
-
That's true, but not inside PW
- 206 replies
-
- 3
-
- standarisation
- templates
-
(and 1 more)
Tagged with:
-
I don't think anyone would miss the menu in this case, it clearly says "menu" on the menu button. All recommendations have to be taken with a grain of salt, let's not all become guardians of the "correct way" and start designing all websites in the same way.
-
Stuck with $pages->get("/path/to/page/") inside <a href=""></a>
diogo replied to pwired's topic in API & Templates
Please think for 5 seconds before posting! You are opening a php tag inside a php tag. Joss suggested you do that because you weren't clear if you were doing this inside or outside a php tag. You have two choices: <!-- Outside the PHP tags--> <div id="button3" class="button_style"><a href="<?=$pages->get("/kontakt/")->url ?>">kontakt</a></div> or <?php // inside the PHP tags. You are using single quotes, so you can't echo variables without closing them echo '<div id="button3" class="button_style"><a href="' . $pages->get("/kontakt/")->url . '">kontakt</a></div>'; ?> -
You need to study more, escaping the quotes comes explained in the first chapter of any php book
-
Unrelated to the question, but just to say that you can do: <?php $navigation = $pages->find("parent={$page->parent}");?> Edit: or even: <?php $navigation = $page->siblings; ?>
-
prev / next based on previous page's pageArray
diogo replied to formulate's topic in API & Templates
I manage to find a way, but it's highly untested, and would have to be worked upon. Hope it's understandable: if($session->selector) { // selector string resulting of the user selection, has to be in session // in the first time we need all the pages that were linked on the base page // after that we need only 3, the current page the previous and the next // we know if it's the first one if $session->start is not defined $limit = $session->start ? "3" : "10"; // if $session->start is not defined we want to start with the first item $start = $session->start ? $session->start : "1"; // for the pageArray $array = $pages->find("{$session->selector}, start={$start}, limit={$limit}"); $prev = $page->prev($array); $next = $page->next($array); // if there isn't session->start, give it the index of the current page in the array if(!$session->start) $session->start = $array->getItemKey($page); // if former page was the previous, add one to $session->start if($session->page === $prev->id) $session->start = $start + 1; // if former page was the next, subtract one from $session->start if($session->page === $next->id) $session->start = $start - 1; // store this page ID in $session->page to compare next $session->page = $page->id; // echo the prev and next links echo "<br><a href='" . $prev->url."'>Prev</a>/<a href='" . $next->url . "'>Next</a>"; } // at some point in the other templates would be good to unset $session->selector with $session->remove("selector") Edit: without the comments it's less scary Edit2: forgot the $session->selector, already added it if($session->selector) { $limit = $session->start ? "3" : "10"; $start = $session->start ? $session->start : "1"; $array = $pages->find("{$session->selector}, start={$start}, limit={$limit}"); $prev = $page->prev($array); $next = $page->next($array); if(!$session->start) $session->start = $array->getItemKey($page); if($session->page === $prev->id) $session->start = $start + 1; if($session->page === $next->id) $session->start = $start - 1; $session->page = $page->id; echo "<br><a href='" . $prev->url."'>Prev</a>/<a href='" . $next->url . "'>Next</a>"; } -
prev / next based on previous page's pageArray
diogo replied to formulate's topic in API & Templates
I think so. Usually prev/next work in time sequence and ignore the page where you came from. -
You can change that number depending on $(window).width()