The ShortPoint Code Editor Web Part features two convenient buttons that make it simple to add and reuse custom code across SharePoint pages. This article provides the steps on how to use the Import/Export feature.
TABLE OF CONTENTS
Prerequisites
- Ensure the ShortPoint Code Editor Web Part is installed on your SharePoint site. For installation instructions, read our article on How to Install ShortPoint Code Editor in SharePoint.
- You have the proper SharePoint permissions to edit the target Modern SharePoint page.
How to Import Custom Code
With one click of the Import button you can quickly add a copied custom code into the free ShortPoint Code Editor Web Part.
Step-by-step instructions
- Prepare your custom code and copy it to your clipboard.
- Edit the SharePoint page.
- Insert the ShortPoint Code Editor Web Part.
- Click Import. This will automatically populate your code into the appropriate HTML, CSS, and JavaScript fields.
- Modify or adjust settings.
- Republish the page to save the changes.
Note: When you click Import, a notification will appear asking if you want to overwrite the existing code in the ShortPoint Code Web Part. This safeguard prevents accidental code overwrites. Click OK to proceed with importing.A confirmation message will appear once the code has been imported successfully. Hit OK to close the dialogue.
How to Export Custom Code
You can reuse custom code from one SharePoint page on other pages by using the Export feature.
Step-by-step instructions
- Edit the SharePoint page that contains your existing custom code.
- Click the Edit properties button in the ShortPoint Code Editor Web Part.
- Click Export. This will automatically copy all HTML, CSS, and JavaScript code from the Code web part to your clipboard.
- Follow the import instructions above to add this code to your target page.
- Republish the page to save the changes.
With this time-saving feature, you can easily reuse custom code across any SharePoint page where the ShortPoint Code Editor Web Part is installed.
Related articles:
- ShortPoint Code Editor Web Part: List of Resources
- Getting Started With ShortPoint Code Editor Web Part
- How to Add Custom Code Using the ShortPoint Code Editor Web Part