34 lines
964 B
Ruby
34 lines
964 B
Ruby
|
|
class ArticlesController < ApplicationController
|
||
|
|
|
||
|
|
caches_page :index, :show
|
||
|
|
|
||
|
|
def index
|
||
|
|
@featured_articles = Article.published.featured(Settings.resources.featured_articles)
|
||
|
|
@articles = Article.cute_ordered.published - @featured_articles
|
||
|
|
end
|
||
|
|
|
||
|
|
def show
|
||
|
|
@article = Article.find_by_slug(params[:id])
|
||
|
|
|
||
|
|
if @article
|
||
|
|
if @article.keyword1.present?
|
||
|
|
@meta_title = I18n.t('txt.articles.meta_title_with_keyword', :title => @article.title, :keyword => @article.keyword1)
|
||
|
|
else
|
||
|
|
@meta_title = I18n.t('txt.articles.meta_title', :title => @article.title)
|
||
|
|
end
|
||
|
|
if @article.custom_subtemplate.blank?
|
||
|
|
@subtemplate = SubtemplateType.with_keywords('article-sidebar', @article)
|
||
|
|
else
|
||
|
|
@subtemplate = @article.custom_subtemplate
|
||
|
|
end
|
||
|
|
respond_to do |format|
|
||
|
|
format.html
|
||
|
|
end
|
||
|
|
else
|
||
|
|
respond_to do |format|
|
||
|
|
format.html { render_404 }
|
||
|
|
end
|
||
|
|
end
|
||
|
|
end
|
||
|
|
end
|