def render_category(segments, article_url = nil, term = false, status)
      category_url = Setting.get('category_slug')
      tag_slug = Setting.get('tag_slug')

      # do you want to filter the results down further than the top level
      if term

        if segments[2].blank?
          # if segment 2 is blank then you want to disply the top level article page
          redirect_to site_url(article_url)
        else
          term_type = 
            if segments[1] == category_url
              'category'
            elsif segments[1] == tag_slug
              'tag'
            else
              nil
            end
          segments.shift(2)
          term = Term.where(:structured_url => '/' + segments.join('/')).first

          # do a search for the content
          gloalize Post.joins(terms: :term_anatomy).where("post_status = 'Published' AND post_type != 'autosave' AND post_date <= CURRENT_TIMESTAMP AND disabled = 'N' AND roroacms_terms.id = ? ", term).where(roroacms_term_anatomies: {taxonomy: term_type}).order('post_date DESC').page(params[:page]).per(Setting.get('pagination_per_fe'))

          # add the breadcrumbs
          add_breadcrumb "#{article_url.capitalize}", "/#{article_url}", :title => I18n.t("helpers.routing_helper.generic.back_to", word: article_url.capitalize)
          segments.each do |f|
            term = Term.find_by_slug(f)
            if term.blank?
              render_404 and return
            end
            type_url = term.term_anatomy.taxonomy == 'tag' ? tag_slug : category_url
            add_breadcrumb "#{term.name.capitalize}", "/#{article_url}/#{type_url}#{term.structured_url}", :title => I18n.t("helpers.routing_helper.generic.back_to", word: term.name.capitalize)
          end

          do_hierarchy_templating('category')

        end

      else

        # add article homepage
        add_breadcrumb "#{article_url.capitalize}", "/#{article_url}", :title => I18n.t("helpers.routing_helper.generic.back_to", word: article_url.capitalize)
        gloalize Post.where("#{status} and post_type ='post' and disabled = 'N'").order('post_date DESC').page(params[:page]).per(Setting.get('pagination_per_fe'))

        # template Hierarchy
        do_hierarchy_templating('category')

      end

    end
def render_category(segments, article_url = nil, term = false, status)
      category_url = Setting.get('category_slug')
      tag_slug = Setting.get('tag_slug')

      # do you want to filter the results down further than the top level
      if term

        if segments[2].blank?
          # if segment 2 is blank then you want to disply the top level article page
          redirect_to site_url(article_url)
        else
          term_type = 
            if segments[1] == category_url
              'category'
            elsif segments[1] == tag_slug
              'tag'
            else
              nil
            end
          segments.shift(2)
          term = Term.where(:structured_url => '/' + segments.join('/')).first

          # do a search for the content
          gloalize Post.joins(terms: :term_anatomy).where("post_status = 'Published' AND post_type != 'autosave' AND post_date <= CURRENT_TIMESTAMP AND disabled = 'N' AND roroacms_terms.id = ? ", term).where(roroacms_term_anatomies: {taxonomy: term_type}).order('post_date DESC').page(params[:page]).per(Setting.get('pagination_per_fe'))

          # add the breadcrumbs
          add_breadcrumb "#{article_url.capitalize}", "/#{article_url}", :title => I18n.t("helpers.routing_helper.generic.back_to", word: article_url.capitalize)
          segments.each do |f|
            term = Term.find_by_slug(f)
            if term.blank?
              render_404 and return
            end
            type_url = term.term_anatomy.taxonomy == 'tag' ? tag_slug : category_url
            add_breadcrumb "#{term.name.capitalize}", "/#{article_url}/#{type_url}#{term.structured_url}", :title => I18n.t("helpers.routing_helper.generic.back_to", word: term.name.capitalize)
          end

          do_hierarchy_templating('category')

        end

      else

        # add article homepage
        add_breadcrumb "#{article_url.capitalize}", "/#{article_url}", :title => I18n.t("helpers.routing_helper.generic.back_to", word: article_url.capitalize)
        gloalize Post.where("#{status} and post_type ='post' and disabled = 'N'").order('post_date DESC').page(params[:page]).per(Setting.get('pagination_per_fe'))

        # template Hierarchy
        do_hierarchy_templating('category')

      end

    end
renders a category, tag or view all articles page
 Params:
 +segments+:: an array of the url segments split via "/"
 +article_url+:: is the url extension to show all articles
 +term+:: wether you want to display more than just the home article display i.e. /articles/category/gardening
 +status+:: the general status of the posts