0

Is there a way of when creating a 'Post' when you click on 'create' there is a standard format already in the body of your post?

I have to keep copying and pasting into the body and wonder if there was a quicker way?

The standard format never changes there all topics that need to be commented about.

Thanks

Paul

1

Are you using discussion board app? You can add default value to your body textarea on the default new form.

Open your list, click "List" tab at the top ribbon banner, select Form Web Parts -> Default New Form:

enter image description here

In the default new form edit mode view, add a content editor webpart. Click on the webpart area, click edit source at ribbon bar. Then insert below script:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$(document).ready(function() { 
var textContent = 'Standard text in the body of your posts';
$('div[id$="TextField_inplacerte"').text(textContent);
});
</script>​​​​​​
1
  • No I am using a Blog app - I did try code above and it came up with an error. – Paul Aug 16 '19 at 9:53
1

I want to piggy-back on Mark's answer and make it work for the blog

Code to inject to CEWP:

<script>
    $("[id^='Body_'] p").innerHTML = "<h1>Standard text in the body of your posts!<h1>"
</script>
  • In Web part properties, Appearance > Chrome Type: None to hide the webpart's border
  • Save your page and enjoy.
1
  • 1
    Yes I believe it should work. – Mark L Aug 27 '19 at 1:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.