def render_archive(segments, article_url)

      # add the breadcrumb
      add_breadcrumb "#{article_url.capitalize}", "/#{article_url}", :title => I18n.t("helpers.routing_helper.generic.back_to", word: article_url.capitalize)

      # add for year as minimum
      add_breadcrumb "#{segments[1]}", "/#{article_url}/#{segments[1]}", :title => I18n.t("helpers.routing_helper.generic.back_to", word: segments[1])

      # build SQL variable
      build_sql = Post.where("(disabled = 'N' AND post_status = 'Published') AND post_type = 'post' AND (EXTRACT(year from post_date) = ?)", segments[1])


      if !segments[2].blank?
        #  add to SQL query
        build_sql = build_sql.where("EXTRACT(month from post_date) = ?", segments[2])
        # add the breadcrumbs
        add_breadcrumb "#{get_date_name_by_number(segments[2].to_i)}", "/#{article_url}/#{segments[1]}/#{segments[2]}", :title => I18n.t("helpers.routing_helper.generic.back_to", word: segments[2])
      end

      if !segments[3].blank?
        #  add to SQL query
        build_sql = build_sql.where("EXTRACT(day from post_date) = ?", segments[3])
        # add the breadcrumbs
        add_breadcrumb "#{segments[3]}", "/#{article_url}/#{segments[1]}/#{segments[2]}/#{segments[3]}", :title => I18n.t("helpers.routing_helper.generic.back_to", word: segments[3])
      end


      #  add to SQL query
      build_sql = build_sql.where("post_date <= NOW()")

      #  do seach for the content within the given parameters
      gloalize build_sql.order('post_date DESC').page(params[:page]).per(Setting.get('pagination_per_fe'))

      do_hierarchy_templating('archive')

    end
def render_archive(segments, article_url)

      # add the breadcrumb
      add_breadcrumb "#{article_url.capitalize}", "/#{article_url}", :title => I18n.t("helpers.routing_helper.generic.back_to", word: article_url.capitalize)

      # add for year as minimum
      add_breadcrumb "#{segments[1]}", "/#{article_url}/#{segments[1]}", :title => I18n.t("helpers.routing_helper.generic.back_to", word: segments[1])

      # build SQL variable
      build_sql = Post.where("(disabled = 'N' AND post_status = 'Published') AND post_type = 'post' AND (EXTRACT(year from post_date) = ?)", segments[1])


      if !segments[2].blank?
        #  add to SQL query
        build_sql = build_sql.where("EXTRACT(month from post_date) = ?", segments[2])
        # add the breadcrumbs
        add_breadcrumb "#{get_date_name_by_number(segments[2].to_i)}", "/#{article_url}/#{segments[1]}/#{segments[2]}", :title => I18n.t("helpers.routing_helper.generic.back_to", word: segments[2])
      end

      if !segments[3].blank?
        #  add to SQL query
        build_sql = build_sql.where("EXTRACT(day from post_date) = ?", segments[3])
        # add the breadcrumbs
        add_breadcrumb "#{segments[3]}", "/#{article_url}/#{segments[1]}/#{segments[2]}/#{segments[3]}", :title => I18n.t("helpers.routing_helper.generic.back_to", word: segments[3])
      end


      #  add to SQL query
      build_sql = build_sql.where("post_date <= NOW()")

      #  do seach for the content within the given parameters
      gloalize build_sql.order('post_date DESC').page(params[:page]).per(Setting.get('pagination_per_fe'))

      do_hierarchy_templating('archive')

    end
renders a archive of articles - this could do with some refactoring
 Params:
 +segments+:: an array of the url segments split via "/"
 +article_url+:: is the url extension to show all articles