# First Channel Issue

**URL:** <https://forums.plex.tv/t/first-channel-issue/187505>\
**Category:** Dev/API Corner\
**Tags:** plugin-dev\
**Created:** [April 5, 2017, 1:24pm UTC](https://forums.plex.tv/t/first-channel-issue/187505 "2017-04-05T13:24:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jnymris](https://avatars.discourse-cdn.com/v4/letter/j/3d9bf3/32.png) [@jnymris](https://forums.plex.tv/u/jnymris)\
**Post date:** [April 5, 2017, 1:24pm UTC](https://forums.plex.tv/t/first-channel-issue/187505/1 "2017-04-05T13:24:28Z")

</div>

Hi,

I’m currently making my first channel which Is going well. I’m able to pull the channels onto the first page. However I now want to moved channels onto a sub page using the mainmenu as a menu. Could someone point me in the right direction as to where I am going wrong?

Here is my working code: (The important bit)

```
@handler(PREFIX, TITLE, thumb=ICON, art=ART)
def MainMenu():
    oc = ObjectContainer(title2=TITLE, no_cache=True)

    xml = XML.ElementFromURL(XML_URL)

    for node in xml[0][0]:
        title = node.get('title')
        thumb = node.get('hdposterurl')
        #genrel = node.get('genrel')
        url = node.get('url')
        #ishd = node.get('ishd')
        active = node.get('active')

        if (active == 'true') or (active == '1'):
            oc.add(
                CreateVideoClipObject(
                    title=title, thumb=thumb, url=url
                    )
                )

    return oc

```

When I change it to the following It then fails to respond

```
@handler(PREFIX, TITLE)
def MainMenu():
    oc = ObjectContainer()
    oc.add(DirectoryObject(key=Callback(ChannelOpt1), title="Channel 1")))
    return oc

@route(PREFIX +'/ChannelOpt1')
def ChannelOpt1()
    oc = ObjectContainer(title2=TITLE, no_cache=True)

    xml = XML.ElementFromURL(XML_URL)

    for node in xml[0][0]:
        title = node.get('title')
        thumb = node.get('hdposterurl')
        #genrel = node.get('genrel')
        url = node.get('url')
        #ishd = node.get('ishd')
        active = node.get('active')

        if (active == 'true') or (active == '1'):
            oc.add(
                CreateVideoClipObject(
                    title=title, thumb=thumb, url=url
                    )
                )

    return oc
```

---

<div class="post-metadata">

**Author:** ![czukowski](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/czukowski/32/9008_2.png) [@czukowski](https://forums.plex.tv/u/czukowski)\
**Post date:** [April 5, 2017, 7:18pm UTC](https://forums.plex.tv/t/first-channel-issue/187505/2 "2017-04-05T19:18:34Z")

</div>

@jnymris could be anything, better check the log files. If anything goes wrong, there’ll always be an error message.

I’m spotting a missing colon after `def ChannelOpt1()`.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [January 8, 2020, 8:03pm UTC](https://forums.plex.tv/t/first-channel-issue/187505/3 "2020-01-08T20:03:18Z")

</div>


