Skip to content

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

Feeds Content Elements

A constructor to process the various content_element types.

functions

constructor

BuildContent() - The constructor parse(element, numRows, resizerKey, resizerURL, width, height) - pass in content_elements array, returns an html fragment string

member functions

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)

helpers

absoluteUrl(url, domain) - make url fully qualified

usage

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


Assets

  • feeds-content-elements-0.0.0-canary-20240712170702.tgz

Download activity

  • Total downloads 1
  • Last 30 days 0
  • Last week 0
  • Today 0