# Howto determine dev mode?

**URL:** <https://www.ruby-forum.com/t/howto-determine-dev-mode/109381>\
**Category:** Radiant CMS\
**Created:** [July 13, 2007, 10:25pm UTC](https://www.ruby-forum.com/t/howto-determine-dev-mode/109381 "2007-07-13T22:25:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bodikp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e79b87/32.png) [@bodikp](https://www.ruby-forum.com/u/bodikp)\
**Post date:** [July 13, 2007, 10:25pm UTC](https://www.ruby-forum.com/t/howto-determine-dev-mode/109381/1 "2007-07-13T22:25:46Z")

</div>

One of the cool things of radiant is that [dev.yourdomain.com](http://dev.yourdomain.com) shows  
radiant  
in development modes… so you can see the draft pages…

BUT I would like to turn of some of the live scripts… like google  
analytics  
javascript. Is there an easy way to determine if a page is rendered in  
development mode ?

Thanks,

Peter

---

<div class="post-metadata">

**Author:** ![bodikp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e79b87/32.png) [@bodikp](https://www.ruby-forum.com/u/bodikp)\
**Post date:** [July 16, 2007, 8:57pm UTC](https://www.ruby-forum.com/t/howto-determine-dev-mode/109381/2 "2007-07-16T20:57:58Z")

</div>

Peter B. wrote:

> One of the cool things of radiant is that [dev.yourdomain.com](http://dev.yourdomain.com) shows radiant  
> in development modes… so you can see the draft pages…
> 
> BUT I would like to turn of some of the live scripts… like google analytics  
> javascript. Is there an easy way to determine if a page is rendered in  
> development mode ?

Not presently. You could make a \<r:if\_dev\> and a \<r:unless\_dev\> tag to  
fix the problem. I’d probably even accept a patch for these tags. They  
seem generally useful.

–  
John

---

<div class="post-metadata">

**Author:** ![bodikp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e79b87/32.png) [@bodikp](https://www.ruby-forum.com/u/bodikp)\
**Post date:** [July 16, 2007, 9:02pm UTC](https://www.ruby-forum.com/t/howto-determine-dev-mode/109381/3 "2007-07-16T21:02:58Z")

</div>

Hi John,

Thanks, I will give a shot at it. Seems like a good way to return  
something  
back to the community :).

Peter.

On 7/16/07, John L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Site: [http://lists.radiantcms.org/mailman/listinfo/radiant](http://lists.radiantcms.org/mailman/listinfo/radiant)

–  
met vriendelijke groet,

Peter B.

---

<div class="post-metadata">

**Author:** ![bodikp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e79b87/32.png) [@bodikp](https://www.ruby-forum.com/u/bodikp)\
**Post date:** [July 16, 2007, 10:18pm UTC](https://www.ruby-forum.com/t/howto-determine-dev-mode/109381/4 "2007-07-16T22:18:10Z")

</div>

I have a rough version ready… but I’m still learning some internals so  
I  
can write the proper test code as well.

Added the patch to this ticket:  
[http://dev.radiantcms.org/radiant/ticket/517](http://dev.radiantcms.org/radiant/ticket/517)

Any comments on how this should (and could!) be better are highly  
appreciated.

Thanks

Peter.

On 7/16/07, Peter B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> On 7/16/07, John L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Site: [http://lists.radiantcms.org/mailman/listinfo/radiant](http://lists.radiantcms.org/mailman/listinfo/radiant)
> 
> –  
> met vriendelijke groet,
> 
> Peter B.

–  
met vriendelijke groet,

Peter B.

---

<div class="post-metadata">

**Author:** ![bodikp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e79b87/32.png) [@bodikp](https://www.ruby-forum.com/u/bodikp)\
**Post date:** [July 16, 2007, 10:39pm UTC](https://www.ruby-forum.com/t/howto-determine-dev-mode/109381/5 "2007-07-16T22:39:13Z")

</div>

Basis test code

[http://pastie.caboo.se/79264](http://pastie.caboo.se/79264)

The if and unless tags rely on the request object from the page. That  
way  
the host can be accessed. I can’t seem to simulate that in the test.

Anyone with some insight?

Thanks

Peter.

On 7/16/07, Peter B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Thanks
> 
> > something back to the community :).
> > 
> > > > in development modes… so you can see the draft pages…  
> > > > seem generally useful.
> 
> met vriendelijke groet,
> 
> Peter B.

–  
met vriendelijke groet,

Peter B.
