I'm working on this feature, but one of the main reasons I put this out to the list for feedback is that it can become confusing, so I wanted to see if anyone else had thought about this.

The next version of Radiant (0.6.8) will accept a list of parts in if_content
<r:if_content part="this, that">
It will display the contents only if all of those parts exist.
This is useful for outputting information from customers (for example) where you want to display the customer description part only if it also has a testimonial part. If only some but not all of the listed parts are found, it will display nothing.

In light of that, how would you expect inherit="true" to work?

Would you expect that it looks up the tree for the existence of each part no matter where in the tree that part is found? Or would you expect it to look up the tree to find any page that has all of the listed parts?

My inclination is to make it look up the tree for each listed part regardless of the location of other parts, and as long as it finds all of them, it will output the contents of the if_content tag.

I personally have had the need for
<r:if_content part="this, that">
<r:if_content part="this" inherit="true">

But I have not had the real-world need for
<r:if_content part="this, that" inherit="true">

I'm working on it slowly to allow myself time to consider the pros and cons and to allow anyone to jump in with ideas before I get too far. I'd appreciate more feedback.

On Jul 7, 2008, at 7:04 PM, Adam van den Hoven wrote:

There are few things that make me more grumpy that empty elements that server no useful purpose. I'd love it.
On 7-Jul-08, at 12:56 PM, Jim Gay wrote:

Is there any interest in adding the inherit attribute to the if_content tag?

In some instances I'll find the need to output something like

<div id="extras">
<r:content part="extras" inherit="true" />
</div>

But I don't have a way to conditionally render the <div id="extras"> bit. If the parent or current page has an "extras" part, then it will appear, but if it doesn't I'll have an empty div element.

Is there a simple way to handle this or would <r:if_content inherit="true"> be a clear and welcomed addition?

-Jim
_______________________________________________
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to