2014-01-31, 18:02
I'm having some problem with my url routing.
my initial menu is something like this:
and my routing is like:
it works weel with /news/ and /headlines/ but it fails with /stadium/ and /tickets/ because it's falling back to "show_media_modalities"
I suppose it has something to do with the order i have for last 2 routes?
Can I force just /<media_type>/ to trigger "show_media_modalities"?
Thanks
my initial menu is something like this:
Code:
def show_menu():
##########################################################
# menu = { 'headlines' : plugin.get_string(30001),
# 'news' : plugin.get_string(30002),
# 'videos' : plugin.get_string(30003),
# 'photos' : plugin.get_string(30004),
# 'stadium : plugin.get_string(30005),
# 'tickets' : plugin.get_string(30006),
# }
##########################################################
items = [
{'label': plugin.get_string(30001), 'path': plugin.url_for('show_headlines')},
{'label': plugin.get_string(30002), 'path': plugin.url_for('show_news')},
{'label': plugin.get_string(30003), 'path': plugin.url_for('show_media_modalities', media_type = 'videos')},
{'label': plugin.get_string(30004), 'path': plugin.url_for('show_media_modalities', media_type = 'photos')},
{'label': plugin.get_string(30005), 'path': plugin.url_for('show_stadium')},
{'label': plugin.get_string(30006), 'path': plugin.url_for('show_tickets')},
]
return items
and my routing is like:
Code:
@plugin.route('/headlines/')
def show_headlines():
@plugin.route('/news/')
def show_news():
media_type = "videos" | "photos"
@plugin.route('/<media_type>/')
def show_media_modalities(media_type):
@plugin.route('/stadium/')
def show_stadium():
@plugin.route('/tickets/')
def show_tickets():
it works weel with /news/ and /headlines/ but it fails with /stadium/ and /tickets/ because it's falling back to "show_media_modalities"
I suppose it has something to do with the order i have for last 2 routes?
Can I force just /<media_type>/ to trigger "show_media_modalities"?
Thanks