Discussion Forums
- Topic List
- Most Recent Posts
- Sign In for more options
Hi
I want to pass dynamic value to radiant tag like
......... ........
but this line " " gave me error. how to pass this value .
How too fix this issue is there is any other option i have n number of files and also admin will add page dynmaiccly so i can't hard code.
Hi
Put this tag in app/models/standard_tag.rb file
desc %{
Inside this tag all page related tags refer to the page found at the @url@ attribute.
@url@s may be relative or absolute paths.
*Usage:*
<pre><code>...</code></pre>
} tag 'find_d' do |tag|
url = tag.attr['url']
raise TagError.new("`find' tag must contain `url' attribute") unless url
# url= tag.locals.page.render('url',url) url= tag.render('url', tag.attr)
found = Page.find_by_url(absolute_path_for(tag.locals.page.url, url))
if page_found?(found)
tag.locals.page = found
tag.expand
end
end and uses
If I recall correctly you cannot use Radiant tags as attributes inside other tags, therefore you need to hardcode the url in the Of course there are other options for finding pages using the children tags which may do what you need to do. There is also the option of making your own tags as Amit has suggested.
Hi Jeffy
Radiant parsing one level if you want to parse tag inside another tag then if you have to write your own method.
"tag.locals.page.render" parse tag return its result dynamic
