As info, these are the tags Sean mentioned:

  tag 'if_blank' do |tag|
    part_name = tag.attr['part']
raise StandardTags::TagError.new("`if_blank' tag requires a 'part' attribute") unless part_name
    part = tag.locals.page.part(part_name)
result = part.nil? ? "" : (defined?(ConcurrentDraft) && dev? (tag.globals.page.request) ? part.draft_content : part.content)
    tag.expand if result.blank?
  end

  tag 'unless_blank' do |tag|
    part_name = tag.attr['part']
raise StandardTags::TagError.new("`unless_blank' tag requires a 'part' attribute") unless part_name
    part = tag.locals.page.part(part_name)
result = part.nil? ? "" : (defined?(ConcurrentDraft) && dev? (tag.globals.page.request) ? part.draft_content : part.content)
    tag.expand unless result.blank?
  end


On Sep 23, 2009, at 6:13 AM, Sean Cribbs wrote:

At one point, I believe it was for Con-way, I implemented an <r:if_blank> tag that checked whether a part was blank. Regarding the syntax of Jim's proposal, it would be nice to disambiguate the 'blank' attribute - it's unclear to me what it would do in each case. Maybe:

<r:if_content part="my_part" allow_blank="true|false">

Sean

Nate wrote:
Jim Gay wrote:

Hmm. If it's going to go that way, I retract the suggestion. Why not
just add an attribute to if_content which checks the presence of text
then. <if_content part="my_part" blank="false|true">
And then inheritance would get tricky.


That does sound like a better way to do it. Honestly, I am not entirely certain how you would have used if_part outside of the if_content tag. I am curious how that would be more useful tha <r:if_content part="xxxx" />?
+1 for if_url and if_path changes

Ditto.


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


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

_______________________________________________
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