On Jul 8, 2008, at 9:08 PM, Chris Parrish wrote:

Jim Gay wrote:
On Jul 8, 2008, at 8:16 PM, Chris Parrish wrote:

Since the all / find / require_all / inclusive attribute is both required and boolean (yeah I know XOR's been mentioned but I'm not going there), why not try to include that condition in the rest of it somehow?

<r:if_content part="my part"> (notice that the name "part" is singular)
<r:if_content any_part="my part, my other part">
<r:if_content all_parts="my part, my other part">

So in this example, you'd have 3 different possible attributes. Its always easier to read one attribute name than to have to combine two or three into a single meaning.

This stuff really is really motivating me to get my conditionals extension back to life ;-)


What do you do when more than one of those is used?

Well certainly you'd require only one of those attributes but that's not terribly hard logic. I see it as something akin to tags requiring an attribute and giving an error if the user leaves it out.

I should have mentioned this in my last reply, but any other attributes would be optional. The implementation would be such that it would not break any existing use of if_content, so all / find / require_all / inclusive attribute is not required. And I'd rather avoid error messages for practical defaults. Too many switches to flip will lead to confusion, even if helpful messages are provided when you do it wrong.

I'm just going to work on any="true" and call it a day (I can always tweak the code to do differently). This conversation was helpful. Ultimately as long as its implemented in a way that makes sense and it gets the necessary feature built I think it will be a success. When it comes down to it I'm not on the core team so they'll decide. But I wanted to get the community involved in the idea first before I added it.

No worries. It's yours to build.

Yes, but I'm trying to add it as a feature for the core (of which part="this, that" has already been added on edge), so it matters what the community thinks.

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