# Page Types -- one per page

**URL:** <https://www.ruby-forum.com/t/page-types-one-per-page/90472>\
**Category:** Radiant CMS\
**Created:** [March 29, 2007, 1:18am UTC](https://www.ruby-forum.com/t/page-types-one-per-page/90472 "2007-03-29T01:18:50Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![walterdavis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/a587f6/32.png) [@walterdavis](https://www.ruby-forum.com/u/walterdavis)\
**Post date:** [March 29, 2007, 1:18am UTC](https://www.ruby-forum.com/t/page-types-one-per-page/90472/1 "2007-03-29T01:18:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![walterdavis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/a587f6/32.png) [@walterdavis](https://www.ruby-forum.com/u/walterdavis)\
**Post date:** [March 29, 2007, 1:31am UTC](https://www.ruby-forum.com/t/page-types-one-per-page/90472/2 "2007-03-29T01:31:51Z")

</div>

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](http://wiseheartdesign.com)

---

<div class="post-metadata">

**Author:** ![walterdavis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/a587f6/32.png) [@walterdavis](https://www.ruby-forum.com/u/walterdavis)\
**Post date:** [March 29, 2007, 1:23am UTC](https://www.ruby-forum.com/t/page-types-one-per-page/90472/3 "2007-03-29T01:23:50Z")

</div>

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  
removed\_email\_address@domain.invalid

[http://bitchkittyracing.com](http://bitchkittyracing.com)

---

<div class="post-metadata">

**Author:** ![walterdavis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/a587f6/32.png) [@walterdavis](https://www.ruby-forum.com/u/walterdavis)\
**Post date:** [March 29, 2007, 3:57am UTC](https://www.ruby-forum.com/t/page-types-one-per-page/90472/4 "2007-03-29T03:57:02Z")

</div>

Thanks, this is a very neat solution.

Walter

---

<div class="post-metadata">

**Author:** ![walterdavis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/a587f6/32.png) [@walterdavis](https://www.ruby-forum.com/u/walterdavis)\
**Post date:** [March 29, 2007, 5:02am UTC](https://www.ruby-forum.com/t/page-types-one-per-page/90472/5 "2007-03-29T05:02:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![walterdavis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/a587f6/32.png) [@walterdavis](https://www.ruby-forum.com/u/walterdavis)\
**Post date:** [March 29, 2007, 2:33pm UTC](https://www.ruby-forum.com/t/page-types-one-per-page/90472/6 "2007-03-29T14:33:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![walterdavis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/a587f6/32.png) [@walterdavis](https://www.ruby-forum.com/u/walterdavis)\
**Post date:** [March 29, 2007, 5:06am UTC](https://www.ruby-forum.com/t/page-types-one-per-page/90472/7 "2007-03-29T05:06:09Z")

</div>

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
```

---

<div class="post-metadata">

**Author:** ![walterdavis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/a587f6/32.png) [@walterdavis](https://www.ruby-forum.com/u/walterdavis)\
**Post date:** [March 29, 2007, 3:01pm UTC](https://www.ruby-forum.com/t/page-types-one-per-page/90472/8 "2007-03-29T15:01:07Z")

</div>

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.)

---

<div class="post-metadata">

**Author:** ![walterdavis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/a587f6/32.png) [@walterdavis](https://www.ruby-forum.com/u/walterdavis)\
**Post date:** [March 29, 2007, 5:49pm UTC](https://www.ruby-forum.com/t/page-types-one-per-page/90472/9 "2007-03-29T17:49:27Z")

</div>

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 }

---

<div class="post-metadata">

**Author:** ![walterdavis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/a587f6/32.png) [@walterdavis](https://www.ruby-forum.com/u/walterdavis)\
**Post date:** [March 29, 2007, 6:54pm UTC](https://www.ruby-forum.com/t/page-types-one-per-page/90472/10 "2007-03-29T18:54:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![walterdavis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/a587f6/32.png) [@walterdavis](https://www.ruby-forum.com/u/walterdavis)\
**Post date:** [March 29, 2007, 6:50pm UTC](https://www.ruby-forum.com/t/page-types-one-per-page/90472/11 "2007-03-29T18:50:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![walterdavis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/a587f6/32.png) [@walterdavis](https://www.ruby-forum.com/u/walterdavis)\
**Post date:** [March 30, 2007, 2:02pm UTC](https://www.ruby-forum.com/t/page-types-one-per-page/90472/12 "2007-03-30T14:02:30Z")

</div>

Andrew,  
I suggest you check out:  
[http://dev.eyebeam.org/projects/radiant-partatts/wiki](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.)
