Different layouts between list and view pages?

I’m using the demo site to help me port my Typo site into Radiant. To
make
this even more complicated I’m retrofitting the popular Hemingway theme
for
my needs. Because this theme has a different view for the detail page I
need
to get Radiant to use a different template when a specific article has
been
selected but to default to the article list layout otherwise.

I’m unsure how to do this. Any tips? Thanks.

Kyle H.
[email protected]
www.kyleheon.com

Kyle H. wrote:

I’m using the demo site to help me port my Typo site into Radiant. To make
this even more complicated I’m retrofitting the popular Hemingway theme for
my needs. Because this theme has a different view for the detail page I
need
to get Radiant to use a different template when a specific article has been
selected but to default to the article list layout otherwise.

I’m unsure how to do this. Any tips? Thanks.

There is not a clean way to do this. You could put the templates in
snippets and then use <r:if_url matches=“…” /> to select the proper
snippet depending on the URL.


John L.
http://wiseheartdesign.com

Why not do it through css?

- or the URL equivalent (unsure of the code for that) and then specify an ID in your css for each unique page. That would produce really specific ID's, perhaps you could use another, less specific tag if you need something targeted to a group of pages.

Then in CSS you’d do something like:

#another-day .content{
font-size: 1.5em;
}

This is my first post to the list, I’ve been using/theming Drupal for
the past few years and I’ve found Radiant to be a great tool for my
needs! Anyway, I’d do something like this in Drupal, so I would think
the same logic would apply to Radiant.

Erik M.

It depends on how different he wants the page to be, if he’s providing a
completely separate layout, he’d need to provide a completely different
css page. I’ve been thinking of the best way to provide a print version
for every page, and one of the ways was to use the if_url command to
switch css files. Though it ended up being completely useless for me, it
would probably work well in this circumstance. You wouldn’t even
actually need a snippet if you’re providing css files, in the template
(or where ever you call the stylesheet) use:

<r:unless_url matches="/[your archive
directory]/\d{4}/\d{2}/\d{2}/.+">[your normal stylesheet]</r:unless_url>
<r:if_url matches="/[your archive directory]/\d{4}/\d{2}/\d{2}/.+">[your
article specific stylesheet]</r:if_url>