Jump to content

Recommended Posts

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.

remove-blocks

 

https://github.com/Toutouwai/TextformatterRemoveBlocks
http://modules.processwire.com/modules/textformatter-remove-blocks/

  • Like 4

Share this post


Link to post
Share on other sites

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.

  • Like 2

Share this post


Link to post
Share on other sites

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.

  • Like 1

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites

@Robin S  Useful textformatter in case of multiline content. If you want to hide text without linebreaks you can also use Core TextformatterMarkdownExtra:

33191591_Bildschirmfoto2018-09-08um14_21_40.jpg.c52f1d2aacac5ef489f5325e7feec22b.jpg

  • Like 2

Share this post


Link to post
Share on other sites
9 hours ago, kixe said:

If you want to hide text without linebreaks you can also use Core TextformatterMarkdownExtra:

33191591_Bildschirmfoto2018-09-08um14_21_40.jpg.c52f1d2aacac5ef489f5325e7feec22b.jpg

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.

 

Share this post


Link to post
Share on other sites
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...

2018-09-12_093821.png.10f0289891f1e139438d18070b92875f.png

...and you have placed your delimiters around the content you want removed. 

  • Like 2

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Gadgetto
      Status update links (inside this thread) for SnipWire development will be always posted here:
      2019-10-18
      2019-08-08
      2019-06-15
      2019-06-02
      2019-05-25
      If you are interested, you can test the current state of development:
      https://github.com/gadgetto/SnipWire
      Please note that the software is not yet intended for use in a production system (alpha version).
      If you like, you can also submit feature requests and suggestions for improvement. I also accept pull requests.
      ---- INITIAL POST FROM 2019-05-25 ----
      I wanted to let you know that I am currently working on a new ProcessWire module that fully integrates the Snipcart Shopping Cart System into ProcessWire. (this is a customer project, so I had to postpone the development of my other module GroupMailer).
      The new module SnipWire offers full integration of the Snipcart Shopping Cart System into ProcessWire.
      Here are some highlights:
      simple setup with (optional) pre-installed templates, product fields, sample products (quasi a complete shop system to get started immediately) store dashboard with all data from the snipcart system (no change to the snipcart dashboard itself required) Integrated REST API for controlling and querying snipcart data webhooks to trigger events from Snipcart (new order, new customer, etc.) multi currency support self-defined/configurable tax rates etc. Development is already well advanced and I plan to release the module in the next 2-3 months.
      I'm not sure yet if this will be a "Pro" module or if it will be made available for free.
      I would be grateful for suggestions and hints!
      (please have a look at the screenshots to get an idea what I'm talking about)
       




    • By eelkenet
      Hi! I've created a small Inputfield module called InputfieldFloatRange which allows you to use an HTML5 <input type="range" ../> slider as an InputField. I needed something like this for a project where the client needs to be able to tweak this value more based on 'a feeling' than just entering a boring old number. Maybe more people can use this so I'm hereby releasing it into the wild.  
       
      What is it?
      The missing range slider Inputfield for Processwire. 
      What does it do?
      This module extends InputfieldFloat and allows you to use HTML5 range sliders for number fields in your templates.
      It includes a visible and editable value field, to override/tweak the value if required.  
      Features
      Min/max values Precision (number of decimals) Steps (Read more) Manual override of the selected value (will still adhere to the rules above) Usage
      Clone / zip repo Install FieldtypeFloatRange, this automatically installs the Inputfield Create new field of type `Float (range)` or convert an existing `Float`, `Integer` or `Text` field. To render the field's value simply echo `$page->field` Demo
      A field with Min=0, Max=1, Step=0.2, Precision=2

      Field with settings Min=0, Max=200, Step=0.25, Precision=2

       
      Todo
      Make the display-field's size configurable (will use the Input Size field setting)  Hopefully become redundant If it's usable for others I'll add it to the Modules list  
      Changelog
      v002
      - Fix issue where setting the step value to an empty value created problem with validation
      - Make the display-field optional 
      v001
      - Initial release
       
      Thanks!
       
       
    • By Robin S
      Another little admin helper module...
      Template Field Widths
      Adds a "Field widths" field to Edit Template that allows you to quickly set the widths of inputfields in the template.

      Why?
      When setting up a new template or trying out different field layouts I find it a bit slow and tedious to have to open each field individually in a modal just to set the width. This module speeds up the process.
      Installation
      Install the Template Field Widths module.
      Config options
      You can set the default presentation of the "Field widths" field to collapsed or open. Field widths entered into the Template Field Widths inputfield are only applied if the Edit Template form is submitted with the Template Field Widths inputfield in an opened state. "Collapsed" is the recommended setting if you think you might also use core inputs for setting field widths in a template context. You can choose Name or Label as the primary identifier shown for the field. The unchosen alternative will become the title attribute shown on hover. You can choose to show the original field width next to the template context field width.  
      https://github.com/Toutouwai/TemplateFieldWidths
      https://modules.processwire.com/modules/template-field-widths/
    • By adrian
      Tracy Debugger for ProcessWire
      The ultimate “swiss army knife” debugging and development tool for the ProcessWire CMF/CMS

       
      Integrates and extends Nette's Tracy debugging tool and adds 35+ custom tools designed for effective ProcessWire debugging and lightning fast development
      The most comprehensive set of instructions and examples is available at: https://adrianbj.github.io/TracyDebugger
      Modules Directory: http://modules.processwire.com/modules/tracy-debugger/
      Github: https://github.com/adrianbj/TracyDebugger
      A big thanks to @tpr for introducing me to Tracy and for the idea for this module and for significant feedback, testing, and feature suggestions.
×
×
  • Create New...