-
Posts
4,296 -
Joined
-
Last visited
-
Days Won
79
Everything posted by diogo
-
Here http://processwire.com/tutorials/quick-start/images/
-
Try this: $allPages = $pages->find("anySelector"); foreach($allPages as $p) if($p->modified == $p->created) $allPages->remove($p); //I'm using == instead of <= because modified would never be smaller than created $allPages should hold your desired results now
-
If you will use superscripts, be aware that they can affect the height of that line. Read the solution to prevent this here http://css-tricks.com/snippets/css/prevent-superscripts-and-subscripts-from-affecting-line-height/ Another thing you can do is activate the "Insert Special Character" button in TinyMCE on the field settings. Then you just have to insert the ™ character where wanted. You'll find instructions to customize tinyMCE here http://wiki.processwire.com/index.php/TinyMCE
-
I love it how the inline mode looks like in the admin!
-
Welcome to the forum Peter I never worked with EE so I can't help you there, but there are some people here that did the jump already and I hope they will join. About the search. I can think of two ways you can change the options in the dropdown with the subcategories 1. with ajax 2. assigning everything to a variable in the head of the page in a js object and load the corresponding list whenever the the parent page is chosen on the other dropdown.
-
I looked again at the images examples on the docs and, as you told, Ryan also uses if($page->images) on a multiple images field. I tested it and, as expected, it does return true even if there is no image uploaded, making the test not very useful... Ryan?
-
not sleeping does that to people
-
On that example the field being checked has a maximum of 1 image: In this case, the field returns the image itself or false NULL (in case it's empty) instead of an array. edit: //if empty count($page->field_name) === 0 count($page->field_name)>0 === false both forms are good
-
Yep, learn as much as you can by yourself. Then, break your code in parts and solve one part at a time. Ask away as any particular problems appear in the way and we will gladly help. Soma, I counted 3km
-
An image field always holds a wireArray, wish returns true even if empty. To have a false in an if statement you want it to return false or 0. if (count($page->field_name)){ This will return 0 in case the wireArray is empty.
-
how to retrieve repeater Id and export it to JS (gallery)
diogo replied to wishbone's topic in Getting Started
This happens because "repeaterPageId" is a variable, and "#repeaterPageId a" is a string (notice that it is inside quotes on your code). Javascript has no way to know that it should use "repeaterPageId" as a variable instead as part of the string. What you would have to do here would be add the string "#" plus the string that "repeaterPageId" is holding plus the string " a" by concatenating them: $("#" + repeaterPageId + " a") // <-the space inside the quotes before the "a" is important This will result in: $("#1234 a") edit: This may be confusing when you can use variables inside of double quotation marks in PHP like echo "this $variable will work"; , but PHP has a way of knowing that $variable should be treated as a variable because of the $. So what we are doing there is exactly the same as doing echo 'this ' . $variable . ' will work'; in PHP. -
Control site CSS through a Site Settings page?
diogo replied to daniel-not-dan's topic in General Support
have a look at this post http://processwire.com/talk/topic/2210-help-getting-a-custom-styles-php-file-working/?p=20641 -
You don't have to be logged in to access the homepage of the website. You just have to put that piece of code in the home.php and visit the homepage as any visitor would. That alone will make the code work.
-
how to retrieve repeater Id and export it to JS (gallery)
diogo replied to wishbone's topic in Getting Started
<script language="javascript" type="text/javascript"> (function(window, $, PhotoSwipe){ $(document).ready(function(){ var galleryId = '<?php echo $repeaterPageId; ?>'; // <- the quotation marks were missing here console.log(galleryId); // <- I assume here you want to log "galleryId" and not "repeaterPageId" var options = {}; $("#galleryId a").photoSwipe(options); // I'm confused, do you have an HTML element with the id "galleryId" in your code? }); }(window, window.jQuery, window.Code.PhotoSwipe)); </script> I corrected two things in your code that were definitely wrong, but even with them corrected I don't really understand what's going on there because your not really using the variable that you defined with the help of PHP. What you are using that seems similar, is this element "#galleryId", but this is not the same thing, because "galleryId" is a javascript variable while "#galleryId" is the way that jQuery calls the id of an html element. Two completely distinct things. -
the value of a repeater is pageArray, so getNext() should work. What value are you using as the parameter? Edit: Ok, quickly tested, and everything works as expected. I will post here my test so you can analyze and make sure that you are using it the right way: $repeaterArray = $page->repeater; $firstElement = $repeaterArray->first(); echo $repeaterArray->getNext($firstElement); //returns successfully the second element echo $firstElement->next(); //also returns the second element
-
Create the structure exactly how you want it in the admin tree and the URLs will follow the same logic, from there you can easily build the menus. For this have a look at this module http://modules.processwire.com/modules/markup-simple-navigation/ Plus, don't only read the links that Joss pointed to. Spend some time following them and try to build those sites yourself before starting to work on your own.
-
Tip (you likely knew already) about the setting $config->debug = true;
diogo replied to alan's topic in General Support
Thanks for the tip Adam -
Depends a lot on how the book is written. I really don't like those books that assume that you are reading them in front of the computer. I avoid them like the plague Of course it's good to test things, but if the book is well structured (IMO) You can do it after each chapter for example. Larry Ullman books are great in that matter.
-
I can also say that the pw website I have on all-inkl.com runs smoothly and without a problem.
-
Soccer? What's soccer?? edit: just to clarify. I don't think you have to understand them right away. But I think that, by the time you are already doing a review, these concepts should be already clear. Anyway, I don't want to pick on @Tyssen, as it's a nice review regardless.
-
Can anyone like a post of mine? 666 is evil edit: thanks Wanze
-
== json == txt == xml == png == ttf == js == css == anything
-
I honestly don't understand the confusion with pages. When everything are pages, that's really all you have to know. Couldn't be any simpler...
-
How much time per day do you spend looking at the light of the screen? I would guess too much... I prefer to stay away from it as much as I can, and reading on paper is great for this. Plus, you can do it on a coffee table outside or on a bench by the river Now I bought a kobo e-reader. With the e-ink technology It really feels like paper and I recommend it to everyone.
-
I'm interrupting my vegetative state on the forum to say that I went for Linode after my last message ("I'm not a forum kind of person" ) and I'm very happy with it. I still have the 19.95$/month where I keep three production websites and all my experiments and developing stuff. Never had a single problem and learned a lot in the way.