From: Samuel Kvarnbrink Date: 2004-01-27T03:54:50+09:00 Subject: Re: amrita-nuby question: generate "id=" Since the "id" attribute has a special meaning for Amrita itself, you have to use a workaround. If you need to define id attributes (that is, id attributes that are to be present in Amrita's output), you can insert an "__id__" attribute. During Amrita's processing, all "__id__" attributes are renamed to "id" attributes. Something like this should do the trick: tmpl = TemplateText.new < END data = {:links => ["item 1", a(:__id__ => "active"){"item 2 (active)"}, "item 3"]} > Hi, > i'm using Amrita to generate static website pages, and having fun with > it! Now I'd like to have a navigationlist, a list where the items are > urls; all fine, but I'd like to designate one particular list-item as > "active", which is defined as id selector in the css-stylesheet for > the pages. > > So the generated html-code should look something like this: > > > > However, I cannot find a way to have Amrita generate the value > "active" for the id attribute in a list-item. I did manage, as a > side-test, to use a css class instead of an id selector, and had it > generated by Amrita, but cannot get it working with the id-selector. > In my template, I set amrita_id to 'amrita_id'. > > So my question is, how to generate a '< id="" > ....>' with Amrita? > > thxia, > Harry >