I guess the subject should be pagination, rather than static menus, but I think
this answers part of the original question.
I found a better looking way to do pagination with CSS, which is what I was
trying to do. I am still looking for ways to automate the process, but it is
not too bad to do manually, if there are only a few pages. I am sending all the
details of what I have done, in case anyone is interested.
Here is the HTML code I use with a CSS style listed below. The results are on
http://lifeisnojoke.com/riddles/, and I plan to add this to other pages, and
probably other sites.
<div class="pagination">
<ul>
<li><a href="#" class="prevnext
disablelink"><< previous</a></li>
<li><a href="#"
class="currentpage">1</a></li>
<li><a href="shortriddles.html">2</a></li>
<li><a href="sicknames.html">3</a></li>
<li><a
href="unanswered-riddles.html">4</a></li>
<li><a href="shortriddles.html"
class="prevnext">next >></a></li>
</ul>
</div>
I had to use "<<", and ">>" instead of the ASCII
codes 174 and 175, because they did not translate properly from the page file,
but it still looks fine.
It also works fine with the markup for <li> to save a little typing.
<div class="pagination">
* <a href="#" class="prevnext disablelink"><<
previous</a>
* <a href="#" class="currentpage">1</a>
* <a href="shortriddles.html">2</a>
* <a href="sicknames.html">3</a>
* <a href="unanswered-riddles.html">4</a>
* <a href="shortriddles.html" class="prevnext">next
>></a>
</div>
Here is a style I found for pagination. Apparently it was inspired by the
pagination used at http://digg.com
This is where I found the CSS code.
http://www.dynamicdrive.com/style/csslibrary/item/css_pagination_links/
<style type="text/css">
/*Credits: Dynamic Drive CSS Library */
/*URL: http://www.dynamicdrive.com/style/ */
.pagination{
padding: 2px;
}
.pagination ul{
margin: 0;
padding: 0;
text-align: left; /*Set to "right" to right align pagination
interface*/
font-size: 16px;
}
.pagination li{
list-style-type: none;
display: inline;
padding-bottom: 1px;
}
.pagination a, .pagination a:visited{
padding: 0 5px;
border: 1px solid #9aafe5;
text-decoration: none;
color: #2e6ab1;
}
.pagination a:hover, .pagination a:active{
border: 1px solid #2b66a5;
color: #000;
background-color: #FFFF80;
}
.pagination a.currentpage{
background-color: #2e6ab1;
color: #FFF !important;
border-color: #2b66a5;
font-weight: bold;
cursor: default;
}
.pagination a.disablelink, .pagination a.disablelink:hover{
background-color: white;
cursor: default;
color: #929292;
border-color: #929292;
font-weight: normal !important;
}
.pagination a.prevnext{
font-weight: bold;
}
</style>
In order to use this, I saved the above css code to buttons.css, and added a
line to default.template:
<link rel="stylesheet" href="{relocatable: buttons.css}"
type="text/css" media="screen" />
Then running webgen gave me nice pagination at the bottom of the page, but I had
to manually modify each .page file to put in the correct links.
- scottm
-----Original Message-----
From: webgen-users-bounces at rubyforge.org [mailto:webgen-users-bounces at
rubyforge.org] On Behalf Of McClelland, Scott
Sent: Tuesday, April 21, 2009 8:07 PM
To: Thomas Leitner; webgen-users at rubyforge.org
Subject: Re: [webgen-users] Generate static menus?
I was hoping to use submenus to generate navigation similar to the bottom of a
google search page, but now I see that that is not an option.
<| Gooooogle |>
Previous 1 2 3 4 5 Next
The only way I could figure out how to do something like this was to manually
add the names of the previous and next pages in the .page file, but that seems
like a lot of work to do manually.
| !images/arrow_5_left.png(previous)!:same_size.html |
!images/arrow_5_up.png(back)!:index.html |
!images/arrow_5_right.png(next)!:impossible.html |
|<a href="same_size.html">Previous</a>|<a
href="index.html">Illusions</a>|<a
href="impossible.html">Next</a>|
I suppose I could write a shell script that reads all files in the directory,
and generates this info, but I was wondering if webgen had a mechanism for this.
I thought I might be able to use the photo gallery, if I can get it to work.
- scottm
-----Original Message-----
From: webgen-users-bounces at rubyforge.org [mailto:webgen-users-bounces at
rubyforge.org] On Behalf Of Thomas Leitner
Sent: Thursday, April 02, 2009 7:35 AM
To: webgen-users at rubyforge.org
Subject: Re: [webgen-users] Generate static menus?
> I want to stack three horizontal menus on top of each other, and also
> define exactly what page will be in each menu. What files and syntax
> do I use in webgen to accomplish this? I tried finding the answer here
> and in the docs but could not figure it out.
>
> I would also like to style each menu a bit differently if that is
> possible. Actual examples especially appreciated!
For generating horizontal menus, use a menu tag like
{menu: {nested: false, min_levels: 1, show_current_subtree_only: true}}
Also have a look at the documentation for the menu tag at
http://webgen.rubyforge.org/documentation/tag/menu.html
webgen currently only has the concept of *one* menu. So, the only time
when multiple "menu lines" are generated by the above shown tag, is
when the currently viewed page is in a sub directory. For example, if
you have the following hierarchy:
/level1.page
/dir1/level2.page
/dir1/nesteddir/level3.page
And you visit the /dir1/nesteddir/level3.html file, three menu levels
are shown: one for the top level, one for the first level and one for
the second level.
Generating different menus, ie. with different menu items, is currently
not possible with the menu tag.
You can specify what gets into the menu by using the meta information
`in_menu`. Each page that has this meta info set to `true` will get
included in the menu. Note that there are different menu trees for
different languages.
Different styling for different levels can be done by using the CSS
classes set on the generated elements - these classes are documented on
the documentation page for the menu tag
( http://webgen.rubyforge.org/documentation/tag/menu.html )
-- Thomas
_______________________________________________
webgen-users mailing list
webgen-users at rubyforge.org
http://rubyforge.org/mailman/listinfo/webgen-users
_______________________________________________
webgen-users mailing list
webgen-users at rubyforge.org
http://rubyforge.org/mailman/listinfo/webgen-users