# Default options

**URL:** <https://www.ruby-forum.com/t/default-options/86331>\
**Category:** Radiant CMS\
**Created:** [February 21, 2007, 3:24pm UTC](https://www.ruby-forum.com/t/default-options/86331 "2007-02-21T15:24:43Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Minor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b38774/32.png) [@David\_Minor](https://www.ruby-forum.com/u/David_Minor)\
**Post date:** [February 21, 2007, 3:24pm UTC](https://www.ruby-forum.com/t/default-options/86331/1 "2007-02-21T15:24:43Z")

</div>

Are there really only 4 available config params to set in radiant?  
from app/models/radiant/config.rb:

# admin.title :: the title of the admin system

# admin.subtitle :: the subtitle of the admin system

# default.parts :: a comma separated list of default page parts

# dev.host :: the hostname where draft pages are viewable

I’m looking for a way to set the default published status of a page  
on creation (while I’m rapidly adding content).

Also, I assume there is no way to preview a page in draft status in  
the site layout?

Thanks,  
dm

---

<div class="post-metadata">

**Author:** ![David\_Minor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b38774/32.png) [@David\_Minor](https://www.ruby-forum.com/u/David_Minor)\
**Post date:** [February 21, 2007, 4:06pm UTC](https://www.ruby-forum.com/t/default-options/86331/2 "2007-02-21T16:06:49Z")

</div>

> Also, I assume there is no way to preview a page in draft status in  
> the site layout?

\<r:children:each status=“any”\>  
…  
\</r:children:each\>

-jamie

---

<div class="post-metadata">

**Author:** ![David\_Minor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b38774/32.png) [@David\_Minor](https://www.ruby-forum.com/u/David_Minor)\
**Post date:** [February 22, 2007, 4:21am UTC](https://www.ruby-forum.com/t/default-options/86331/3 "2007-02-22T04:21:26Z")

</div>

David Minor wrote:

> Are there really only 4 available config params to set in radiant?

Yes.

> I’m looking for a way to set the default published status of a page  
> on creation (while I’m rapidly adding content).

There isn’t a way to do this right now, though I admit this is annoying  
especially during the site creation phase. I’m open to the idea of  
adding a config value for this.

> Also, I assume there is no way to preview a page in draft status in  
> the site layout?

Nope. Not unless you use the facets branch with the page preview  
extension.

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

---

<div class="post-metadata">

**Author:** ![David\_Minor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b38774/32.png) [@David\_Minor](https://www.ruby-forum.com/u/David_Minor)\
**Post date:** [February 22, 2007, 5:09am UTC](https://www.ruby-forum.com/t/default-options/86331/4 "2007-02-22T05:09:59Z")

</div>

You can also disable caching permanently by modifying the show\_page  
method of the SiteController

def show\_page  
response.headers.delete(‘Cache-Control’)  
url = params[:url].to\_s  
show\_uncached\_page(url)  
end

I recommend leaving the original code for show\_page there and commented  
out, and making sure you put it back to normal when you go to a  
production environment.

---

<div class="post-metadata">

**Author:** ![David\_Minor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b38774/32.png) [@David\_Minor](https://www.ruby-forum.com/u/David_Minor)\
**Post date:** [February 22, 2007, 4:28pm UTC](https://www.ruby-forum.com/t/default-options/86331/5 "2007-02-22T16:28:56Z")

</div>

John W. Long wrote:

> There isn’t a way to do this right now, though I admit this is annoying  
> especially during the site creation phase. I’m open to the idea of  
> adding a config value for this.

This is now implemented in mental:

[http://dev.radiantcms.org/radiant/changeset/343](http://dev.radiantcms.org/radiant/changeset/343)

Now you can do the following from script/console:

> > Radiant::Config[‘defaults.page.status’] = ‘published’

And by default new pages will be created with the published status.

Also note that ‘default.parts’ has been renamed ‘defaults.page.parts’.  
The new list of keys is:

admin.title : the title of the admin system  
admin.subtitle : the subtitle of the admin system  
defaults.page.parts : a comma separated list of default page parts  
defaults.page.status : a string representation of the default status  
dev.host : the hostname where draft pages are viewable

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

---

<div class="post-metadata">

**Author:** ![David\_Minor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b38774/32.png) [@David\_Minor](https://www.ruby-forum.com/u/David_Minor)\
**Post date:** [February 22, 2007, 5:53pm UTC](https://www.ruby-forum.com/t/default-options/86331/6 "2007-02-22T17:53:17Z")

</div>

> dev.host : the hostname where draft pages are viewable

Interesting! Does this require use of the ‘multiple domain names’  
extension?  
-jamie

---

<div class="post-metadata">

**Author:** ![David\_Minor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b38774/32.png) [@David\_Minor](https://www.ruby-forum.com/u/David_Minor)\
**Post date:** [February 22, 2007, 5:11am UTC](https://www.ruby-forum.com/t/default-options/86331/7 "2007-02-22T05:11:04Z")

</div>

Jacob B. wrote:

> def show\_page  
> response.headers.delete(‘Cache-Control’)  
> url = params[:url].to\_s  
> show\_uncached\_page(url)  
> end

This will also show pages that have “Draft” status.

---

<div class="post-metadata">

**Author:** ![David\_Minor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b38774/32.png) [@David\_Minor](https://www.ruby-forum.com/u/David_Minor)\
**Post date:** [February 23, 2007, 3:07am UTC](https://www.ruby-forum.com/t/default-options/86331/8 "2007-02-23T03:07:20Z")

</div>

On Feb 21, 2007, at 9:20 PM, John W. Long wrote:

> > Also, I assume there is no way to preview a page in draft status in  
> > the site layout?
> 
> Nope. Not unless you use the facets branch with the page preview  
> extension.

John,

so what does the dev.host config option do?

Thanks for adding the new config option for status.

dm

---

<div class="post-metadata">

**Author:** ![David\_Minor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b38774/32.png) [@David\_Minor](https://www.ruby-forum.com/u/David_Minor)\
**Post date:** [February 23, 2007, 4:37pm UTC](https://www.ruby-forum.com/t/default-options/86331/9 "2007-02-23T16:37:05Z")

</div>

David Minor wrote:

> so what does the dev.host config option do?

It allows you to preview “draft” pages:

[http://dev.radiantcms.org/radiant/wiki/HowToDevAndProduction](http://dev.radiantcms.org/radiant/wiki/HowToDevAndProduction)

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