Jump to content

diogo

Moderators
  • Posts

    4,296
  • Joined

  • Last visited

  • Days Won

    79

Everything posted by diogo

  1. Seems ok to me, but the first answers won't make much sense then. Maybe you can edit your first post to include those tools?
  2. It doesn't. They fit perfectly together
  3. <ul id="gallery1"> <?php $thumb = $page->thumbnail->size(220, 200);//outside of the foreach so it only runs once foreach($page->images as $img) { $thumbImg = $img === $page->images->first() ? "<img src='{$thumb->url}' alt='{$thumb->description}' width='{$thumb->width}' height='{$thumb->height}' />" : ""; //if this is the first image $thumbImg gets the content. If not, it's empty. echo "<li><a href='{$img->url}' rel='prettyPhoto[gallery1]'>{$thumbImg}</a></li>"; }?> </ul> edit: The code above will throw an error if you don't have any image uploaded in the thumbnail field. You should also prevent that error by checking for it.
  4. prose.io doesn't work with the www, only without. To what do you want to change the title?
  5. There is an easy way. Although it's admittedly not as easy as the way you suggested... $config->httpHost.$page->image->url edit: and with http:// "http://".$config->httpHost.$page->image->url
  6. Better to participate now than to complain later https://docs.google.com/forms/d/1GPDA30gLd-5S8AAlZmwElS6RurOfQuWSAKqN7qMf-Io/viewform
  7. diogo

    joaovieirasantos

    Yep, I asked Joss to compose it.
  8. diogo

    joaovieirasantos

    It has been one year since I finished this site
  9. Ok, starting from the end. Put very roughly, $page represents a single page while $pages represents all pages. The methods from $page http://processwire.com/api/cheatsheet/#page can be applied to any object that represents a single page. $page, when used simply like this, represents the page that called the current template (usually by being viewed in the browser), but the $page methods can be applied to any Page object (other pages, even if they didn't call the current template). How do we get all those pages that are not represented directly by the variable $page? You guessed, using $pages http://processwire.com/api/cheatsheet/#pages $otherPage = $pages->get("/about/"); The get() method of $pages, returns always only one page. Meaning that $otherPage, is now an object equivalent to $page. Because of this, you can apply to it all the methods and call all properties of the object $page: echo $otherPage->id; While get() returns a single page, find() returns an array of pages, to be more precise a PageArray, and to those arrays you can apply any of the PageArray methods and call it's properties http://processwire.com/api/cheatsheet/#wirearray $pagesList = $pages->find("template=basic-page"); $pagesList->shuffle(); //same as: $pagesList = $pages->find("template=basic-page")->shuffle(); and because $pagesList is now a list with lots of $page equivalents inside it, you can go to each one individually and apply the same methods and call the same properties as with $page: foreach($pagesList as $individualPage){ echo $individualPage->id; } Disclaimers: I did an over simplification of the terms (same as in the cheatsheet). To make it clear: $page is a variable that holds a Page object that represents the current page. The methods I keep referring and that are on the cheatsheet, are in reality methods of Page objects, and not $page itself. The same applies to $pages and Pages. I must have some errors there because I'm far from a PHP specialist (even less concerning OOP). edit: Ryan, I saw that you answered before me, but I think to the first part. I will read now
  10. You can use the widget pages to allow the editors to define settings for each widget.
  11. look well on the second link echo $users->get(123)->email; //or echo $users->get("username")->email;
  12. Samuel, see here http://processwire.com/api/cheatsheet/#user And for getting the users http://processwire.com/api/cheatsheet/#users
  13. Create your thankyou page as a normal PW page in the tree. Then you can reference it in the api.
  14. I'm on mobile so this will be short. Empty the content of the root folder, and put the files from the processwire folder there. Keep your old files on a sub folder in the server or only in your computer. You only need them for copy/pasting. For now. Leave everything as is, and copy the contents of your old index to home.php. The result might surprise you.
  15. Welcome jqnerd! Depends on what you want. If you want to heve the processwire site appearing in the domain: www.yourdomain.com/processwire, then you should put all the files that come in the zip file, in the "processwire" directory. If you want the processwire site to be in the root domain www.yourdomain.com, you should put those files in the root directory.
  16. Choice, what do you want to know exactly?
  17. It's great that multilanguage support is becoming so solid in the core. Thanks Ryan! By the way, that seems to be a great cruise there in the screenshot, although I think the ship should continue until Konstanz (my girlfriend's family lives there )
  18. Well, I'm glad you solved it for yourself. All there's left is to say welcome and wish a great journey with PW edit: and don't be sorry for asking
  19. diogo

    Roderigo / Maryla

    Since I visited the link under his profile, Roderigo is a constant presence in my day. I see this everywhere ...not that I mind. It's much better than the usual publicity.
  20. diogo

    Roderigo / Maryla

    So why has no one ever seen you logged in together?
  21. Very bold design. Looks great André!
  22. Ok, this makes sense because (and I didn't know this) when "images" is a multiple images field {$page->images->url} returns the url to the images folder for that page, and {$page->images} returns all the file names of the images in this format (image1.png|image2.png). If there is only one image in that field it will return simply (image1.png), so {$page->images->url}{$page->images}, will logically return (/site/assets/files/1001/image1.png). This won't work if there is more than one picture in the field, because the result would be a non existing url (/site/assets/files/1001/image1.png|image2.png).
  23. The problem with the link is that I included the dot in the end. I will correct it.
  24. If your field doesn't limit the amount of images to one, you have to do this: src='{$sidebarAd->images->first->url} but if you are planning to have only one image on that field anyway, the correct thing would be to define tha limit on the filed settings and do as we told src='{$sidebarAd->images->url} I don't know why src='{$sidebarAd->images->url}{$sidebarAd->images} works... have to investigate
×
×
  • Create New...