Rescue nil for sitemap
This commit is contained in:
parent
cb7b7c4edf
commit
242878a09f
|
@ -31,10 +31,10 @@ class FrontController < ApplicationController
|
||||||
|
|
||||||
def show_site_sub_menu
|
def show_site_sub_menu
|
||||||
@page = Page.find(:all, :conditions => {:name => /sitemap/i})
|
@page = Page.find(:all, :conditions => {:name => /sitemap/i})
|
||||||
@name = @page.first.name
|
@name = @page.first.name if @page.first.present?
|
||||||
@url = "/#{@name}"
|
@url = "/#{@name}"
|
||||||
|
|
||||||
if !@site.sitemap_menu_in_header
|
if (!@site.sitemap_menu_in_header && @page.first.present?)
|
||||||
render :text => (@site.sub_menu + "<a href='#{@url}'>Sitemap</a>")
|
render :text => (@site.sub_menu + "<a href='#{@url}'>Sitemap</a>")
|
||||||
else
|
else
|
||||||
render :text => @site.sub_menu
|
render :text => @site.sub_menu
|
||||||
|
|
Loading…
Reference in New Issue