Robin S Posted September 5, 2018 Share Posted September 5, 2018 Remove Blocks A textformatter module for ProcessWire that removes blocks of text/markup between configurable delimiters from output. This allows you to "comment out" blocks of text/markup so they remain present in the field but are not shown in the front-end output. This can be handy if content needs to be removed temporarily and will later be reinstated. Or you could use a commented block as a placeholder to indicate to an editor where some content should be added. Installation Install the Remove Blocks module. Configure the open and close delimiters if needed. The default open delimiter is {{ and the default close delimiter is }}. Tip: don't use delimiter characters that CKEditor will encode to HTML entities, e.g. >. Usage Add the Remove Blocks textformatter to one or more fields. Add the open and close delimiters around any content that you want to be removed from output. https://github.com/Toutouwai/TextformatterRemoveBlockshttp://modules.processwire.com/modules/textformatter-remove-blocks/ 4 Link to comment Share on other sites More sharing options...
szabesz Posted September 5, 2018 Share Posted September 5, 2018 Thanks for sharing! This is a dead simple but really great idea! Have you thought of supporting clients – who are generally unable / do not care to memorize features like this – by optionally adding a CKEditor button in order to add/remove the delimiters? I have two of those buttons in mind: 1. simply adds/removes delimiters of selected block(s) 2. adds/removes delimiters around the selected block(s) but also clones it, putting a copy of it right below the selected part of the text. The second point is for a use case of a simple "draft" feature: when an already published page is being edited, one could work on rewriting a paragraph – for example – and save the page before the original version is removed and the new paragraph version is published by removing the delimiters too. 2 Link to comment Share on other sites More sharing options...
Robin S Posted September 5, 2018 Author Share Posted September 5, 2018 I like idea 1 - will explore that. Idea 2 I don't think is necessary - even technophobes know how to copy/paste text if they want to duplicate it. 1 Link to comment Share on other sites More sharing options...
szabesz Posted September 5, 2018 Share Posted September 5, 2018 2 hours ago, Robin S said: even technophobes know how to copy/paste text if they want to duplicate it. ? You are most probably right, however they might find it more "streamlined" if it can be performed with one click only. Anyway, thanks for considering! Link to comment Share on other sites More sharing options...
kixe Posted September 8, 2018 Share Posted September 8, 2018 @Robin S Useful textformatter in case of multiline content. If you want to hide text without linebreaks you can also use Core TextformatterMarkdownExtra: 2 Link to comment Share on other sites More sharing options...
Robin S Posted September 8, 2018 Author Share Posted September 8, 2018 9 hours ago, kixe said: If you want to hide text without linebreaks you can also use Core TextformatterMarkdownExtra: Cool, I didn't know that one. That syntax works for a plain textarea field, however none of the variants are working for me in a CKEditor field. Probably the HTML tags prevent the normal markdown parsing. Link to comment Share on other sites More sharing options...
loukote Posted September 10, 2018 Share Posted September 10, 2018 @Robin S Hi Robin, could it be that this module (that i would really like to use!) does not work on multi-lingual installations? Link to comment Share on other sites More sharing options...
Robin S Posted September 11, 2018 Author Share Posted September 11, 2018 On 9/11/2018 at 12:27 AM, loukote said: could it be that this module (that i would really like to use!) does not work on multi-lingual installations? I can't think of any reason it wouldn't work on multi-language fields. What specifically is not working for you? Double-check that you have added the Remove Blocks textformatter to the field in question... ...and you have placed your delimiters around the content you want removed. 2 Link to comment Share on other sites More sharing options...
loukote Posted September 12, 2018 Share Posted September 12, 2018 11 hours ago, Robin S said: Double-check that you have added the Remove Blocks textformatter to the field in question... @Robin S, off course it works. Sorry – i did not include it among the textformatters. When rechecking why and re-reading the installation notes, I did not misunderstood the sentence "Add the Remove Blocks textformatter to one or more fields.", thinking that it refers to the use, the curly braces. Thanks for your help! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now