           .hideAllContentDisplays contentDisplay
         contentDisplay.emit 'handleQuery', query
       else if state?
-        @openContent name, section, state, route, query
+        @openContent name, section, models, route, query
       else
         @loadContent name, section, slug, route, query
 

      '/:name?/Dashboard'               : (routeInfo, state, route)->
        {name} = routeInfo.params
        n = name ? 'koding'
        KD.remote.cacheable n, (err, [group], nameObj)=>
          @openContent name, 'Groups', group, route

      # content
      '/:name?/Topics/:slug'            : createContentHandler 'Topics'

        else                      "#{model.title}#{getSectionName model}"
    , maxLength: 100) # max char length of the title

  openContent:(name, section, models, route, query)->

    [model] = models
    KD.getSingleton("appManager").tell section, 'createContentDisplay', model,
      (contentDisplay)=>
        @openRoutes[route] = contentDisplay
        @openRoutesById[contentDisplay.id] = route
        contentDisplay.emit 'handleQuery', query

  loadContent:(name, section, slug, route, query)->

    routeWithoutParams = route.split('?')[0]
    # return log name, ">>>>>"

    onSuccess = (models)=> @openContent name, section, models, route, query
    onError   = (err)=>
      new KDNotificationView title: err?.message or 'An unknown error has occured.'
      @handleNotFound route

    if name
      KD.remote.cacheable name or routeWithoutParams, (err, models)=>
        if models?
        then onSuccess models
        else onError err
    else
      KD.remote.api.JName.one {name: routeWithoutParams}, (err, jName)=>
        if err then onError err
        else if jName?
          models = []
          jName.slugs.forEach (aSlug, i)=>
            {constructorName, usedAsPath} = aSlug
            selector = {}
            konstructor = KD.remote.api[constructorName]
            selector[usedAsPath] = aSlug.slug
            konstructor?.one selector, (err, model)=>
              return onError err if err?
              if model
                models[i] = model
                if models.length is jName.slugs.length
                  onSuccess models
        else onError()

  createContentDisplayHandler:(section)->
    ({params:{name, slug}, query}, models, route)=>

      route = name unless route
      contentDisplay = @openRoutes[route.split('?')[0]]
      if contentDisplay?
