Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread

 

By: Interested Beginner
RE: Integrate folders (submenus) in toplevel-menu [ reply ]  
2010-07-20 18:24
Thank you,

Not easy for a beginner to handle all this small details like the two withspaces. In fact, the whitespaces and the filenames (.page) were wrong and now it works well.

What a powerfull tool webgen is!

Thankyou again!

Fabio

By: Thomas Leitner
RE: Integrate folders (submenus) in toplevel-menu [ reply ]  
2010-07-19 05:42
This forum is unfortunately not preserving whitespace, so it is difficult for me to know if your metainfo file is correct.

Please check the following:

* You are using path names like "index.html". This means that you need to have a file named "src/index.html" so that the meta information gets applied. If you really have a "src/index.page" instead, just use this name.

The reason is that the "paths" section is using the input file names and not the internally used (A)(L)CN naming scheme. This scheme can be used in the "alcn" section of a metainfo file.

* The content of each block of a metainfo file needs to be a valid YAML (http://www.yaml.org) hash. This means that each path needs to start at the column zero and that each attribute for a path needs to be indented two spaces. So it should have the following form (since this forum doesn't preserve whitespace I use the tilde (~) character for leading whitespace):

--- name:paths
index.html:
~~sort_info: 10
add/:
~~sort_info: 20

This can also be seen in the example on the metainfo sourcehandler page: http://webgen.rubyforge.org/documentation/sourcehandler/metainfo.html

By: Interested Beginner
RE: Integrate folders (submenus) in toplevel-menu [ reply ]  
2010-07-18 20:29
Thankyou for this very fast answer.

I have read the docu-page and created the
src/metainfo file with the following content:

--- name:paths
index.html:
sort_info: 10
filter.html:
sort_info: 20
list.html:
sort_info: 30
add/:
sort_info: 40
export/:
sort_info: 50
journal.html:
sort_info: 60
admin.html:
sort_info: 70

This is the error-message I got:

Starting webgen...
Updating tree...
An error has occurred:
Error while creating a node from </add/> with Webgen::SourceHandler::Directory:
can't convert nil into Hash
Of corse, there is a src/add and an src/export directory with index pages again

Any observation?

Fabio

By: Thomas Leitner
RE: Integrate folders (submenus) in toplevel-menu [ reply ]  
2010-07-18 08:27
You have to assign the sort_info key to the folders themselves by using a metainfo file (http://webgen.rubyforge.org/documentation/sourcehandler/metainfo.html).

For example, create a file called src/metainfo with the following content (assuming there is a directory called 'dir'):

dir/:
sort_info: 10

By: Interested Beginner
Integrate folders (submenus) in toplevel-menu [ reply ]  
2010-07-17 11:22
Hello,

I have found the sort_info to give an order to my menu, and it works well. Now, I try to integrate folder with submenus: In the top level menu, the folders are at the end of the menu.

How to integrate the submenu folder/places at a given place?

The sort_info in the index.page in a subfolder does not influence the place in the top-menu.

Thank you for your help

Fabio