• Resolved brucemiracle

    (@brucemiracle)


    Is it possible to change a single sentence within the generated text? Our legal department has asked for this option. Even if there is a way to export the generated text and re-insert it manually (which I know is means manual updating forever), that would be fine.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Contributor jarnovos

    (@jarnovos)

    Hello @brucemiracle,

    Yes, there are two main methods to change the text in your documents. The first of which is a PHP filter and will allow you to keep the synchronization with Complianz active, the second method allows you to edit the document’s content freely, but would prevent Complianz from dynamically updating the document.

    #1: Filter (sync remains active)

    You can place the below code as a PHP file in the folder /wp-content/mu-plugins/ on your website to replace a specific word/sentence with something else. So, change the value of $old_string to the exact sentence that should be replaced (case sensitive), and $new_string to the sentence you want to replace it with.

    <?php
    /* remove line 1 if implemented in functions.php, instead of an mu-plugin */
    function cmplz_edit_document_html($html, $type, $post_id){
      $old_string = "This is the old text you want to change"; 
      $new_string = "This is the new text you want to add."; 
      $html = str_replace($old_string, $new_string, $html); 
    return $html; 
    }
    
    add_filter('cmplz_document_html', 'cmplz_edit_document_html', 10, 3);

    #2: Edit document and stop synchronization

    When editing your document page in the Classic or Gutenberg editor, you will find a section added to the sidebar menu with options for the legal document.

    Setting this option to “Edit document and stop synchronization” will remove the shortcode and paste the text content, now ready to be edited.

    Please see this article for details about this approach: https://complianz.io/editing-legal-documents/

    Hope this helps!
    Kind regards,
    Jarno

Viewing 1 replies (of 1 total)
  • The topic ‘Changing one sentence’ is closed to new replies.