-
Posts
4,314 -
Joined
-
Last visited
-
Days Won
80
Everything posted by diogo
-
You don't have to put it in a function, you can as well just put all this inside a if statement <?php if (condition) : ?> <form id='search-form' action='<?php echo $config->urls->root?>search/' method='get' class='hide-for-small'> <div class="row collapse"> <div class="small-9 columns"> <input type="text" name="q" value="<?php echo $sanitizer->entities($input->whitelist('q')); ?>" placeholder="" /> </div> <div class="small-3 columns"> <button type='submit' class="button prefix">Search</button> </div> </div> </form> <?php endif; ?> or, if this complicates the code on that template too much, you can have have it exactly as it is in a file, and include it from inside the condition. if (condition) { include('form.inc'); }
-
But to resume all that reading "a page is not a page", it's an object within a tree structure (just as in json) with a URL (that can be available on the website or not)
-
http://processwire.com/talk/topic/2875-favorite-programming-music/?p=32631 I'm drinking a coffee made with the Aeropress for the first time right now, I must say it's really tasty
-
For those interested, this one http://zedapp.org/ that works as a chrome app and is a quite an interesting project.
-
A different way of using templates / delegate approach
diogo replied to Soma's topic in API & Templates
Mike, thanks for clarifying. -
Just teasing you guys http://atom.io/
-
Hi vigilante, welcome to the forum! There is a blank profile http://modules.processwire.com/modules/processwire-blank-install/ A site like this will be more complex to build with any tool. If pages are very different, one way is to have almost a template per page. if there are things in common, you can use the same template and use includes or functions on a common file. If the differences are minimal, you can do simple checks inside your templates for the page ID or any other characteristic this page may have that differentiates them from the others (a field. or the person that is looking at it, or the language, or whatever) You write it on template files, but has I told above, you have to be a bit clever about doing it. If the site really asks for it, either because of each page needing different fields, or because the code just need to be too different for each page, you can also go the 1 page / 1 template route of course I've seen that Joss and Kongondo also answered already, but still didn't see their answers. I bet they are loooooooooooooooong!!!! edit: I was right about Joss. Kongondo is not in a good shape today
-
Yep, but I wasted already too much time with this when it came out, so I won't even click the link
-
You're too fast. I had just edited my post
-
even shorter if(in_array($page->id, [1010, 1011, 1022])) echo $pages->get("1114")->body"; Edit: only in PHP 5.4
-
I didn't know this one Shortest way to echo a variable only if populated (using pw fields of course ): echo $page->field?:''; and: echo $page->field ?: "field is empty"; // echoes field content echo $page->empty_field ?: "field is empty"; // echoes "field is empty" or even: echo $page->field1 ?: $page->field2 ?: "they are all empty";
- 23 replies
-
- 18
-
-
Hi guys, this one comes a bit late since it was published already some time ago. It's the website for a charity in Sollihul. http://www.madhatterscharity.com/ We wanted to do something fun and appealing to both children and adults, and came up with the idea of simulating handwritten type and pen drawings (created by us) on a rough cardboard, and using different colours for each page. The site is responsive, of course More about this work on our website http://www.milktop.co.uk/projects/mad-hatters-tea-party-charity/ And a short post about the drawings http://www.milktop.co.uk/news/mad-hatters-tea-party-the-making-of/
-
Just stumbled upon this: http://typequest.org/ Type in web is maturing! --- ps: I will watch Porto playing against the club from my second city now
-
Single-site license question: what about localhost?
diogo replied to nickie's topic in Modules/Plugins
Welcome to the forums nickie. What is the module you are referring to? The licenses are different from module to module. The ideal would be to ask this question on the module's own support page. There aren't many commercial modules though, and three of them are from Ryan, and if you purchased them, you must have received the links to their support forums. The other one that I know of is minimize.pw, if that's the one, maybe you can ask in their announcement post http://processwire.com/talk/topic/5404-processimageminimize-image-compression-service-commercial/ -
For files, check the $_FILES array instead.
- 1 reply
-
- 2
-
-
$angebote = $pages->find("template=travelCat, id!=123|156|736, sort=sort");
-
Well, it's not that simple. You also have the files that ProcessWire creates like images, logs, sessions, etc. So you would have to make sure you keep those in sync also.
-
I'm a bit confused by the title of the thread... so, you don't want it hardcoded right? What you seem to be asking is very easy with the new multi-language fields http://processwire.com/api/multi-language-support/multi-language-fields/ This post from Phillip and subsequent answers might also be useful for you http://processwire.com/talk/topic/5518-multi-language-site/?p=53784
-
-
Adding pagination after merging two PageArrays?
diogo replied to landitus's topic in General Support
I tried with more than 5000 IDs and it worked (they were the same IDs repeated, but I don't think it makes a difference) Edit: With 8000 still works, but with short more than that it breaks Edit2: false alarm, it was a mistake in my code. With more than 25.000 IDs it takes long but still works. With much more than that it doesn't, but I'm guessing it's because of PHP time limit. Edit3: "Maximum execution time of 30 seconds exceeded" -
Adding pagination after merging two PageArrays?
diogo replied to landitus's topic in General Support
hm, not sure... is it? -
Adding pagination after merging two PageArrays?
diogo replied to landitus's topic in General Support
I like this solution: $events1 = $pages->find("template=event, date>=today"); $events2 = $pages->find("template=event, date<=today, date_end>=today"); $events = $pages->find("id=$events1|$events2, sort=date, limit=15"); // now you can paginate $events