Jump to content

Martijn Geerts

PW-Moderators
  • Posts

    2,769
  • Joined

  • Last visited

  • Days Won

    31

Everything posted by Martijn Geerts

  1. function selector() { $selects = wire("pages")->find("template=child-template, limit=2, sort=company"); return $selects; } echo selector(); // 1234|5678|9101 // this is the same: function selector() { return wire("pages")->find("template=child-template, limit=2, sort=company"); } echo selector(); // 1234|5678|9101 // this will will do the same except you bind it to a variable, so there's no real function for the function at all. $page_array = wire("pages")->find("template=child-template, limit=2, sort=company"); echo $page_array; // 1234|5678|9101
  2. You echo a PageArray. side note: If you use a variable only ones, why you need that variable at all. You could return it directly.
  3. @Craig, the text is hardly readable. browser Chrome Version 34.0.1847.131 MacOSX10.9
  4. There must be a good reason to use server-side sniffing. Until now I didn't come across a reason for this. I do think available space should be more important than the device. If you're on a mobile and link to a page that only exists on desktop do you show them a 404? And when you're on desktop but set the browser width to 400 you still want to show the desktop version? Oke, I'll stop complaining... URL segments are cachable to, so maybe you can accomplish this with those.
  5. Don't forget to set setlocale(LC_ALL, 'de_DE'); when using strftime() Is that de_DE correct for German?
  6. return $page->children(); in: Admin / Setup / Fields / Edit Field: name-of-the-field tab: Input (Selectable Pages) use custom PHP code to find selectable pages
  7. Don't you mean: how to display roles of a user ? $user->roles // returns PageArray
  8. If you want to add as-it-is, don't just an editor at all, go for the plain textarea. Most data handled with a wysiwyg editor is done clientside btw. If you want to have columns in your text, you're better of with other possibilities. I sometimes use the <hr> in the text to make columns. $out = ''; $body = str_replace('<hr />', '<hr>', $page->body); // make all rulers to <hr> $columns = explode('<hr>', $body); // create columns (array) $column_count = count($columns); if ($column_count) { $out .= "<div class='row'>"; foreach ($columns as $key => $column) { $last = ($key + 1 == $column_count) && $column_count > 1 ? ' last' : ''; $out .= "<div class='column col-{$column_count}{$last}'>"; $out .= $column; $out .= "</div>"; } $out .= "</div>"; // .row } echo $out;
  9. Those modules are purely written for this setup. You take them out of the site then they won't function. I don't see value for those in Modules section, that list should be clean. (less is more) - If you want to get insight of the working for the tabs (ProcessPageEdit::buildForm) go for Soma's TemplateNotes - For the Process module, take a look at ProcessHello (ryan's great howto do process modules ) In basic, modules are not hard to do. When you know what to hook, and you know how to get the $event object and you know how to give it back, then it's not much different from working in your templates. There are many modules around here. And in a lot of circumstances others already have done these three things for you. If you take those as starting point, you only have to write some basic PHP. Don't let the word .module "fog" your mind
  10. cstevensjr is awesome !
  11. You've to use a 'lower' hook: $this->addHookAfter("ProcessPageEdit::buildForm", $this, "example"); // From there you can find all tabs // settings tab $settings = $form->find("id=ProcessPageEditSettings")->first(); // content tab $content = $form->find("id=ProcessPageEditContent")->first(); // view tab $view = $form->find("id=ProcessPageEditView")->first();
  12. Ralf needed a parental Pedigree and I helped him to setup a very basic site. I quite liked the building of it and it resulted in doing 'to much' just for fun. I Asked Ralf if I could make it to a site profile so that someone else could profit from it to. Horse template Family Tab (Horse template) Pedigree (d3js) Unfinished Horse ( Horses created by Pagefield, but not yet edited ) Menu building /processwire Menu front-end / Download The Profile: pedigree_profile.zip
  13. if ($page->utenti->has($myuser)) ... /** * the current page with a Pagefield multiple named utenti has $myuser. * ($myuser should be User or Page) * So this depends on the selected or checked state of the field. */ so, does the Pagearray (those selected in the page) contains $myuser -------------------------------------------------------- $pages->find("template=xx,utenti=$myuser") /** * Find pages with the template named xx and pages should have $myuser in the utenti field. * */ $myuser used here will echo the ID of that Page/User. But it's actually an Object derived from Page. The print/echo of the ID is done internaly with some magic.
  14. if ($user->id === $config->guestUserPageID) { echo "i'm a guest"; }
  15. if (count($user->roles) === 1) { echo "I'm guest & guest only."; }
  16. What do you want to do here : $selects = $pages->find("template=child-template, limit=2"); // can I select here by user ID???
  17. Does: $session->login('admin', 'tralalala'); Work? (remove the tralala party with your password )
  18. Its only on in template level, but an extra set to false isn't hurting.
  19. Profile export purpose was the transition from 2.0 to 2.1. Can't you just simply copy the needed folders an make a sql export?
  20. $thumb = $image->size(142); <-- weird And if code looks cleaner, people are more willing to help.
  21. $thumb->url where do you define $thumb ?
  22. You can add a pattern to a text field, insuring your data is numerical.
  23. I do know how it works in companies regarding update policies. [ the sales department in our company still uses XP (lazyness?) ] Staying compatible with ie8 and lower is I think it's not worth the effort. Microsoft has abandoned ship and companies know. ProcessWire development slows down when IE8 support is still there.
  24. It does diogo. So there are atternatives.
×
×
  • Create New...