section map

Frederick Ros sl33p3r at free.fr
Thu Sep 23 15:38:24 EDT 2004


William Morgan wrote :
| Bug-fixed and renamed: 
| 
| http://www.masanjin.net/~wmorgan/section_map.rb

I had to modify it a little bit to make it xhtml 1.0 compliant. In fact
I added an sidebar_section_map_xhtml_erb function copied from the
original one and slightly modified:

  def sidebar_section_map_xhtml_erb
    %q{
    <div class="sidebarBox">
    <h2 class="sidebarTitle">Sections</h2>
    <% curlev = -1 %>
    <% section_list(weblog.storage.find).each do |name, path, lev, num|
    %>
      <% if (lev > curlev) %>
        <% (lev - curlev).times do %> <ul> <% end %>
      <% elsif (curlev > lev) %>
        <% (curlev - lev).times do %> </ul></li><% end %>
      <% else %>
        </li>
      <% end %>
      <% curlev = lev %>
      <li>
        <a href="<%= weblog.link %><%= path %>"><%= name %></a><% if num
	!= 0 then %>: <%= num %> <% end %>
      
    <% end %>
    <% (curlev+1).times do %>
      </li></ul>
    <% end %>
    </div>
    }
  end

Hope this helps :)

-- 
Frederick Ros aka Sleeper

"By golly, I'm beginning to think Linux really *is* the best thing since
sliced bread."
(By Vance Petree, Virginia Power)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/hobix-is-the-way/attachments/20040923/36c9d405/attachment.bin


More information about the Hobix-is-the-way mailing list