I could easily ﬁll many
hours talking about all the ways to tweak Radiant with extensions, so I'm going to give you the 10,000-foot view of the primary techniques.
#1 : new tags The
ﬁrst and simplest way to add functionality is to deﬁne new Radius tags. As I said before, Radius is the template language used to expose dynamic functionality to the designer and content editor,
be kind, I’m sensitive Because
many tags are sensitive to their surrounding environment, you can easily do things like iteration, changing some locals property on each step of the iteration, and causing contained tags to use that property.
children.map do |child| tag.locals.page =
child tag.expand end.join This is essentially what the `r:children:each` tag does - iterate on each of the children, changing `tag.locals.page` on each iteration, then joining the output. To trigger rendering of a tag's contents, we just call `tag.expand`.
# for each link... if
url == page.url tag.locals.hash[:here].call end Then the quot;navigationquot; tag calls the quot;herequot; block when the passed URL exactly matches the current page's URL. It uses the same technique to render preﬁx-matching and non-matching links by capturing blocks.
#2: Admin UI So now
that we can customize page output with tag deﬁnitions, let's look at the next big area of customization -- the admin UI.
fine-grained regions Luckily, you can
inject a view partial into any number of deﬁned quot;regionsquot; in the view template you want to modify, without overwriting the whole thing. This is enabled again through the admin object.
5-minute cache with headers Radiant
nicely captures the response headers and status when caching pages so, if we want to cache this, it won't have to call our process method again for 5 minutes after the ﬁrst render.
GET HEAD cache Now you
may have noticed that when I walked through the SiteController workﬂow, it only checks for cached versions of a page on GET or HEAD requests.
POST PUT DELETE don’t cache
This means that when a page receives POST, PUT, or DELETE, you can do cool stu with the data in the request.