Jump to content

diogo

Moderators
  • Posts

    4,296
  • Joined

  • Last visited

  • Days Won

    79

Everything posted by diogo

  1. <?php $features = $pages->find("template=portfolio, limit=4, sort=-date"); foreach($features as $feature) { $thumb = $feature->thumbnail ? $feature->thumbnail->size(244,244)->url : "[url to the placeholder]"; // if no thumbnail, replace by placeholder echo "<li>" . "<a href='{$feature->url}'><div id='explore_thumb'><img src='{$thumb}'></div>" . //changed from $thumb->url to only $thumb "<h3>{$feature->title}</h3>" . "<h4>{$feature->summary}</h4></a>" . "</li>"; } ?>
  2. Pete, add this line to the code: InputfieldTinyMCEConfigDefaults.content_css = "<?php echo $config->urls->adminTemplates; ?>themes/ergo/content.css";
  3. As anyone used ie7.js http://code.google.com/p/ie7-js/? it supports :first-of-type and :last-of-type
  4. The problem wasn't with "ergo". I was trying with the default skin, that gets the icons on "img" directory that is above.
  5. With me it's messing up the icons, beause the stylesheet is looking for them here "../../img/icons.gif". They are not there, of course... edit: works well if you put the "img" folder also inside "templates-admin". I agree that it's a much better solution!
  6. I agree that in most situations having a different skin doesn't justify these changes. But the truth is that this solution doesn't touch the core or even the module. Those two lines would go on the theme's template, and the new tinyMCE folder would go on the theme's folder. It would be completely up to the theme maker to decide if changing the skin has that kind of importance to the theme or not.
  7. There's no need to change anything on the module. Everything can be done inside the theme, by putting a copy of the tinyMCE folder (with the new skin inside) on the theme folder, and changing Soma's code to this: <script> if('undefined' != typeof tinyMCE){ InputfieldTinyMCEConfigDefaults.skin = "ergo"; tinyMCE.baseURL = "<?php echo $config->urls->adminTemplates?>/tinymce-3.4.7"; } </script> The version number can be changed to <?php echo InputfieldTinyMCE::TinyMCEVersion?>, or any better way to get this constant (i'm sure there is) I don't seem to find any nasty effect with this. What do you think? EDIT: ok, there is at least one nasty thing... the "html" button doesn't work because PW doesn't allow accessing html files inside /templates-admin/
  8. What if Ryan would make all the tinyMCE folder portable with the theme? Would be possible just by changing this line: $this->config->scripts->add($this->config->urls->InputfieldTinyMCE . "tinymce-" . self::TinyMCEVersion . "/tiny_mce.js"); to this: $this->config->scripts->add($this->config->urls->adminTemplates . "tinymce-" . self::TinyMCEVersion . "/tiny_mce.js"); on the render function of the module EDIT: there's a better solution on the next post
  9. Looking great! Will try it later for sure. Have you seen the thread about defining the tinymce theme on the theme itself? (I'm on mobile. Can't link to it). If you use it by testing for the existence of the folder, people can install the theme only by dropping it on the right folder.
  10. You should think if repeaters are the best way of achieving what you want. In this case, I suspect that it would be better to create each project as a child of a "projects" page. But I will answer your doubt anyway. Its not much different then doing the same with other kinds of fields. But, like with images, the field return a page array that you have to iterate with a foreach() Taking the example on the repeater fields docs http://processwire.c...ypes/repeaters/ (is this one that you were talking about?) foreach($page->buildings as $building) { echo "<h2>{$building->title}</h2><p>"; echo "Height: {$building->feet_high} feet, "; echo "Floors: {$building->num_floors}, "; echo "Year built: {$building->year_built} </p>"; } Notice that it's not that different from your example, and all the html is being echoed from inside the foreach. The same example can be also written with this alternative sintax, if it makes it more clear for you: <? foreach($page->buildings as $building):?> <h2><?=$building->title ?></h2> <p> Height: <?=$building->feet_high ?> feet, Floors: <?=$building->num_floors ?>, Year built: <?=$building->year_built ?> </p> <? endforeach; ?> You just have to adapt it to your html code. In your case I can imagine something like this: <? foreach($page->projects as $project): ?> <h3>project name</h3> <p><?=$project->name ?></p> <h3>project budget</h3> <p><?=$project->budjet ?></p> <h3>project description</h3> <p><?=$project->description ?></p> <? endforeach; ?>
  11. Tried to reproduce your error with Ryan's code with "users" as the field name, and everything works fine...
  12. Didn't think that $user refers directly to the user page. But ya, it makes sense...
  13. With the page type field, you have to use the page object itself and not the ID. Assuming that you are using the "Users" pages under "Access" for the field, this should work: $u = wire('pages')->get($user->id); //get the user page $transacties = wire('pages')->find("template=transaction, users=$u"); edit: funny, In Portuguese balance check is also "Saldo"
  14. What type of field is "users" in the "transaction" template? And how is it populated? Edit: I'm wondering if this is what you are looking for: $transacties = wire('pages')->find("template=transaction, created_users_id=$user->id");
  15. You will have an idea of how powerfull PW's approach is when you start building your templates. I can give you some simple examples based on that tree: // you're on the homepage and want to display all the wines: $wines = $pages->find("template=wine"); // could also be $wines = $pages->get("/wines/")->children; echo "<div class='wines'>"; foreach($wines as $wine){ echo "<div class='wine'>"; echo "<h2>" . $wine->title . "</h2>"; echo $wine->bodycopy; echo "</div>"; } echo "</div>"; // you're on a wine page and want to display all the reviews: $reviews = $page->children; echo "<div class='reviews'>"; foreach($reviews as $review){ echo "<div class='review'>" echo "<h2>" . $review->writer . "</h2>"; echo $review->bodycopy; echo "</div>"; } echo "</div>"; // display a random testimonial on the homepage: $testimonial = $pages->get("/testimonials/")->getRandom; echo "<blockquote>" . $testimonial->quote . "</blockquote>"; echo "<cite>" . $testimonial->author . "</cite>"; // a list of events that take place in the garden of the winery, by descending date: $events = $pages->find("template=events, place=garden, sort=-date"); //and so on... edit: made the code a bit more clear, and corrected one variable
  16. The tree for this site could be something like this: -home --wines ---wineA ----reviewA1 ----reviewA2 ---wineB ----reviewB1 ----reviewB2 --testimonials ---testimonialA ---testimonialB --events ---eventA ---eventB Hope you can take some sense out of it. Take some time to study the API (have also a loot at the Cheatsheet), go through this small project walkthrough, and have a good look at the default install site. Ask any question here in the forum, I'm sure people will gladly help
  17. I guess my javascript readings are paying out edit: hm... or should I say "paying off"?... maybe I should also do some reading on how to write English correctly
  18. Wow, tried this and it worked <script> InputfieldTinyMCEConfigDefaults.skin = "default"; </script> put it on the default.php of your theme after all the other scripts or before </body>
  19. Offtopic: Landitus, just to notice that the correct translation from "Atención al cliente" from ES to PT would be "Atendimento ao cliente" and not "Atenção ao Cliente"
  20. Still didn't read the article, but the xkcd comic it links to in the beginning is great http://xkcd.com/327/
  21. I think it's great! And I hope some flaws can be found by doing this. It's a bit scary to think that someone alone has built such a perfect piece of software. If some flaws are found, I can sleep a bit better Ok, now seriously. It's great that someone can confront Ryan with other perspectives. Maybe in some cases, Ryan won't have a good answer and will think better about it. This can only make PW as good as it can get.
  22. I don't think I will be contributing for the PW core in the near future. But would be nice to have some documentation on coding standards for those who will. Something like this: http://dev-docs.fuelphp.com/general/coding_standards.html
×
×
  • Create New...