In This Section
- Concepts
- Data
- Build
- The Composer
- Context
- Pages
- Models
- Components
- Best Practices
- Debugging Skuid in the Console
- Logic
- Style
- Deploy
- Extend
- Reference
- API Reference
- skuid.$
- skuid.actions
- skuid.ajax
- skuid.builder.core
- skuid.builder.core.coreProps
- skuid.calendar
- skuid.collaboration
- skuid.component
- skuid.componentType
- skuid.events
- skuid.formula
- skuid.hotkeys
- skuid.label
- skuid.lightning
- skuid.load
- skuid.model
- skuid.model.Model
- skuid.mustache
- skuid.page
- skuid.sfdc
- skuid.snippet
- skuid.time
- skuid.ui
- skuid.utils
- skuid.version
- Component-Specific APIs
- Skuid Model Metadata Object
- Skuid Model Child Relationship Metadata Object
- Skuid Model Condition Metadata Object
- Skuid Model Field Metadata Object
- Skuid Model Record Type Metadata Object
- Page XML API
- skuid-sfdx
- Skuid Metadata Object Reference
- Skuid Glossary
- Formula and Function Reference
- Skuid and Date/Time
- Open Source Software Attributions
- API Reference
- Site Administration
- Tutorials
- Skuid Page Tutorials
- Add Related Lists with the Table Component
- Build an Activities Related List Tab
- Build a Custom “Create New Record” Page
- Build a Custom Detail Page
- Build a Custom List Page
- Compose a Branded Header and Navigation
- Compose a One-Page App Using Tab Actions and Conditional Rendering
- Conditionally Display Fields
- Create a Custom Clone Page
- Create a Custom “Clone Account” page
- Highlight Critical Data: Wrappers, Rich Text, and Ui-Only Fields
- Mass Create Records
- Show Products in an Opportunity Page
- Skuid Pages for standard Salesforce CRM
- Salesforce Tutorials
- JavaScript Tutorials
- Skuid Page Tutorials
- Legal terms and conditions
- Skuid SFX Evaluation Guide
In This Topic
skuid.snippet¶
Good news, everyone!
We are currently writing more material for our Javascript API. All of the objects and functions you see below are part of Skuid’s public API, even if they aren’t fully documented yet. Feel free to experiment while we write about them—and check back later for updates.
The snippet module exposes functions for registering and working with snippets. In general, the easiest way to register a snippet is to go to the Page Builder’s Resources tab, opening the Javascript area, and creating a snippet.
-
skuid.snippet.
get
¶
-
skuid.snippet.
getSnippet
(snippetName)¶ Retrieve a code snippet.
Arguments: - snippetName (string) – The name the snippet was registered under
Returns: The function which was registered under snippetName, or undefined if snippetName was not recognized.
Return type: Function
-
skuid.snippet.
register
¶
-
skuid.snippet.
registerSnippet
(snippetName, snippetFunction)¶ Registers a function as a named snippet on the page.
To avoid snippet name conflicts, you should prefix a namespace to snippetName, e.g. acme.MyAwesomeSnippet.
Arguments: - snippetName (string) – The name under which the snippet will be registered
- snippetFunction() (function) – The function to be registered
-
skuid.snippet.
unregister
¶