Jump to content

renobird

PW-Moderators
  • Posts

    1,699
  • Joined

  • Last visited

  • Days Won

    14

Everything posted by renobird

  1. muzzer, I think you will be compelled to change your profile photo to something happier when you are done. Perhaps smiling and drinking a beer.
  2. Macrura, Glad to have helped. I will warn you, creating simple ProcessModules are a gateway drug. Once you start creating modules, it's addicting. As has been stated by others, there are definitely cases where using the module is a good choice too.
  3. Sorry, misunderstood what you meant about repeaters. So the repeater contains a field that is required, but is the repeater field itself also set to required?
  4. Ellipsis on collapsed fields looks good here. If you want to add this now. _inputfields.scss (Line: 131) Current: .InputfieldStateCollapsed { .InputfieldHeader { /* different style for collapsed header */ display: block; padding-bottom: 0.75em; background: $label-link-collapsed-bg; border: 1px solid $subtle-border; color: $label-link-collapsed-color; &:hover { /* style for collapsed header when hovered */ color: $label-link-hover-color; border-color: $subtle-border; background: $text-bg; } } .InputfieldContent { /* collapsed Inputfields don't show their content (only header) */ display: none; } } Replace with .InputfieldStateCollapsed { .InputfieldHeader { /* different style for collapsed header */ display: block; padding-bottom: 0.75em; background: $label-link-collapsed-bg; border: 1px solid $subtle-border; color: $label-link-collapsed-color; &:hover { /* style for collapsed header when hovered */ color: $label-link-hover-color; border-color: $subtle-border; background: $text-bg; } /* Add ellipsis to collapsed fields per ceberlin */ &:after{ content: " \2026"; } } .InputfieldContent { /* collapsed Inputfields don't show their content (only header) */ display: none; } }
  5. Good ideas. #3: To have the first element already visible with repeaters, you can adjust the "Ready-To-Edit New Repeater Items" setting. This will of course result in empty repeaters if the client doesn't enter anything for that item.
  6. I'm not fooled, there is more than one of him. Somachine.
  7. muzzer, Go for it. You won't be disappointed. Matter of fact, you will probably laugh later that you worried about it.
  8. I think ProcessWire would handle this fine. You can use ProCache to make it lightening fast too. See one of Ryan's sites: http://www.villasofdistinction.com Each villa seems to have a lot of data associated. I'm working on an invasive plants species site right now. Each species has about 30 fields (some of which are repeaters). It's still really fast. There are lots of people making very large scale sites around here. I'm sure someone else will chime in to offer additional reassurance.
  9. Nice one Soma!
  10. You just need to create a new page and assign it the process you want. The methods are pretty much 50/50 on that one. They both require a new page and some setting to tell that page what template/process to use.
  11. diogo, Didn't mean any disrespect to this module or it's usefulness — I hope my post didn't come off that way. I used this module for while when you first released it, and I agree it makes the process of creating new admin pages pretty easy. What I've realized is that the build-in process is really just as easy (IMO). I think you should definitely continue to develop/support the module. I just wanted to give a quick example of a simple Process Module that is build much like you might in a template.
  12. I agree — ProcessModules are the way to go. They might look intimidating at first, but if you start with a very simple example, they really are very easy. Here is a super simple example that lists all pages with the template "news". (I'm sure there are others out there, but it only took a few minutes to write so...) <?php /** * Simple Process Module Example. * This is a very basic example to learn from. * I have no intention of expanding on this sample module. * * @author renobird * * ProcessWire 2.x * Copyright (C) 2011 by Ryan Cramer * Licensed under GNU/GPL v2, see LICENSE.TXT * * http://www.processwire.com * http://www.ryancramer.com * */ class SimpleProcessModule extends Process { public static function getModuleInfo() { return array( 'title' => 'Process Module (basic example)', 'summary' => 'A very simple process module as an example on how easy they are to create.', 'version' => 100, 'href' => '', 'permission' => '' ); } public function init() { // initialize the parent parent::init(); } public function ___execute() { // Find some pages $items = $this->pages->find("template=news"); /** * Create a table to display results * There are other ways to do this using MarkupAdminDataTable module, but let's keep this simple for now. */ $out = "<table width='100%'>"; $out .= "<thead>"; $out .= "<th>Title</th>"; $out .= "<th>Date Created</th>"; $out .= "<th>User</th>"; $out .= "<thead>"; $out .= "<tbody>"; // If $items pageArray is not empty if ($items->count() > 0){ foreach ($items as $item) { $out .= "<tr>"; $out .= "<td><a href=". $this->config->urls->admin . "page/edit/?id=" . $item->id .">" .$item->title . "</a></td>"; // title $out .= "<td>" . date("F j, Y", $item->created) . "</td>"; // date created $out .= "<td>" . $item->createdUser->name. "</td>"; // user that created $out .= "</tr>"; } } else { // empty pageArray message $out = "<tr><td>No pages matching your criteria were found.</td></tr>"; } $out .= "</tbody>"; $out .= "</table>"; return $out; } } Usage: Install the module Create a new page under /admin/ Set the process for the new page to SimpleProcessModule If you have never created a module, just focus on the execute() method. Most of what is there is coded exactly as you might from a page template.
  13. I think apeisa has all the usual suspects covered. I imported 900+ plant species from a CSV yesterday. Each has 3 repeater fields that have around 8 entries each on average. So roughly 21,600 pages. It took a little bit, but it completed in one batch. This is on a pretty solid University of Florida server, so not sure how it would do on a typical shared host.
  14. All that said, I also do a fair amount of wireframing directly in the browser — especially when trying to demonstrate responsive techniques to a client. I know I've evangelized this before, but Neat make this really easy. "Take that you dead horse!"
  15. I used Fireworks years ago — back when Macromedia first released it (98/99 I think). I have always been able to do everything I need with Ai and Ps, so no need to to learn/purchase an additional program.
  16. I've designed my sites in Illustrator for as long as I can remember — I've always preferred it to Photoshop. I use Photoshop for images and pixel perfect elements (which I don't ever create anymore). The nice thing about working in Illustrator all the way through is that you can quickly take the wireframes and start turning them into real comps.
  17. Antti, I'm really looking forward to that new Afghan Whigs record. Although, Rick McCollum (guitar) isn't on the record, so I have a feeling that Dulli wrote all the songs and it will sound like a Twilight Singers album. Nothing wrong with that, but it won't be the same without Rick. TEPPO!!!!! *Shakes fist at the sky* I finally managed to get that song out of my head, and what do you do? https://www.youtube.com/watch?v=nPv607Z57sE New (American) Krautrock.
  18. Keep in mind — If you have a lot of images the very first page view will take a bit while all the different sizes get created. After that it will be fast.
  19. Slideshows can get complicated quickly. Especially when serving different image sizes and resolutions like the example above. Then you can start intermingling video slides, and well, the rabbit hole goes further and further... I only look smart because I hang around here and absorb everyone's great examples. So, you are doing the right thing.
  20. Further down the rabbit hole…. A function for responsive (retina) slideshows using Filament Group's responsive carousel and picturefill function slideshow(){ $page = wire('page'); // Resposive Carousel from Filament Group // https://github.com/filamentgroup/responsive-carousel $out = "<div class='carousel arrows' data-paginate data-autoplay data-interval='8000'>"; foreach ($page->images as $image){ // create required images sizes (based on 16:9 aspect ratio) //large $large = $image->size(920,518); $large_2x = $image->size(1840,1036,array('quality' => 25)); //medium $medium = $image->size(720,405); $medium_2x = $image->size(1440,810,array('quality' => 25)); //small $small = $image->size(540,304); $small_2x = $image->size(1080,604,array('quality' => 25)); //extra small $xsmall = $image->size(300,169); $xsmall_2x = $image->size(600,338,array('quality' => 25)); // serve 2x thumb to all devices $thumb = $image->size(200,106,array('quality' => 50)); $out .= "<div data-thumb='{$thumb->url}'>"; $out .= "<span data-picture data-alt='{$image->description}'>"; // extra small $out .= "<span data-src='{$xsmall->url}'></span>"; $out .= "<span data-src='{$xsmall_2x->url}' data-media='(max-width: 399px) and (min-device-pixel-ratio: 2.0)'> </span>"; //small $out .= "<span data-src='{$small->url}' data-media='(min-width: 400px)'></span>"; $out .= "<span data-src='{$small_2x->url}' data-media='(min-width: 400px) and (min-device-pixel-ratio: 2.0)'></span>"; // medium $out .= "<span data-src='{$medium->url}' data-media='(min-width: 800px)'></span>"; $out .= "<span data-src='{$medium_2x->url}' data-media='(min-width: 800px) and (min-device-pixel-ratio: 2.0)'></span>"; // large $out .= "<span data-src='{$large->url}' data-media='(min-width: 1000px)'></span>"; $out .= "<span data-src='{$large_2x->url}' data-media='(min-width: 1000px) and (min-device-pixel-ratio: 2.0)'></span>"; // Internet Explorer 8 and older have no support for CSS3 Media Queries // serve large image to older version of IE desktop. $out .= "<!--[if (lt IE 9) & (!IEMobile)]>"; $out .= "<span data-src='{$large->url}'></span>"; $out .= "<![endif]-->"; // Fallback content for non-JS browsers. Same img src as the initial, unqualified source element. $out .= "<noscript>"; $out .= "<img src='{$large->url}' alt='{$image->description}'/>"; $out .= "</noscript>"; $out .= "</span>"; // end picturefill // use image description field to generate a caption $out .= $image->description ? "<div class='caption'>{$image->description}</div>" : ""; $out .= "</div>"; // end slide } $out .= "</div>"; // end carousel return $out; } In your template <?php // render slideshow if there are images if (count($page->images) > 0){ echo slideshow(); } ?> *gah, formatting got a little mangled in the forum. You get the idea.
  21. Martijn, *showoff*
  22. <ul class="rslides"> <?php foreach ($page->images as $img):?> <li><img src="<?=$img->url;?>"></li> <? endforeach; ?> </ul>
  23. quick on the draw kongondo. I don't think responsiveSlides (looks like what you are using) needs custom markup for individual slides, but you probably have a reason.
  24. can you just foreach the images and output each slide? otherwise $page->images->eq($n);
×
×
  • Create New...