Dynamic content

This custom element dynamically loads content from any DevSite tenant or external resource that has been added to the DevSite External Content corpus.

General usage

The following example uses the <devsite-dynamic-content> custom element to dynamically load three content cards (with a maximum of six) in order of recency across all DevSite tenants.

Topic cards

The following example uses the <devsite-dynamic-content> custom element to dynamically load six topic cards (with a maximum of 12) in order of recency across all DevSite tenants. The fields attribute includes title, summary, date, product-icons, and language.

Pathways cards

The following example uses the <devsite-dynamic-content> custom element to dynamically load six pathways cards (with a maximum of 12) in order of recency across all DevSite tenants. The fields attribute includes title, summary, date, progress-bar, and skill.

Playlist and blog cards

The following example uses the <devsite-dynamic-content> custom element to dynamically load three Android playlist and blog cards (with a maximum of 12) in order of recency. The fields attribute includes title, type, attribution, and date.

The following example displays a list sorted by title of the top 12 devsite-only text search matches across all DevSite tenants for "daydream virtual reality".

Adjusting the number of columns

The <devsite-dynamic-content> custom element renders results in three columns by default. The following example is adjusted to render results in two columns by setting the items-across attribute to "2".

External content

Add external sources to your tenant configuration files and specify the origin attribute within the <devsite-dynamic-content> custom element to include external content to your results.

YouTube

The following example specifies origin:youtube within the <devsite-dynamic-content> custom element. The results dynamically load three cards (with a maximum of 12) that display the top text matches for "kotlin" in Android's YouTube videos.

Blogger

The following example specifies origin:blogger within the <devsite-dynamic-content> custom element and dynamically loads three posts from the Google Developers Blog.

Medium

The following example specifies origin:medium within the <devsite-dynamic-content> custom element. The results dynamically load three posts (with a maximum of 12) that match the attribution and author metadata.

Cloud Blog

The following example specifies tenant:cloud+type:blog within the <devsite-dynamic-content> custom element to include Google Cloud Platform Blog content in the dynamic content results.

LibSyn Podcasts

The following example specifies origin:libsyn within the <devsite-dynamic-content> custom element and dynamically loads all episodes from the "Search Off the Record" LibSyn podcast.