Sean Cribbs wrote:
Mohit Sindhwani wrote:
Hi, this is one of my first posts in a while where I'm not asking
someone to write for the Summer Reboot. I need help!
[1] Can I search for a relative page?
Is there any way to do a search for a relative item in this sense? Or
must each page definitely be linked within a specific link to that
version? Or should I just do a relative 'link' (../hash) rather than
doing a search.
Maybe a simple tag is in order here:
<r:sibling slug="hash"><r:link/></r:sibling>
Where the sibling tag is defined as:
tag 'sibling' do |tag|
tag.locals.page = tag.locals.page.siblings.find {|s| s.slug ==
tag.attr['slug'] };
tag.expand if tag.locals.page
end
If you want (or can settle for) all of the sibling links, use
<r:parent:children:each>.
[2] Binary Data
The other problem is more Ruby-related, I think. I'm writing a script
to extract data from the Word document and then automatically create
the pages. One of the pages has a 'micro' character in it (μ) and
this looks OK in the text file but it doesn't show up in the pages
correctly.
Any idea what I should do?
I would escape the characters into HTML entities before you write it
to the page. Not sure what the 'micro' character corresponds to (or
what character set it is in originally), but it should be easy to look
up if you have to. Try out the CGI::escape* methods.
Thanks for the super-quick answers, Sean! The sibling tag looks perfect
(though I was starting to lean towards a hard-coded HTML link itself)
and I'll look at HTML entities now.
Cheers
Mohit.
_______________________________________________
Radiant mailing list
Post: [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site: http://lists.radiantcms.org/mailman/listinfo/radiant