Tutorials

Basic native article landing page

This example sets up a basic landing page for native articles. It uses the builtin adk.native.article provider that loads a specific article. The id of the article is provided via the itemId function, which extracts the id from the path.

Setup
adk.config()
    .addTemplate('com.advisible.native.article', adk.template.config()
        .url('article.html'))
    .addContainer('native-article', adk.container.config()
        .provider('adk.native.article')
        .params({
            itemId: ..., // < --Insert id extraction command here.
        }))
    .apply()
    .init(publisherId)
Template
<img style="max-width: 100%;" %srcAttrs% />
<div>%advertiser%</div>
<h1>%headline%</h1>
<div>%lead%</div>
<div>%body%</div>
Result