feeds-content-elements 0.0.0-canary-20240712170702
Install from the command line:
Learn more about npm packages
$ npm install @wpmedia/feeds-content-elements@0.0.0-canary-20240712170702
Install via package.json:
"@wpmedia/feeds-content-elements": "0.0.0-canary-20240712170702"
About this version
A constructor to process the various content_element types.
BuildContent() - The constructor parse(element, numRows, resizerKey, resizerURL, width, height) - pass in content_elements array, returns an html fragment string
blockquote(element) correction(element) endorsement(element) gallery(element, resizertKey. resizerURL, width, height) header(element) image(element, resizerKey, resizerURL, width, height) interstitial(element, domain) linkList(element) list(element) listElement(element) numericRating(element) oembed(element) quote(element) table(element) text(element) video(element)
absoluteUrl(url, domain) - make url fully qualified
import { BuildContent } from './contentElements'
const MyBuildContent = new BuildContent()
const myContent = MyBuildContent.parse(elements, numRows, resizerKey, resizerURL, width, height)
Using a constructor allows use of prototype inheritance to override functions
import { BuildContent } from './contentElements'
const MyBuildContent() {
BuildContent.call(this)
this.image(element, resizerKey, resizerURL, width, height) {
// custom image logic here to override existsing functionality
}
}
const NewBuildContent = new MyBuildContent()
const myContent = NewBuildContent.parse(elements, numRows, resizerKey, resizerURL, width, height)
Details
- feeds-content-elements
- WPMedia
- 7 months ago
- CC-BY-NC-ND-4.0
- 7 dependencies
Assets
- feeds-content-elements-0.0.0-canary-20240712170702.tgz
Download activity
- Total downloads 1
- Last 30 days 0
- Last week 0
- Today 0