Andreas, I don't know if this will help you or not, but I'm about to release an updated version of Conditional Tags that will now offer the <r:puts> tag to render values. My goal was to allow users to inspect the results of their evaluators but it would be handy here too. You could create your own extension with a module like:

   module MyModule
       include ConditionalTags::Evaluatable
       evaluator "id", :index_not_permitted do |tag, element_info|
         tag.locals.page.id
       end
   end

Then, in your extension's my_extension.rb file you'd add the following code to the #activate method:

raise "My Extension requires the Conditional Tags extension to be loaded first" unless defined?(ConditionalTags)
   ConditionalTags::CustomElement.send :include, MyModule

And suddenly you'll be able to output the value you seek using:

   <r:puts value_for="id" />

Better still, you would also be able to use 'id' in conditional statements like:

   <r:if cond=" id is 15 ">I know what contextual page I'm on!</r:if>

Don't know if that part would be useful to you or not though.


-Chris


Andreas Roedl wrote:
Hey guys,

I'm not subscribed to the dev mailing list, but anyway...

Sean, could you please add :id to the standard page tags?

  [:breadcrumb, :slug, :title, :id].each do |method|
    desc %{
      Renders the @#{method}@ attribute of the current page.
    }
    tag method.to_s do |tag|
      tag.locals.page.send(method)
    end
  end

I'm aware that this is a pretty much useless tag for most users and
developers, but in some situations it comes in handy.


Thanks,


Andreas
_______________________________________________
Radiant mailing list
Post:   [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

_______________________________________________
Radiant mailing list
Post:   [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to