Module: TagLib

Includes:
CustomTags
Included in:
ApplicationHelper
Defined in:
lib/tag_lib.rb

Instance Method Summary collapse

Instance Method Details

#current_pageObject



4
5
6
# File 'lib/tag_lib.rb', line 4

def current_page
	params[:title_sanitized] ? params[:title_sanitized] : nil
end

#items(*args) ⇒ Object



55
56
57
58
59
60
61
62
63
64
65
# File 'lib/tag_lib.rb', line 55

def items(*args)
  options = args.extract_options!
  options[:items] ||= @current_website.available_items.split(',')
  search = Search.new(setting_searching_params(:from_params => build_params(options)))
  items = search.do_search
  str = ""
  items.each do |item|
    str += "<li>" + (link_to item.title, "/#{item.class.to_s.underscore}/#{item.title_sanitized}") + "</li>"
  end
  return str
end

#page_bodyObject



8
9
10
# File 'lib/tag_lib.rb', line 8

def page_body
  liquidize_page_body(@item ? (render :partial => 'websites/show') : (render :partial => 'websites/page') )
end

#page_descriptionObject



21
22
23
24
# File 'lib/tag_lib.rb', line 21

def page_description
  result ||= @site_page || @item || @current_website
  return result.description
end

#page_keywordsObject



26
27
28
# File 'lib/tag_lib.rb', line 26

def page_keywords
  @site_page ? @site_page.keywords_list : ''
end

#page_titleObject



12
13
14
15
# File 'lib/tag_lib.rb', line 12

def page_title
  result ||= @site_page || @item || @current_website 
  return result.title
end

#pathObject



17
18
19
# File 'lib/tag_lib.rb', line 17

def path
  "/#{WEBSITE_FILES}/#{@current_website.title}"
end

#powered_byObject



38
39
40
41
# File 'lib/tag_lib.rb', line 38

def powered_by
  str = 'Powered By'
  str += link_to 'ThinkDRY : Blank Application', 'http://www.blankapplication.org'
end

#site_descriptionObject



34
35
36
# File 'lib/tag_lib.rb', line 34

def site_description
  @current_website.description
end

#site_titleObject



30
31
32
# File 'lib/tag_lib.rb', line 30

def site_title
  @current_website.title
end