Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/10/2016 in all areas

  1. This is a very beta version of the separate functions I use to generate srcset/bgset markups. There's some similar functions floating around in the forum but this one is a bit different because you can set "named image sets" which you can use easily site-wide. It's definitely work-in-progress so use it at your own risk. MarkupSrcSet Generate srcset and bgset markup for lazysizes. Features generate srcset/bgset markup for lazysizes set image sizes in JSON array add required JavaScripts automatically (optional) fallback to smallest image size if JavaScript is not available Usage Image sets JSON (in module settings): { "hero": [ [640, 210], [1080, null], [1920, null] ], "featured-image": [ [360, 240], 1.333, 2.667 ], "gallery-thumb": [ [240, 120], [480, 300], [800, 576] ] } Image methods $image->srcset(): <img <?php echo $page->featured_image->srcset('featured-image'); ?>> $image->bgset(): <div <?php echo $page->images->first()->bgset('hero'); ?>>Lorem ipsum</div> https://github.com/rolandtoth/MarkupSrcSet
    7 points
  2. A pro would be, to have it into the TracyDebugger toolbox makes it independant from your own browsers and its extensions. Useful in the more rare cases, where you are using a foreign PC. So, it should be in, but disabled by default.
    3 points
  3. Although in the case of real projects I find it nearly impossible to produce HTML output that is considered to be valid by the W3 validator, I think it is a good idea to have a quick look so that anything considered to be a bug (say not closed elements) can be quickly identified. So I support the idea.
    3 points
  4. bernhard - I am rethinking this - I think that szabesz and horst make some compelling arguments - in particular I like the idea that Tracy can make your life easier when you're not at your normal dev machine, so adding this could be useful. Do you have a preferred solution? How did you set up what you have in that screencast? I was looking at: https://github.com/micheh/w3c-validator but was wondering if you were just passing a URL to an iframe of the w3c validator? I actually like the idea of being able to color the panel icon in Tracy depending on the report status, so I think something like that Github library might help in that. PS Mismatched html tags is a great example of a bug that should be dealt with, so from that perspective I think it might fit nicely with Tracy.
    2 points
  5. If you want to use this module with PW3.x (and only PW3.x), please pull branch feature/devns. It needs a bit more testing before I'll release it. first backup your installation after upgrading the module, go to module settings, have a look at the settings – you may have to adapt something Whats new: messages will be saved as pages instead of repeater items you have to define a parent page, all messages created will live under this parent the page name starts with the current timestamp, you could add additional fields which should be appended field selection: you can existing fields or fill in field names, after the module are saved, for each name a field will be created manage settings like field type, required, additional error checks for each field after the module settings are saved, all existing repeater items will be converted to pages no more template creation, ProcessWire API renders the form (you can adapt the markup) you may have to translate error and success messages Have a look at the latest readme to get more information. I would love to get some feedback
    2 points
  6. Getting closer to the ProcessWire 3.x stable release, version 3.0.14 focuses largely on updates and optimizations specific to recent GitHub issue reports. We also have optimizations and in-depth coverage of PW’s file compiler, some new options for required fields, along with a review of some best practices when working with fields. https://processwire.com/blog/posts/processwire-3.0.14-updates-file-compiler-fields-and-more/
    1 point
  7. Function Allows all admin-side text areas to auto-expand as they are used. Description Following on from tpr's mini-tutorial, I went ahead and wrapped it up as a module. I'm re-posting it here in the module's forum and will submit it to the module repository to prevent it from becoming one of PW's "ghost" modules - modules for PW that exist on github (or elsewhere) and have a relatively obscure link from the forum or a blog post somewhere else. Links The module on Github. The module in the module repository. Version History 1.0.0: Initial release.
    1 point
  8. Still waiting to hear from you @SteveB! But in the meantime I thought a little more about name vs path matching and I have made some additions in this area. You can now either return a name or a path in the custom PHP code option. Path is the recommended option. This change doesn't affect the other two matching modes, but it should make this mode more efficient.
    1 point
  9. note_page_id is a variable, which does need to be defined somewhere. That's the part which is missing, which could lead to an answer about why you need to include its value.
    1 point
  10. Perhaps this will making a choice more easy: Modx is still on ExtJS in the backend (slow) and has hold down Modx development for years It's the main reason why we have many ex-modx'ers here in the forum using processwire Modx is fundraising $50.000 for rewriting the backend manager Modx3 release has become unknown (was to be released in 2013)
    1 point
  11. @tewdin, Easy, yes - but not that easy. Please add input sanitisation and return value checks to your code posted above. I think you should also be getting the values from Post input, not from request input. If you have live code like the example you posted, you should probably revise it.
    1 point
  12. hi adrian, what do you think about integrating a w3 validator into the tracy bar? i was thinking about implementing this as a little module, but i think it would even be better to have this as an option built into tracy. or is it a gain a feature that's already covered anywhere?
    1 point
  13. http://modules.processwire.com/modules/admin-hot-keys/
    1 point
  14. It seems that opengraph tags require "property" instead of "name" in tags: http://ogp.me/ Here is a quick fix (around line 330, added dynamic $attributeName): // add "render" $rendered = ''; foreach($pageData as $name => $content) { // set "property" as meta attribute name instead of "name" if it's an opengraph tag $attributeName = strpos($name, 'og:') !== false ? 'property' : 'name'; switch($name) { case 'custom': break; case 'title': if($this->titleFormat == '') break; $rendered .= '<title>'.$this->parseTitle($page, $content).'</title>'.PHP_EOL; break; case 'canonical': $rendered .= '<link rel="canonical" href="'.$content.'" />'.PHP_EOL; break; default: $rendered .= '<meta ' . $attributeName . '="'.$name.'" content="'.$content.'" />'.PHP_EOL; break; } } Also, it's a good practice to add og:image:width and og:image:height, this ensures the image is loaded on first facebook share (otherwise it's empty). Maybe the module could automatically add these too.
    1 point
  15. You can use the WirePDF module with any kind of markup you need. I'm using wireRenderFile() to render the html with custom data and then pass it into WirePDF.
    1 point
  16. Since there are a lot of topics about the same theme, I decided to write a small module which overwrites the core function ___SetupPageName(). The module allows now to populate the page name using proprietary date() function. Works like PHP date() with follwing exceptions: Everything between the brackets is detected as format string, meaning no 2nd parameter possible. No need to use quotes around the format string. Spaces not allowed. from any page property, page field including subfields, parent property, parent field etc. Meaning everything what you get with $page->get(); including dot syntax. The function will give error and warnings in case of unproper settings, but creates the page with name 'untitled' anyway. Download here: http://modules.processwire.com/modules/process-setup-page-name/ Some Examples The following settings in parent template 'Name Format Children' will assign name immediately. date(Y) date('Y-m-d') parent.title parent.parent.title parent.id template.id assign name after page saving and/or population of depending field. Overwrites 'untitled' after all fields which are defined in parent template are populated. id (any other page property) pagefieldname, multiple pagefieldnames show a warning. pagefieldname (value not populated)show an error. date() // empty, no format assigned date(Y // missing closing bracket date(Y md) // unallowed space notexistingfieldname notexistingproperty existingfield.notexistingsubfield The function in the module ___SetupPageName() could be completely copied as is to the core class $pages. @Ryan Would be nice to see this in core. Related topics: https://processwire.com/talk/topic/8576-name-format-children/ https://processwire.com/talk/topic/8217-name-format-for-children-based-on-any-field-not-just-title/ https://processwire.com/talk/topic/11628-custom-page-name/ https://processwire.com/talk/topic/11349-page-add-step-not-being-skipped-when-name-format-for-children-is-set/ https://processwire.com/talk/topic/10701-automatic-page-name-using-processpageaddexecute-and-pagetable/ https://processwire.com/talk/topic/10208-pagetable-automatic-page-name-format-when-multiple-templates-allowed/ https://processwire.com/talk/topic/9979-name-format-for-children-for-multiple-allowed-templates-for-children/ https://processwire.com/api/modules/process-template/ Any recommandations after testing welcome. Download here: Download here: http://modules.processwire.com/modules/process-setup-page-name/ Edit: small enhancement to prevent display of warning twice. 23.12.15 multiple values possible now 24.12.15 made compatible with PW 3.x 27.12.15 Update Version 1.0.8 09.01.16 Update Version 1.1.0
    1 point
  17. It should be clear that the module should echo, I removed the echo keyword from my documentation because if you download for example ProcessWire, it contains some basic templates and you will need $content = $modules->get('SimpleContactForm')->render(); to output the form. So if you use a template prepend file or if you use for example TemplateDataProviders it differs. I think about that, for now just enter antiSpamTimeMin = 0 (Maybe I should set this as default?), antiSpamTimeMax = 1000 and antiSpamPerDay=1000. This modules creates two log files (→ documentation), have a look there to figure out what is wrong. If you were redirected to the homepage (→ documentation) the reason is always spam protection. If you change the markup make sure to maintain the names of the fields and you have to hide website(honeypot field) and submitted (→ documentation). If you change the number of inputs manually (adding or deleting a field), you have to adapt antiSpamCountAdditionalInputs (→ documentation). You enter the fields as a comma separated list, maybe there will be more textarea fields like `message`. How should I know which one should be a textarea and which one a simple input or maybe a date input (for example). This module provides some templates as starting point, you have to change / adapt the html! The honeypot field is also displayed because it's better to add a surrounding div assigning a class and hide it using CSS. Feel free to contribute! You could at least help me to improve the documentation! Nobody has to use this module! Go ahead and use formbuilder. You can fill out the form in less than one minute, just set timeMin = 0! It's the same as disabling spam protection. There is much more spam protection and of course there is already a honeypot field.
    1 point
  18. I think I've been getting confused - it must have been in a private beta earlier this year and I'm not as blind as I thought. The actual launch appears to have been the 15th of August so I don't feel so bad now: https://stripe.com/blog/introducing-stripe-uk I think the only drawback is that they don't offer the ability to transfer to your bank account on demand, favouring a 7 day automatic rolling payment schedule (to be honest having the money in their system a few days longer is probably one of the ways they make a profit from the system aside from the fees - which are 1% lower than PayPal). I don't think that that is really a huge deal though as there is usually some waiting period for transfers with most merchants and in this case you can know in advance what day each week money will land in your bank. The fact that they've opened a London office and are working with other European countries as well as Australia also shows their commitment to going global and the fact that they are likely to be around a while. I think they've got the potential to take quite a slice of the market at this rate, or certainly stir it up and kick a few bums into action in terms of the more archaic merchants out there.
    1 point
×
×
  • Create New...