Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating a submenu? #6

Open
leopheard opened this issue Jul 18, 2019 · 0 comments
Open

Creating a submenu? #6

leopheard opened this issue Jul 18, 2019 · 0 comments

Comments

@leopheard
Copy link

Damon,

Sorry for hijacking your plugin, but I was wondering if you could help me with a simple issue? I can see how you've created the main menu items, but how would I say create a main menu list, then a submenu and then links beyond that? e.g. Main menu listing say Music, then inside music -> Pop and Rock etc?

I've tried this but obviously doesn't work:

@plugin.route('/')
def main_menu():
    """
    main menu
    """
    items = [
    {
            'label': plugin.get_string(30010),
            'path': plugin.url_for('music'),
            'thumbnail': "image.jpg"},
    ]

    return items

@plugin.route('/music/')
def music():
    """
    contains playable podcasts listed as just-in
    """
    items = [
    {
            'label': plugin.get_string(30011),
            'path': plugin.url_for('music/rock'),
            'thumbnail': "sample.jpg"},
    ]

@plugin.route('/music/rock')
def music_rock():
    """
    contains playable podcasts listed as just-in
    """
    soup = addon.get_soup(URL)

    playable_podcast = addon.get_playable_podcast(soup)

    items = addon.compile_playable_podcast(playable_podcast)

    return items
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant