Forum: Radiant CMS Understanding contextual, page parts and slug

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
69f7fa8d94b3f993ab7a5923a28cb597?d=identicon&s=25 Shawn Oster (soster)
on 2007-08-02 03:36
(Received via mailing list)
I believe I'm thinking about this wrong but I can't figure out exactly
how,
can anyone here point on my flaw in logic?

LAYOUT:
<h1>Section: <r:content part="section" inherit="true" contextual="false"
/></h1>

PAGE "Authors", PART "section":
<r:slug />

PAGE "Ian M. Banks", NO "section" PART

(Assume the "Ian M. Banks" page is underneath "Authors")

By my way of thinking the "Authors" page part "section" will evaluate to
the
Author's page slug, which is "authors", so you'll see:

"Section: Authors"

Which is exactly what it does.

When the "Ian M. Banks" page renders the layout will be processed and
the
"section" page part will be requested.  Since this page doesn't have a
"section" page part it will inherit from it's parent's "section", which
was
already evaluated to "Authors".  Since the contextual flag was set to
false
it won't reprocess the r:slug command in the the context of the current
page, yet it does so you get this:

"Section: Ian M. Banks"

So, the question is why does the r:slug get evaluated in the context of
a
child page even though it's actually inheriting from the parent and the
parent explicitly set the the contextual false flag?  Also, is there a
better way to achieve what I'm attempting, creating sections that stay
semi-static?

Thanks,
Shawn
This topic is locked and can not be replied to.