Skip to content

Guide - Tips - News - How To

Add lib to the code

After creating your app on goconsole and downloading your code, verify that the goconsole sdk aar file has the last version, otherwise download it from here Download

Verify sdk version!

Guide - Tips - News - How To App

Add your articles in the News/Articles section Create news

Create a metadata named : CATEGORIES or use the existing one

Edit metadata fo categories!

This metadata will contains a JSON Array with all categories and articles (news) using their ids

You can use this website to be sure to format your json data correclty : json formatter

Where to get ids :

Get news ids!

like this

    [
        {
            "id": 1,
            "name": "Cat 1 title",
            "elements": [
            287771,
            287780,
            287799
            ]
        },
        {
            "id": 2,
            "name": "Cat 2 title",
            "elements": [
            287750,
            287751,
            287752,
            287753,
            287754
            ]
        },
        {
            "id": 3,
            "name": "Cat 3 title",
            "elements": [
            287795,
            287797,
            287798
            ]
        }
    ]

Where:

*id* : the category id ( you can put any id here (must be integer and uniq))

*name* : name of the category (put the name you want to see in your application)

*elements* : Contains an array of articles ids (news id) separated by ","

Number of banner ads on Category and article list

You can control where to show banner ads on the Category and article list, just use the metadata declaration :

ADS_EVERY_CAT_ITEM : by default, the value is 3, so for every 3 category items, a banner will be insered

Control ads every number of cats!

ADS_EVERY_ARTICLE_ITEM : by default, the value is 3, so for every 3 article items, a banner will be insered

Control ads every number of articles!

Control html template for Article Detail

You can personalize the display for article content using the metadata : HTML_DETAIL_TEMPLATE

Edit guide html template!

The default content is :

        <html>
            <head>
                <meta name="viewport" content="width=device-width, user-scalable=no" />
                <style>body {line-height: 170%;text-align:justify;}</style>
            </head>

            <body style='padding-bottom:60px'>
            ##content##
            </body>

        </html>

You can use any template you want, just make sur to use the ##content## in your template