Jump to content

diogo

Moderators
  • Posts

    4,314
  • Joined

  • Last visited

  • Days Won

    80

Everything posted by diogo

  1. Yep, Luis, by looking at your code I think that this is what will happen because you defined the class outside the foreach. Like this, the variable will be populated in the first time, and will stay with that value for all the others. You can change it to this: <div class="tab-content"> <?php $i = 1; $activeClass = ' active'; foreach ($page->children as $item){ if ($i == 1) $activeClass = ''; echo "<div class='tab-pane $activeClass' id='{$item->name}'>{$item->body}</div>"; $i++; } ?> </div> or even better, do it in a more PW way <div class="tab-content"> <?php foreach ($page->children as $item){ $activeClass = ($item === $page->child ? 'active' : ''); // page->child returns the first child of current page echo "<div class='tab-pane $activeClass' id='{$item->name}'>{$item->body}</div>"; } ?> </div>
  2. Nice to know you will be sticking around, and be very welcome! You will understand why people here defend so much PW as an alternative to EE as soon as you start building your first webpage
  3. Hi Axis, glad you are enjoying PW. You can't access the templates directory by url, since it's protected by the htaccess file. What you can do, is create a css page in the tree with your css.php file as it's template and access that page url instead. wrote on mobile... can be clumsy edit: not on mobile anymore, you can see more about my answer here http://processwire.com/talk/topic/2210-help-getting-a-custom-styles-php-file-working/#entry20641
  4. Joss, that's a long story... PW was already there and hit the first place very quickly, then suddenly it went to last in only a few minutes. You can read about it here http://processwire.c...ages/#entry5671
  5. Matthew, you really need to clean your firefox...
  6. diogo

    Happy new year!

    --completely out of context-- Matthew, I noticed you use ArtRage. Have you tried MyPaint? It's great, and now there is an installer for mac.
  7. diogo

    Happy new year!

    :D Nice one Ryan! And I thought that after Josh arrived the forum couldn't become any sillier
  8. I just used rsync to backup the public files from my server to my fedora laptop and it works really well. It's comes by default in most linuxes and apparently in macs too. Have a look http://www.maclife.com/article/howtos/using_rsync_keep_your_files_sync_0
  9. Not really answering your queston, but I just tested using the tab fields on the repeaters (I imagine it wouldn't work, but was curious) and this is what happens. Ryan, wouldn't be too difficult to move those tabs inside the correspondant repeater on the module, right? If not in php, maybe with js.
  10. Some people are learning php while working with pw, I'm doing it myself. I think it would be better if things like this would be explicit on the documentation.
  11. Just used the form $a->eq(-n) to choose the element that is before the last in an array ($a->eq(-2)) and it works, but it's not mentioned on the arrays page of the documentation http://processwire.com/api/arrays/ and, naturally, neither on the cheatsheet.
  12. The modules can use jquery. Have a look at how Apeisa's thumbnails module is structured, for instance https://github.com/apeisa/Thumbnails/tree/master/ProcessCropImage
  13. Ok, just to be sure that's what you wanted. It's funny that I was thinking the same thing some days ago, and came to the conclusion that it could be done with some kind of fieldSet with a checkbox attached and that would work with jQuery hide()/show()... hm, let me see if I can explain... imagine a fieldSet field, those that you get field and a field_END where you can wrap a bunch of fields. The conditional can be on the field settings with a checkbox field, then, with javascript is easy to show or hide all the other fields. only a proof of concept of course...
  14. Can you give an example of what you want to do?
  15. You can simply put the page under admin.
  16. I don't think something like this is going to happen on the degault field, because PW doesn't make any assumptions concerning your markup or css. What you can do is copy the Inputfieldimage module and add a dropdown or radio field to it, so you have that options also with multiple images. The preview thing won't be that simple, but have a look at Nico's preview module, maybe it will be useful in this situation.
  17. Thanks for reporting @Achrist. And very welcome to the forums!
  18. Very nice Nico!! Love where you are going with this! There's a problem you might want to solve with longer usernames I understand why you put the breadcrumbs on the bottom (I usually sweep them under the sofa), but I agree with Ryan, and besides the chrome problem, it makes them a bit invisible also. What if you would bring it inside the main div?
  19. by the comments i guess i will really have to try this one
  20. Oh man, sometimes it's not easy to tell things in the forum i understood what Ryan meant, and it's actually a nice solution. Anyway, your solution is great! I was trying to do that but somehow couldn't... i guess i needed some time away from the computer. Here is the working code, it has a small correction: $pa = new PageArray(); foreach($pages->find("template=xyz") as $p){ $h = $p->images->first()->height; $p->img_height = $h; $pa->add($p);// <- you had $h here, I changed it to $p } Thanks!
  21. I meant I don't want to do it manually. This is different
  22. I guess I already knew the answer... and i am trying to avoid storing this info in a field. Not sure if I get it, I'm not trying to sort the images on the same page, I'm trying to sort pages by the height of the first image. I guess I will have to do it with some array manipulation. Thanks for the answer Ryan!
  23. Ya, that's right, I really want to do that. Is there any way to do it with a selector? I tried this but it doesn't work since this info is not stored on the db... ("sort=images.height") with this selector i do get the first image, since it is ordering alphabetically in the correct way if I remove the .height part. Well, if not I will have to play a bit with pops and shifts and all those array things...
  24. Wow, that is cheap! I'm inclined to test it even though it's outside Europe. It doesn't seem to have a DNS manager, how do you manage your domains?
  25. Mahalia was always my sole problem with the logo. If nobody including Ryan likes it, i would say it should be dropped. I think a new logo should be designed carefully (not a new logo only, to do it well it should be an entire corporate identity), but meanwhile, why not replace mahalia by a nice serifed typeface, or even a different weight of avenir? i can't see Pu for how much i look at it, and in portuguese it also means what Ryan said
×
×
  • Create New...