public
Fork of halorgium/mephisto
Description: A mirror of the mephisto code-base
Homepage: http://mephistoblog.com/
Clone URL: git://github.com/technoweenie/mephisto.git
Click here to lend your support to: mephisto and make a donation at www.pledgie.com !
home paged sections link to pages without the /home prefix

git-svn-id: http://svn.techno-weenie.net/projects/mephisto/trunk@1213 
567b1171-46fb-0310-a4c9-b4bef9110e78
technoweenie (author)
Sun Jun 11 07:53:48 -0700 2006
commit  45635287abd6feb0ef49ad875b201ca0ee124b12
tree    d00cc2ac330e35c2a496dca04f9cb978a8408dca
parent  f372616a2eec7ef2c6fb4aed537fd1e3d9009313
...
8
9
10
 
11
12
13
...
8
9
10
11
12
13
14
0
@@ -8,6 +8,7 @@ class MephistoController < ApplicationController
0
       @section.show_paged_articles? ? show_section_page_with(nil, :main) : list_section_articles_with(:main)
0
     else
0
       @section, page_name = site.sections.find_section_and_page_name(params[:sections])
0
+ @section ||= site.sections.find_by_name('home')
0
       @section.show_paged_articles? ? show_section_page_with(page_name, :page) : list_section_articles_with(:section)
0
     end
0
   end
...
6
7
8
 
9
10
11
...
28
29
30
31
 
 
 
32
33
34
...
6
7
8
9
10
11
12
...
29
30
31
 
32
33
34
35
36
37
0
@@ -6,6 +6,7 @@ module Mephisto
0
 
0
       def render(context)
0
         collection = context['pages']
0
+ return if collection.blank?
0
         @section = context['section']
0
         @page = context['article']
0
         result = []
0
@@ -28,7 +29,9 @@ module Mephisto
0
       end
0
     
0
       def page_url(page, index)
0
- index.zero? && @section == 'home' ? '/' : "/#{@section}#{'/' + page['permalink'] unless index.zero?}"
0
+ path = @section == 'home' ? '' : "/#{@section}"
0
+ path << ('/' + page['permalink']) unless index.zero?
0
+ path.blank? ? '/' : path
0
       end
0
 
0
       def page_anchor_options(page, index)

Comments

    No one has commented yet.