Jump to content

interrobang

Members
  • Posts

    255
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by interrobang

  1. I edited the servers php.ini file. Edit: If you do not have access to the php.ini file you can try to set the value in the htaccess file like this: php_value max_input_vars 5000
  2. I edited my first post. The solution was to increase max_input_vars.
  3. I have a images field with a large number (about 400) of images. Uploading took a while, but worked. But when I try to remove them all by double-clicking the trashcan icon and saving the page nothing happens. The page editor just reloads with all images still there. I get no error message. Removing only a small set of images works like expected. Is there a php/server setting I need to change? Currently I am testing this in my local MAMP environment. Edit: I found something in my server logs: PHP Warning: Unknown: Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini. in Unknown on line 0 I edited the php.ini to include max_input_vars = 10000 and now it seems to work.
  4. Try this: $label = $player->fieldgroup->getField('playername', true)->label; //get the field label in context of the template
  5. If you just want to autolink every email address in a textarea my TextformatterMakeLinks may be usefull for you. http://modules.processwire.com/modules/textformatter-make-links/
  6. I use these modules in almost every project AIOM+ ProCache HelperFieldLinks ModulesManager TextformatterMakeLinks Really? Nobody uses ModulesManager anymore? Not in my Must-Have Top 5, but I find myself using these in many of my projects: Page List Pin Template Stubs Admin Save Actions ProcessBatcher Map Marker
  7. Looking at the sources you seem to be right. The value gets saved already purified. But it should work when you place the snippet in admin.php in your templates folder An alternative way would be to edit InputfieldCKEditor.module in site/modules. Around line 262 the purifier is used and configured.
  8. The module docs say: To specify custom settings to HTML Purifier, perform set() calls before calling purify(). So I guess something like this should work, if placed on top of your templates before you output your fields. $purifier = wire('modules')->get('MarkupHTMLPurifier'); $purifier->set('Attr.AllowedRel', array('nofollow')); I did not try this myself. If this doesn't work when placed in your template files I would try placing it in the admin.php in your templates folder.
  9. I don't see why my suggested check should not work. Did you try it? I guess you are talking about the field block_link? if($block->block_link && $block->block_link->id) { $out .="<div class='block-link text-center'>"; $out .="<a href='{$block->block_link->url}{$thisanchor}' class='readmore-button '>Find Out More</a>"; $out .="</div>"; } EDIT: if you know it is a "Null Page Single" only shecking for id should be enough if($block->block_link->id){}
  10. It depends on how you configured you page_field on the Details Tab. For single page references this should work always. First test if page_field is "trueish", then check if not a NullPage if($block->page_field && $block->page_field->id){} for multi page references a simple count should work: if(count($block->page_field)){}
  11. @philipp I think there is no need to extend Pageimage or FieldtypeImage. I should be enough to make your Textformatter autoload, and add a hook 'srcset' to Pageimage from your module.
  12. Thanks Adrian, thats what I tried before. At least I thought so. Tried it again, and now it works.
  13. I am playing around with the new addition getConfigAllowContext() http://processwire.com/blog/posts/processwire-2.5.7-core-updates/#field-template-context-now-available-for-any-field-property In my InputfieldTest.module I have this method: public function ___getConfigAllowContext($field) { $contextFields = parent::___getConfigAllowContext($field); $contextFields[] = 'cropSettings'; return $contextFields; } In the admin everything works like expected. But I have no idea how to use this with the API. In my "FieldtypeTest.module" I want to get the cropSettings in the context of a specific template. Until now I am using $inputFieldInstance->cropSettings to get my settings, but of course this gets me only the value without the context. Any ideas?
  14. As this became a cmscriticcritics thread I have another suggestion: Test and optimize your mediaqueries. See attached screenshot.
  15. Thanks for giving my module a try. I see that it would be handy in your case, but I think it's better to keep these Textformatters separate. Not everybody wants obfuscation, and having separate Formatters is way more flexible.
  16. I pushed some updates to github: Toggling Grid Mode works now In Grid mode you see only a icon on the thumb to edit the focusArea You no longer have to set a suffix by yourself, this is automatically done in the module Updated version to 0.4.0
  17. Thanks Horst, but forceNew won't help if you are testing all the different cropping options at once, because at least some of the image variant urls would be the same. Thanks for the suggestion to add the suffix internally in my module. I will push a update to github later today. I was not sure if this should be up to the developer or not. If I see it right, currently PageImage::size adjusts filename for cropping settings, all other options are not reflected in the filename.
  18. I pushed some updates to github. Outside cropping works now if $image->size() is called with height=0 or width=0. See my first post for updated API examples to get images with the same ratio as the focusarea Another thing I think I should mention: If you are testing the different cropping options make sure you prevent getting cached versions. In the moment you have to set the 'suffix' option by yourself. Maybe the module should to this automatically? (Edit: Since version 0.4.0 the suffix option is set internally by the module, I remove the suffix setting from the example code) btw, I do my testing like this: <?php $image = $page->focusimages->eq(0); $image->removeVariations(); $sizes = array( array(400, 400), array(400, 300), array(400, 200), array(400, 100), array(300, 100), array(200, 100), array(100, 100), array(100, 200), array(100, 300), array(100, 400), ); $croppings = array( // 'center', 'align', 'inside', 'outside' ); $upscaling = true; ?> <?php foreach ($croppings as $cropping): ?> <div class="row"> <h1>cropping: <?= $cropping ?></h1> <?php foreach ($sizes as $size): ?> <?php $img = $image->size($size[0], $size[1], array('cropping' => $cropping, 'upscaling'=>$upscaling)); ?> <div class="cropping-example"> <span class="info">Size: <?= $size[0] ?>×<?= $size[1] ?></span> <img src="<?= $img->url ?>" width="<?= $img->width ?>" height="<?= $img->height ?>"/> </div> <?php endforeach ?> </div> <?php endforeach ?>
  19. Or you can use wireRenderFile a new addition to ProcessWires functions: https://processwire.com/blog/posts/processwire-2.5.2/#new-wirerenderfile-and-wireincludefile-functions echo wireRenderFile('markup/contact-markup.php', array( 'name'=>'john doe', 'address'=>'sample street', 'zip'=>'sample city' )); I did not test this example, but according to the docs it should work like this. Requires ProcessWire 2.5.2
  20. TextformatterMakeLinks This Textformatter module is just a wrapper around the method fHTML::makeLinks from flourishlib (http://flourishlib.com/api/fHTML#makeLinks) The following description is basically just slightly modified copy from the official flourishlib documetation (http://flourishlib.com/docs/fHTML): The Textformatter will parse through a string and create HTML links out of anything that resembles a URL or email address, as long as it is not already part of an tag. Here is an example of it in action: If you put this text into a textarea inputfield which uses this textformatter Example 1: www.example.com. Example 2: https://example.com.'>https://example.com. Example 3: john@example.com. Example 4: ftp://john:password@example.com.'>ftp://john:password@example.com. Example 5: www.example.co.uk. Example 6: john@example.co.uk. Example 7: <a href="http://example.com">http://example.com</a>. The output would be: Example 1: <a href="http://www.example.com">www.example.com</a>. Example 2: <a href="https://example.com">https://example.com</a>. Example 3: <a href="mailto:john@example.com">john@example.com</a>. Example 4: <a href="ftp://john:password@example.com">ftp://john:password@example.com</a>. Example 5: <a href="http://www.example.co.uk">www.example.co.uk</a>. Example 6: <a href="mailto:john@example.co.uk">john@example.co.uk</a>. Example 7: <a href="http://example.com">http://example.com</a>. Downloadhttps://github.com/phlppschrr/TextformatterMakeLinks http://modules.processwire.com/modules/textformatter-make-links/
  21. I just pushed some updates to github. I optimized the handling of the 'outside' mode. Before the update I switched the 'outside' mode to 'align' if the focusArea was smaller then the target size, now I try to expand the focusArea on each side. @BernhardB: Please give the latest version a try, maybe if fixes your issues, too. I could not reproduce the behaviour you described until now. And update your PW to the latest dev, Ryan just merged Horsts fixes to the ImageSizer.
  22. @BernhardB: Thanks for testing, but I am not sure whats happening there. Do you use 'upscaling'=>false? There is a know bug when upscaling is disabled in the current PW release. Horst already fixed it in his fork, and the fix should be included in the next dev release. See 2nd post of this thread. If you don't prohibit upscaling I will try to reproduce whats happening here.
  23. Thanks for the bug report Bernhard. The updated and renamed module is now on github.
  24. I just added a new (experimental) property 'cssBackgroundSize' to Pageimage for supporting frontend responsive images without javascript. Should be used together with background-position: cover. In my tests this worked amazingly well. The result is similar to the 'align' mode. <style> .cssimg{ background-size: cover; } </style> <div class="cssimg" style="background-position: <?= $image->cssBackgroundPosition ?>; background-image: url(<?= $image->url ?>); width:200px; height: 200px; "></div>
  25. @horst: Thanks for the info and fix. I just tested your fixed ImageSizer, and now everything looks like expected! @all: Which module name do you prefer for field? Before putting this to the module directory I will likely rename this module. ImageFocusrect ImageFocusArea ImageCroppingArea ImageSoftCrop FocusImage anything else? -- Edit: Thanks for your feedback. I renamed the module to ImageFocusArea
×
×
  • Create New...