Jump to content

interrobang

Members
  • Posts

    238
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by interrobang

  1. Thomas, I ran into the same issue and used the filter() function as a quick workaround: $pages->find("template=video")->filter("is_private!=1")
  2. something like this in your widget: if ($page->motherpage) $page = $page->motherpage;echo $page->sidebar; and something like this in your motherpage: $yourWidgetPageObject->motherpage = $page;
  3. u-nikos, have you seen there is already a module for custom cropping in the backend? http://modules.processwire.com/modules/fieldtype-crop-image/
  4. My extended Christmas holidays already started, so I can only test when I am back in the office in late January. If noone else did it by then, I would be glad to help you to implement the pixel cropping. EDIT: I should note, that the current percentage cropping, is not really setting the center but its more like aligning the downscaled original into the target size: 0% 0% = NorthWest 50% 50% = center 100% 100% = SouthEast I am not sure if this is the expected result. Should the cropping parameters represent the thumb center instead? What do you think?
  5. I totally agree with you. A fixed date format wouldn't be of much use. Thats why I already reverted my changes. I didn't thought at using a real date field. But now I already solved it using my own foreach. I was simple enough. I think I just wanted to play with your module. It's a great module btw. Thanks for building it, Soma.
  6. thanks. But I don't know how to use php in item_tpl. Maybe I just shouldn't misuse MarkupSimpleNavigation for this $moduleMarkupSimpleNavigation->render(array( 'selector' => "template=news-article, news_category={$newsCategory}", 'item_tpl' => '<div class="news-header"><h3 class="news-headline">{title}</h3><span class="news-date">{created}</span></div><div class="news-body">{body}</div>'), null, $page); It works! I modified the module and added these 2 line @line 203 to output my date: else if ($match[1] === 'created' || $match[1] === 'modified' ) { $field_value = date('d.m.Y', $f); } And now I am gonna revert these changes and stop abusing this module for my purpose.
  7. I want to output the page->created date in my list, but I only get the timestamp. Is it possible to format the date somehow?
  8. In case anyone wants to buy PhpStorm, buy it today. I just got this tweet: I am using PhpStorm for about a year now, and I am quite happy with it. And the upcoming new UI looks nice, too. * Sorry for spamming this forum with special offers, but I think some here might be interested. I am not affiliated with them, just a happy user.
  9. Ryan, I think it would be enough to add something like this below the cropping switch in ImageSizer if you want to implement this feature. // setCropping(array(.3, .4)) // = centered at x=30% y=40% ; if (is_array($this->cropping)) { $w1 = ($gdWidth - $targetWidth) * $this->cropping[0]; $h1 = ($gdHeight - $targetHeight) * $this->cropping[1]; }
  10. I am sure for small page counts ProcessWire can handle faceted searches quite well with some lines of custom code. I think the real advantage of Solr is mainly on high traffic sites with lot of pages. But I think you are right, in the moment the audience for something like this is quite limited. And there are more important features on the roadmap (like page revisions/draft/live version), to get into this enterprise cms area where features like this are needed. If I could get a customer only if PW supports Solr I would be happy to sponsor this feature. Let's see what 2013 has to bring Thanks for looking into this.
  11. A submit button and a little bit of php on top of your templates. Here is a good explanation: http://css-tricks.com/unobtrusive-page-changer/
  12. If you are using the dev branch, you can validate the data using a regex pattern. Just enter a vaild pattern in the Field Settings (Pattern is hidden in the Input Tab) and It should validate both client side and server side. In the moment it is not possible to get custom validation messages, but this should be easy to add at least for client side validation, as it is enough to add a title attribute to the inputfield with the message. Edit: For some reason I can't see a pattern inputfield on Textareas. Of course for client side validation a modern browser is needed, as long pw doesn't include a polyfill javascript.
  13. Like Willy said, you can change the outputted classNames so your jquery ui css can't find/style them. The default classes are these: /** * Classes used during the render() method - customize with InputfieldWrapper::setClasses($array) */ $defaultClasses = array( 'list' => 'Inputfields', 'list_clearfix' => 'ui-helper-clearfix', 'item' => 'Inputfield {class} Inputfield_{name} ui-widget', 'item_required' => 'InputfieldStateRequired', 'item_error' => 'ui-state-error InputfieldStateError', 'item_collapsed' => 'InputfieldStateCollapsed', 'item_column_width' => 'InputfieldColumnWidth', 'item_column_width_first' => 'InputfieldColumnWidthFirst' );
  14. You are right, Solr is based on the Lucene Java search library. I haven't seen a server myself which comes with Solr by default, but it's easy to install if you can run java on the server. And you dont't have to know any Java to use Solr. All configuration with Solr can be done with XML and the queries are done with a REST-like API. Solr is really great at getting weighted search results. And things like facets are for sure a must have for big shops or any big catalog like sites. I think your skyscraper site would be a nice example. There are many more features, have look here: http://lucene.apache.org/solr/features.html At this video you get a quick idea what facets are about: Thanks looking into it. If you need a better explanation tell me – I can ask my co-workers to post here.
  15. Would't it enough to build a md5 of the user optional options array like this $basename .= '.' . $width . 'x' . $height . "." . $this->ext() . "." . md5(implode($options)); // i.e. myfile.100x100.1f3870be274f6c49b3e31a0c6728957f.jpg; and ignore the md5 part in the getVariatons calls?
  16. Do you think it would be possible to integrate Apache Solr into PW? It seems like all major CMS have plugins for this. In the office I work I am the only one using processwire (the others use ez Publish), and whenever I want to convince them to use PW they complain that without out Solr integration they don't want to. Personally I am happy with the speed and results of the pw api. I have no idea how complicated it would be to build a SolrModule, but still I want to ask. It would be a good marketing keyword for sure
  17. Actually, I just read the docs and comments on php.net. This is the first time I have used any of the php image functions. The math part is the only thing I already was familiar with as I had to do things like that a lot back when I was making flash websites with actionscript. You are probably right, that in the moment the options don't need to be reflected in the resized image url. On the long way, if you want to implement some basic image filters like grayscale and blur it would get necessary.
  18. I just tested this proposed gravity like cropping hardcoded in ImageSizer.php I have not done any proper implementation using the options array yet, just some dirty hacking, but it seems to work. For a proper implementation we should reflect the cropping direction in the generated url too I guess? But the math part was simple like this. This code replaces line 208 - 211 in ImageSizer.php of the dev branch: btw, I replaced "imagecopyresampled()" by "imagecopyresized()", as we are not doing any resizing in this line, just cropping. The resizing is already done when this code get executed. Should give slightly better performance? // centercrop defaults: $w1 = ($gdWidth - $targetWidth ) / 2; $h1 = ($gdHeight - $targetHeight) / 2; // read the crop direction from options, hardcoded for testing only: $cropDirection = 'southeast'; switch (strtolower($cropDirection)) { case 'northwest': $w1 = 0; $h1 = 0; break; case 'north': $h1 = 0; break; case 'northeast': $w1 = $gdWidth - $targetWidth; $h1 = 0; break; case 'west': $w1 = 0; break; case 'east': $w1 = $gdWidth - $targetWidth; break; case 'southwest': $w1 = 0; $h1 = $gdHeight - $targetHeight; break; case 'south': $h1 = $gdHeight - $targetHeight; break; case 'southeast': $w1 = $gdWidth - $targetWidth; $h1 = $gdHeight - $targetHeight; break; } imagecopyresized($thumb2, $thumb, 0, 0, $w1, $h1, $targetWidth, $targetHeight, $targetWidth, $targetHeight);
  19. Ryan, I have bookmarked a ImageClass on github which has this functionality. I never used this class, your ImageSizer and Antti's Thumbnails where alwas sufficant for me, but maybe you can copy some lines from there? https://github.com/s...Images.php#L151 Edit: Now I think this class isn't very useful for this. The time I bookmarked it I thought it is great, but now with some weeks working with php and PW at least cropping part of this class looks pretty simple. It guess PW made me learn some php.
  20. I don't have this as a requirement on any current projects, but this would be a great addition! Some nice patterns: http://html5pattern.com
  21. If you want to access the processwire api from external scripts you have to include processwires index.php there see here: http://processwire.com/api/include/
  22. I jsut found this Database version control script, and thought it might be interesting for you. But to be honest, I dont't understand everything in this thread, so probably it's not so useful as it sounds to me... http://dbv.vizuina.com https://github.com/victorstanciu/dbv
  23. This is how html5boilerplate does it. the nice thing is it works without specifying your domainname and could easily included in your own default htaccess: # Rewrite "www.example.com -> example.com" <IfModule mod_rewrite.c> RewriteCond %{HTTPS} !=on RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L] </IfModule> https://github.com/h5bp/html5-boilerplate/blob/master/.htaccess#L344
  24. I tested it again with the latest dev branch and it works here like expected. Thanks for the quick fix. And the previously overlaying icons in the debug accordion headers are gone too!
  25. I tried again with the latest dev branch, but it still doesn't seem to work. When I try to edit any of the json files in the backend I get this error: TemplateFile: Unable to load textdomain #0 [internal function]: ProcessLanguageTranslator->___executeEdit() #1 /htdocs/wire/core/Wire.php(271): call_user_func_array(Array, Array) #2 /htdocs/wire/core/Wire.php(229): Wire->runHooks('executeEdit', Array) #3 /htdocs/wire/core/ProcessController.php(194): Wire->__call('executeEdit', Array) #4 /htdocs/wire/core/ProcessController.php(194): ProcessLanguageTranslator->executeEdit() #5 [internal function]: ProcessController->___execute() #6 /htdocs/wire/core/Wire.php(271): call_user_func_array(Array, Array) #7 /htdocs/wire/core/Wire.php(229): Wire->runHooks('execute', Array) #8 /htdocs/wire/core/admin.php(45): Wire->__call('execute', Array) #9 /htdocs/wire/core/admin.php(45): ProcessController->execute() #10 /htdocs/wire/templates-admin/controller.php(13): require('/Users/philipp/...') #11 /htdocs/site/templates/admin.php(13): require('/Users/philipp/...') #12 /htdocs/wire/core/TemplateFile.php(92): require('/Users/philipp/...') #13 [internal function]: TemplateFile->___render() #14 /htdocs/wire/core/Wire.php(271): call_user_func_array(Array, Array) #15 /htdocs/wire/core/Wire.php(229): Wire->runHooks('render', Array) #16 /htdocs/wire/modules/PageRender.module(240): Wire->__call('render', Array) #17 /htdocs/wire/modules/PageRender.module(240): TemplateFile->render() #18 [internal function]: PageRender->___renderPage(Object(HookEvent)) #19 /htdocs/wire/core/Wire.php(271): call_user_func_array(Array, Array) #20 /htdocs/wire/core/Wire.php(229): Wire->runHooks('renderPage', Array) #21 /htdocs/wire/core/Wire.php(293): Wire->__call('renderPage', Array) #22 /htdocs/wire/core/Wire.php(293): PageRender->renderPage(Object(HookEvent)) #23 /htdocs/wire/core/Wire.php(229): Wire->runHooks('render', Array) #24 /htdocs/wire/modules/Process/ProcessPageView.module(98): Wire->__call('render', Array) #25 /htdocs/wire/modules/Process/ProcessPageView.module(98): Page->render() #26 [internal function]: ProcessPageView->___execute() #27 /htdocs/wire/core/Wire.php(271): call_user_func_array(Array, Array) #28 /htdocs/wire/core/Wire.php(229): Wire->runHooks('execute', Array) #29 /htdocs/index.php(192): Wire->__call('execute', Array) #30 /htdocs/index.php(192): ProcessPageView->execute() #31 {main} EDIT: If I first install the master branch and install the language pack there, and update to the dev branch by replacing the wire folder everything seems to work. I can even add new languages. EDIT 2: It seems to be related to pagefileSecure. If I set this setting to false, uploading languages works without problems.
×
×
  • Create New...