# Custom status

**URL:** <https://www.ruby-forum.com/t/custom-status/67225>\
**Category:** Radiant CMS\
**Created:** [September 1, 2006, 1:16pm UTC](https://www.ruby-forum.com/t/custom-status/67225 "2006-09-01T13:16:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![islepilot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/ac8455/32.png) [@islepilot](https://www.ruby-forum.com/u/islepilot)\
**Post date:** [September 1, 2006, 1:16pm UTC](https://www.ruby-forum.com/t/custom-status/67225/1 "2006-09-01T13:16:01Z")

</div>

I need to add a status “Archived”, so that a page with not show up in  
the original tree, but will show up in the archive when the user  
changes the status. I have easily added the status in the status.rb  
Model and it works just great on the archive page. Was does not work  
is the link to the page. It gives me the “Page not found” page.

Is there any way to change this?

Keith B.  
http//:www.keithbingman.com

---

<div class="post-metadata">

**Author:** ![islepilot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/ac8455/32.png) [@islepilot](https://www.ruby-forum.com/u/islepilot)\
**Post date:** [September 1, 2006, 3:48pm UTC](https://www.ruby-forum.com/t/custom-status/67225/2 "2006-09-01T15:48:24Z")

</div>

Keith B. wrote:

> I need to add a status “Archived”, so that a page with not show up in  
> the original tree, but will show up in the archive when the user  
> changes the status. I have easily added the status in the status.rb  
> Model and it works just great on the archive page. Was does not work  
> is the link to the page. It gives me the “Page not found” page.
> 
> Is there any way to change this?

Not at the moment. I could see adding a method to the status object  
(Status#visible?) or something of that nature which would control  
whether or not it was seen on the live site.

Right now there are at least two places that you would need to change in  
order to get it to show up. One is in the page\_context.rb in the  
definition of children:each and the other is in site\_controller.rb (if  
my memory serves me correctly).

–  
John L.  
[http://wiseheartdesign.com](http://wiseheartdesign.com)

---

<div class="post-metadata">

**Author:** ![islepilot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/ac8455/32.png) [@islepilot](https://www.ruby-forum.com/u/islepilot)\
**Post date:** [September 2, 2006, 1:10pm UTC](https://www.ruby-forum.com/t/custom-status/67225/3 "2006-09-02T13:10:16Z")

</div>

Thanks John, that was just what I needed. The only thing I need to  
change was page.rb in Models, just added the name on the new Status to

def published?  
status == Status[:published] or Status[:archived]  
end

Very easy…

Keith B.

---

<div class="post-metadata">

**Author:** ![islepilot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/ac8455/32.png) [@islepilot](https://www.ruby-forum.com/u/islepilot)\
**Post date:** [September 2, 2006, 1:50pm UTC](https://www.ruby-forum.com/t/custom-status/67225/4 "2006-09-02T13:50:20Z")

</div>

Keith B. wrote:

> Thanks John, that was just what I needed. The only thing I need to  
> change was page.rb in Models, just added the name on the new Status to
> 
> def published?  
> status == Status[:published] or Status[:archived]  
> end

Shouldn’t that be:

(status == Status[:published]) or (status == Status[:archived])

–  
John L.  
[http://wiseheartdesign.com](http://wiseheartdesign.com)
