cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergio Carvalho <>
Subject [donation] SectionCutter action
Date Sun, 14 Oct 2001 21:57:44 GMT

I'm sorry for the delay sending the section cutter action I talked about in a
thread some days ago. I had plans for implementing regexp matching on the action
before donating it to the Cocoon project, but too many last-minute tasks pop up
too often :-( I'll try to pick this up next weekend.

The action is used like this:
1) Declare the action in the map:actions element of the sitemap. Define the
different site sections, and the variables there:
     <map:action name="cut-section" 
        <section pattern="jogos">
          <set-var name="section" value="jogos" />
          <set-var name="title" value="Jogos" />
        <section pattern="forums/read/chat/quadro/">
          <set-var name="section" value="chat" />
          <set-var name="title" value="Chat" />
          <set-var name="dart" value="" />

2) Use the action on the sitemap, just like all other actions:
     <map:match pattern="**">
       <map:act type="cut-section">

The variables defined with set-var on the section definition will be available
in the sitemap as {section}, {title}, {dart} for the example above.

Currently, the pattern matches against the beggining of the URI, with no
wildcards. I plan (need) to have it match regular expressions.


Sergio Carvalho

If at first you don't succeed, skydiving is not for you

View raw message