Page Types -- one per page

I have been fooling around with the various extensions for Mental, and
think they are an amazingly simple way to work. But there’s a problem
with that simplicity. I tried out the Search extension, works great,
lots of tags to use, etc. I made a Search page, everything works pretty
well (it found my css page, which was odd – must figure out a way to
exclude certain pages Real Soon Now).

But then I want to put search on every page. No problem, I’ll put it in
the header. Oops, can’t do that – you can’t add the extensions there.
Managed to put it in the sidebar of the home page, that worked fine,
but then on my Contact page (a Mailer page which did not define its own
sidebar) the Home sidebar was inherited but without the Search
functionality – so I got a broken tag warning. So then I have to
define a new sidebar for that page without the search, because I can’t
add Mailer and Search to the same page.

Yikes! I’m confused.

Walter

Walter Lee D. wrote:

but then on my Contact page (a Mailer page which did not define its own
sidebar) the Home sidebar was inherited but without the Search
functionality – so I got a broken tag warning. So then I have to
define a new sidebar for that page without the search, because I can’t
add Mailer and Search to the same page.

Assign the Search page type to your search results page. Then, to use it
on other pages, just use normal HTML form tags:

Search:


John L.
http://wiseheartdesign.com

These are both pretty old Behaviors, ported over to the new extension
system. With the new system, it shouldn’t be too hard to make the
tags usable across a site, though I haven’t investigated either of
these extensions since they first came out as behaviors. I think
John posted something to this effect about the mailer extension a day
or two ago.

Keith B.
Tel: +49-7731-79838380
[email protected]

http://bitchkittyracing.com

Thanks, this is a very neat solution.

Walter

Walter,

When i ported the Search behavior, I thought about making a global tag
for a block of code that would create a search form. But really in
the end it was easier to write 4-5 lines of HTML than to write a bunch
of Ruby – just as John demonstrated. Caveat emptor!

Sean

So if I wanted to roll this up in a tag, say call it
search:globalinput, how would I go about doing this? Is there a simple
way to just roll up a bunch of literal HTML into a tag? And having done
so, how would I register it as being completely global, such that I
could use it in the header or footer?

Walter

On Mar 28, 2007, at 7:31 PM, John W. Long wrote:

Interestingly, when I first came to Radiant, I didn’t even think
about not using tags…

adam

Hello all!

Been a while since I’ve pestered you all, and I’ve been working on my
site a lot. I did come up with an idea that would improve my life and
likely many others. Right now, Radiant’s input is essentially a big text
box and multiple parts/sections capable. Now, here is my thought; I tend
to have some ‘common’ options throughout my site, and it’d be easier to
do a radio button selection, or check boxes, or similar. Also, there
are some common links I tend to use. Right now for some of it I use
either the existence of certain tabs or data within certain tabs to
support this. Here’s the thought

For tabs, instead of allowing straight text, why not allow the building
of ‘options’ pages. IE:- There’d be ‘body’, ‘extended’, and ‘options’,
and options would be inherited from parent for ease of adding it, and it
would be a list of options and variables. For example. I do reviews. I
have three styles of reviews right now: Full (Normal) review, Quick
overviews and Follow-Up reviews. I’d love to have a radio button set
that I could set up that it’d change some of the underlying structure
(Which is commong between them all) based on which is chosen. You could
(I’m not) also be able to make a short text entry box for a rating
‘number’ that’d show up in a floating div to the side of the review, or
a check-box to allow an image to show up ‘Me-Approved!’

On top of this, you could also eventually add image and file support
including an uploader. This would be extremely handy if you have a
common screenshot div that you’d like to just add quickly. Allow you to
select from a server-side location for the file or an automatic
uploader.

Ideas or suggestions? I know I may be vague, but it was my brainstorm
this morning on how to extend Radiant.

Thanks!
BladedThoth
(Andrew K.)

module SearchTags
include Radiant::Taggable

tag “search” do |tag|
tag.expand
end

tag “search:globalinput” do |tag|
url = tag.attr[‘url’]
%{

Search:

} end end

Page.class_eval { include SearchTags }

No, that just makes all pages have the tag that emits the search form.
You still have to specify the url of the actual SearchPage… I
didn’t want to make any assumptions about that.

Sean

On Mar 29, 2007, at 11:48 AM, Sean C. wrote:

Page.class_eval { include SearchTags }

Cool! So I do this, and suddenly any Page can be a Search page? This is
so amazing – like OO can suddenly flow uphill!

Walter

Andrew,
I suggest you check out:
http://dev.eyebeam.org/projects/radiant-partatts/wiki

This extension/hack of Radiant gives all your pages an “attributes” tab
where you can add named strings, bools, links, and files… (and then
reference them from r: tags)

Andrew K. wrote:

Hello all!

Been a while since I’ve pestered you all, and I’ve been working on my
site a lot. I did come up with an idea that would improve my life and
likely many others. Right now, Radiant’s input is essentially a big text
box and multiple parts/sections capable. Now, here is my thought; I tend
to have some ‘common’ options throughout my site, and it’d be easier to
do a radio button selection, or check boxes, or similar. Also, there
are some common links I tend to use. Right now for some of it I use
either the existence of certain tabs or data within certain tabs to
support this. Here’s the thought

For tabs, instead of allowing straight text, why not allow the building
of ‘options’ pages. IE:- There’d be ‘body’, ‘extended’, and ‘options’,
and options would be inherited from parent for ease of adding it, and it
would be a list of options and variables. For example. I do reviews. I
have three styles of reviews right now: Full (Normal) review, Quick
overviews and Follow-Up reviews. I’d love to have a radio button set
that I could set up that it’d change some of the underlying structure
(Which is commong between them all) based on which is chosen. You could
(I’m not) also be able to make a short text entry box for a rating
‘number’ that’d show up in a floating div to the side of the review, or
a check-box to allow an image to show up ‘Me-Approved!’

On top of this, you could also eventually add image and file support
including an uploader. This would be extremely handy if you have a
common screenshot div that you’d like to just add quickly. Allow you to
select from a server-side location for the file or an automatic
uploader.

Ideas or suggestions? I know I may be vague, but it was my brainstorm
this morning on how to extend Radiant.

Thanks!
BladedThoth
(Andrew K.)