Hidden pages


I have a few result pages that should only render after a form
Thank you for you submission, blah, blah. The problem I’m having is how
classify these pages to not show up in <r:children:each>. It’s not an
to move these pages to an area of the tree that will not be picked up by

Do you know what I mean? I feel like I’m missing something obvious.

If I set the pages to hidden, it won’t be found in <r:children:each>,
but it
also won’t be found outside of dev.host?


You might consider adding a part, like the technique used in the
site-map idea, that you check for inside the <r:children:each> with a
<r:unless_content> tag.


Sean, excellent solution. I actually hacked a “hidden” bool onto Page
and then put a little checkbox in the admin UI. Would send along the
patch but Sean’s solution is much cleaner IMO :slight_smile:

Thank you, I see how this could work and appreciate the idea.

You know, I don’t really like to modify the code outside of extensions,
after a little code review, I guess a quick fix could also involve
updating the
page.rb published? method:

def published?
status == Status[:published] || Status[:hidden]

Or could I do this in an extension somehow?

Quoting Sean C. [email protected]:

You could do this in an extension, but my main question is… why?
Anyway, here’s how I would do it in an extension:


def activate
Page.class_eval do
def published?
status == Status[:published] or status == Status[:hidden]



This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs