def route_dynamic_page(params)

      # split the url up into segments
      segments = params[:slug].split('/')

      # general variables
      url = params[:slug]
      article_url = Setting.get('articles_slug')
      category_url = Setting.get('category_slug')
      tag_url = Setting.get('tag_slug')

      status = "(post_status = 'Published' AND post_date <= CURRENT_TIMESTAMP AND disabled = 'N')"
      # is it a article post or a page post
      case get_type_by_url
      when "CT"
        render_category segments, article_url, true, status
      when "AR"
        render_archive segments, article_url
      when "A"
        render_single segments, article_url, status
      when "C"
        render_category segments, article_url, false, status
      when "P"
        render_page url, status
      end

    end
def route_dynamic_page(params)

      # split the url up into segments
      segments = params[:slug].split('/')

      # general variables
      url = params[:slug]
      article_url = Setting.get('articles_slug')
      category_url = Setting.get('category_slug')
      tag_url = Setting.get('tag_slug')

      status = "(post_status = 'Published' AND post_date <= CURRENT_TIMESTAMP AND disabled = 'N')"
      # is it a article post or a page post
      case get_type_by_url
      when "CT"
        render_category segments, article_url, true, status
      when "AR"
        render_archive segments, article_url
      when "A"
        render_single segments, article_url, status
      when "C"
        render_category segments, article_url, false, status
      when "P"
        render_page url, status
      end

    end
this is the function that gets the url and decides what to display
 with the given content. This is the main function for routing. Nearly every request runs through this function
 Params:
 +params+:: all the current parameters