Jump to content

Soma

Moderators
  • Posts

    6,798
  • Joined

  • Last visited

  • Days Won

    158

Everything posted by Soma

  1. Verleser des Tages: "Feuchtgelb".

  2. I also recognized that daytime fields in pw once set and saved then cleaned again it saves the field with the 1970 date. This is like 0 timestamp. It is ok when using in api but when directly queried from db you get the date so you have to take care of those. This is clearly a pitfall and should be fixed. I think I even reported this long time ago on github but not sure anymore.
  3. Yes it does work with PageListSelect and everywhere you see the page tree (naturally).
  4. RT @ryanscherler: I am still constantly surprised how easy things are to build in @processwire #cms

  5. Sorry you didn't get any responses there, but time is limited One way is set user language to the one you want to set the label. Or using the language id to append to "label{LID}" $f = wire("fields")->get("mytextfield"); $lang = wire("languages")->get("de")->id; $f->set("label{$lang}","Mein Textfeld"); $f->save();
  6. Or you could use my ImagesManager module to centralize images. Then use a select to add them to pages. Images are saved as a page. Look in the forum as it's not in the modules repository.
  7. $fs = $template->fields->get("fieldsetfieldname")->children;
  8. Soma

    parentmost

    Look no further http://cheatsheet.processwire.com/?filter=eq
  9. Soma

    parentmost

    If Events all have the same template it would be Which would be the same as $parentmost = $page->parents->eq(2); or $parentmost = $page->parents[1];
  10. ....or simpler version using a "dummy" page array that searches the same pages but not actually sorting, just for the the pager. $limit = 4; $sql = "SELECT id FROM pages INNER JOIN field_mydate ON field_mydate.pages_id = pages.id WHERE status < 2048 AND templates_id = " . $templates->get("basic-page")->id . " ORDER BY DATE(data) DESC, TIME(data) ASC LIMIT " . (($input->pageNum-1)*$limit) . ",$limit"; // run query $res = $db->query($sql); // output events while($row = $res->fetch_array()) { $event = $pages->get($row['id']); echo "<p><a href='$event->url'>$event->mydate | $event->title</a></p>"; }; // generate pager navigation using dummy array $dummies = $pages->find("template=basic-page, mydate>0, limit=$limit"); echo $dummies->renderPager();
  11. Yeah it's not actually simple. An approach would be to create pager manually using the core PageNav class. $limit = 8; $sql = "SELECT id FROM pages INNER JOIN field_mydate ON field_mydate.pages_id = pages.id WHERE status < 2048 AND templates_id = " . $templates->get("basic-page")->id . " ORDER BY DATE(data) DESC, TIME(data) ASC LIMIT " . (($input->pageNum-1)*$limit) . ",$limit"; // run query $res = $db->query($sql); // output events while($row = $res->fetch_array()) { $event = $pages->get($row['id']); echo "<p><a href='$event->url'>$event->mydate | $event->title</a></p>"; }; // generate pager navigation manually include($config->paths->MarkupPagerNav . "PagerNav.php"); $total = $pages->count("template=basic-page, mydate>0"); $pager = new PagerNav($total, $limit, $input->pageNum); $pagerMarkup = ''; foreach($pager as $link) { $class = $link->pageNum == $input->pageNum ? 'on' : ''; // is it the current page? if($link->type == 'separator') $item = '…'; // is it a separator else $item = "<a class='$class' href='{$page->url}page{$link->pageNum}/'>$link->label</a>"; // or a normal link $pagerMarkup .= "<li>$item</li>"; } // output pagernav echo "<ul class='pagernav'>$pagerMarkup</ul>"; Taken from one of my examples: https://gist.github.com/somatonic/5420536
  12. RT @processwire: Field dependencies are coming to ProcessWire 2.4. Here's more about it and a video preview: http://t.co/glRjMsP9BI

  13. I just watched the video at home (damn mobile won't let me). Amazing feature to have! Watching this I think the "required" need to be more visible or red (asteriks). It can be missed too easily. And the show animation need to be much quicker! (lol) Not can we have also a hideIf() and a makeCoffeeIf()... I already see the forum full of posts "It doesn't show when..."
  14. But now you can install modules with the core install already, so first thing you could do is click "new" and enter ModulesManager and download/install, done.
  15. Add novalidate to the form attributes and theyr gone.
  16. RT @jalajoki: I've used #processwire #cms for two hours now and already writing my first module :)#webdev

  17. post_max_size and upload_max_size isn't an option as it wouldn't allow for multiple files and also upload would fail silently. But there's a maxFileSize on file fields, it's not I'm not sure why it's not in the field settings. ... else if($this->maxFileSize > 0 && $size > $this->maxFileSize) { ... I guess it can be set via a hook and you could try setting it to a reasonable size. Sorry, actually it's in teh WireUpload class and not the file field. But anyway it's there for a reason. And it's also maxFilesize in the file inputfield, but it checks for the php post_max_size to get the max size, and this is for all files in a multiple file field.
  18. There's no variations for files (non images) or is it? I don't think you can resize pdf's.
  19. RT @hansdesmedt: @processwire you amazed me! As a #cms so simple yet so powerful. #robot

  20. So there's a ton of functions and filter but auto-levels http://www.imagemagick.org/script/command-line-options.php#auto-level there's nothing in GD? ...
  21. It's the same, as image field is just extending file fieldtype.
  22. There is no way to allow html in there so you can't enable it. Markdown links are supported as martjin wrote previous post.
×
×
  • Create New...