Tuesday, July 28, 2015

Tired of hiding the chrome on your content editor web part?

The situation: I'm lazy efficient.

The problem: When building a web part page, it gets very tiresome to always have to go into web part properties and change the Chrome to "None" so that the title and border don't show when I just want to publish web content.  I wish I could change the default option for all web parts to no chrome, because honestly, I'm usually creating my own content editor web parts to make the headings pretty anyway.

The solution: Create a new custom web part for your site which has the chrome already set to None.  Each new instance of the web part will be ready to go, so you won't have to edit the web part properties every. single. time.

Access level: To do this the recommended way, you should be a site owner for the site collection.
  1. Go to a your web part page. Click Add a Web Part (in any zone, it doesn't matter).  Select Media and Content > Content Editor.  Click the Add button.


  2. Click on the drop-down arrow on the right side of your web part title, and select Edit Web Part.

  3. In your Content Editor web part properties, expand the Appearance section, and change the Chrome Type to None.  Click the OK button to save your changes.


    Ahh! The chrome is still there!  Don't worry, you'll always see the chrome in Edit mode. Once you save the page, it will be hidden.


  4. Now you're going to export the web part you just created by clicking on the drop-down arrow next to the web part title, and selecting Export.
  5. You might get the following pop-up - click on OK twice.


  6. You should now get a prompt to save your .dwp web part file.  Save it and remember where you put it.


  7. Navigate to the Site Settings for your site collection.  (Gear icon in upper right > Site Settings.  If you're not at the top of the site collection, click on the link "Go to top level site settings" under Site Collection Administration.  If you don't have access there, request it or ask your site collection administrator to do this part for you.)

  8. Under the Web Designer Galleries section, click on Web Parts.  Click on the Files tab in the ribbon > Upload Document.  Browse to find the file you saved in step 6.  Click OK.

  9. Give your content editor web part a name and title that you'll remember (and that will distinguish it from the out-of-the-box Content Editor web part), and create a new category for your web part so that you can find it quickly. Click Save.



  10. Navigate back to your page.  Click on Add a Web Part in any zone.  Find the category you created in step 9, and click on the name of your web part.  Click the Add button.

  11. Add some content and Save your page.  You will see your content presented without the web part chrome. 
You will be able to use this custom web part throughout your site collection.  Take it a step further - if you have similar types of content that you add via content editor web parts, you can create additional custom content editors which give you a good starting point (and can help your other content contributors).

No comments:

Post a Comment