Re: [Radiant] re: WYMeditor breaking on popup windows

2008-08-12 Thread Oli Studholme

Hey Jason,

On Aug 12, 2008, at 2:48 PM, jsmorris wrote:


Drag and drop what file icon and what link?  Do you mean the link that
shows up in the Attachments area?  I tried that, and it doesn't seem
to work.  Is there something you need to do to get that to work?


This is the icon and link that the page_attachments extension adds to  
the bottom of an article edit page, after you’ve used it to  
upload an image. Normally with the input filter set to a default input  
dragging and dropping one of these inserts either an img tag  
(thumbnail) or a link (filename). I’m not sure if by  
“attachments area” you mean something in WYMeditor or  
page_attachments, but drag and drop should work with page_attachments  
and a default filter.


On Aug 13, 2008, at 1:25 AM, Nicholas Henry wrote:


Yes, I'm getting this behavior as well


Glad it’s not just me. I’m using FCKeditor for the  
moment, although that has no page_attachments integration, and the  
inbuilt image management features are a bit opaque. It sounds like  
integrating it with page_attachments or giving it page_attachments- 
like abilities would both be a lot of work though.


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


Re: [Radiant] Japanese and i18n in Radiant

2008-08-03 Thread Oli Studholme

Hey Casper,

On Aug 3, 2008, at 3:19 AM, Casper Fabricius wrote:

I'm eager to hear if you have found a fitting extension for handling  
multiple languages. I'm considering using Loren Johnson's language  
switch (http://github.com/lorenjohnson/radiant-language-switch/tree/master 
), but maybe there is something better or different or more advanced  
out there?


I’m using the Language Redirect extension:
https://svn1.hosted-projects.com/medlar/language_redirect_extension/

You create language code root articles (/en, /ja etc) and build your  
localised site under there. When a user visits the domain root,  
they’re automatically redirected to one of the localised roots  
based on browser’s accept language. This doesn’t work  
well with the automatic breadcrumb tag though (you get the site root  
and the locale root, which end up pointing to the same thing).


Another option is the translator extension:
http://dev.philburrows.com/svn/radiant-extensions/translator/trunk/README

It seems you create a page part for each language, then the extension  
displays the relevant part based on browser’s accept language or  
session variable.


There might be some more info in the mailing list archives

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


[Radiant] r:aggregation and monthly archives

2008-08-01 Thread Oli Studholme

Hi All,

I’ve got three archives that I’m aggregating on a parent  
page using r:aggregation. I want to make an aggregate monthly archive  
of all child posts for the sidebar. On the archive pages I can list  
articles and add per-month headers which link to a monthly archive. On  
the parent r:aggregate page I can aggregate all the child archive  
articles and add per-day headers, but the same per-month header code  
doesn’t work. If I try to make the parent page into an archive  
r:aggregate stops working. Adding a monthly archive to the parent page  
then trying to access it via /monthly-archive or a date-based url  
gives 404s.


Is it possible to get per-month aggregate archives of child archives?  
or to fake them somehow?


The code I’m using in the archive pages sidebar is:
http://www.lion-ah.com/ja/blog/photos

r:find url=/ja/blog/news/r:children:each limit=5 order=desc  
by=published_at

ol class=archives
r:headerh3 class=infoa href=r:date format=/ja/blog/news/%Y/ 
%m/ /r:date format=%Y年%m月 //a/h3/r:header

li class=entryr:link //li
/r:children:each/r:find
/ol

This gives a month header that links to the monthly archive, followed  
by each article that month.


Code that works on the r:aggregate parent page sidebar:
http://www.lion-ah.com/ja/blog

h2最近のブログ/h2 r:aggregate urls=/ja/blog/news; /ja/blog/ 
articles; /ja/blog/photosol class=archives r:children:each  
limit=20 by=published_at order=desc r:headerh3  
class=infor:date format=%Y年%m月%d日 //h3/ 
r:header li class=r:if_url matches=/(ja|en)/blog/newsnews/ 
r:if_urlr:if_url matches=/(ja|en)/blog/articlesarticles/ 
r:if_urlr:if_url matches=/(ja|en)/blog/photosphotos/r:if_url  
entryspan class=infor:if_url matches=/ja/blog/newsa href=/ 
ja/blog/newsニュース/a/r:if_urlr:if_url matches=/ja/blog/ 
articlesa href=/ja/blog/articles記事/a/ 
r:if_urlr:if_url matches=/ja/blog/photosa href=/ja/blog/photos 
写真/a/r:if_url/span r:link //li / 
r:children:each /ol/r:aggregate


This gives aggregate articles from child archives, with unlinked per- 
day headers (and category titles).


Any idea how I’d make an aggregate monthly archive of child  
archive articles, then generate per-month links to it? eg


All articles published in:
June 2008
July 2008
August 2008

Thanks in advance

peace - oli

PS Sean you should have answered anyhow - irclogger was covering for  
me ;-)

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


[Radiant] Japanese and i18n in Radiant

2008-08-01 Thread Oli Studholme

Hi All,

[sorry if this ends up being a double-post]
I’ve been having lots of fun with making a bilingual site in  
Radiant. Here are some current problems that I hope someone can  
suggest fixes for:


# Pages in Shift-JIS charset

Most Japanese cellphones require Shift-JIS for mobile sites, but the  
content-type field in Layout ignores charsets. Can anyone suggest how  
I’d add support for charsets to this, or another way to work  
around it?


# Mailer extension and sending ISO-2022-JP emails

Despite ActiveMailer docs[1] containing this:
“default_charset - The default charset used for the body and to  
encode the subject. Defaults to UTF-8. You can also pick a different  
charset from inside a method with charset.”


Setting this in environment.rb:

   config.action_mailer.default_charset = iso-2022-jp

still results in my email header and body being UTF-8 encoded, with  
body settings of:

Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: Quoted-printable

If I add this to environment.rb:

 config.action_mailer.default_content_type = text/ 
plain;charset=iso-2022-jp


I get the bizarre combo of utf-8 encoded subject and body settings of:
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: Iso-2022-jp

which is even worse. A Japanese article[2] suggests wrapping  
ActionMailer in TMail then iso-2022-jp and base64 the email, but I  
guess that requires a hack or an extension, right? here’s their  
code:


module ActionMailer #:nodoc:
  class Base
require 'nkf'
class  self
  def base64(text, charset=iso-2022-jp, convert=true)
if convert
  if charset == iso-2022-jp
text = NKF.nkf('-j -m0', text)
  end
end
text = [text].pack('m').delete(\r\n)
=?#{charset}?B?#{text}?=
  end
end
  end
end

class Notifications  ActionMailer::Base
  @@default_charset = iso-2022-jp
  @@encode_subject = false
  #...
end
Then in test:

class NotificationsTest  Test::Unit::TestCase
  CHARSET = iso-2022-jp
  #...
  private
def encode(subject)
  ActionMailer::Base.base64(subject, CHARSET)
end
end

Anyone ever managed to get emails in non-UTF8 working

Finally, what’s up with i18n and how can I help? I can’t  
even get the Jargon branch (with the partially baked gibberish  
support) to run anymore…


peace - oli

[1] http://api.rubyonrails.org/classes/ActionMailer/Base.html
[2] http://wiki.fdiary.net/rails/?ActionMailer
___
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant


[Radiant] re: WYMeditor breaking on popup windows

2008-07-23 Thread Oli Studholme

Hi All,

First, thanks for making the WymEditor extension for Radiant Benny! I  
find fckeditor and tinymce a massive pain, both to de-crapify and in  
the code they produce, so this was welcome.


I’m doing some testing before showing a site to a client, and  
I’ve got a problem in that on any page that has an uploaded  
page_attachment, any of the buttons that activate pop-up windows  
(image, link etc) also replace the body of the admin page with this:


/^([\s\/]*)|([\s\/]*)$/gm

so under the popup window my page is now only the red header and the  
gray footer, and one line of regex in the middle. Has anyone else come  
across this?


I’m running on 0.6.7 frozen to edge (svn rev 881), and I got the  
WYMeditor extension via a github clone. When trying to insert a  
page_attachments image I can drag and drop the file icon to include  
that, or the file name to make a link, but I’m specifically  
wanting to be able to add the full-size image with alt text, which  
requires the popup. Does anyone know why this is happening, and how I  
can fix it?


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


[Radiant] setting the default text filter

2008-07-22 Thread Oli Studholme

Hi All,

I came across a couple of mentions in the archives of people asking  
how to set a default filter for articles, but no “here’s  
how” answers. Did anyone manage to do this, either via extension  
or config/enironment.rb?


thanks in advance!

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


Re: [Radiant] Summer Reboot Update

2008-07-17 Thread Oli Studholme

Hi All,

Sorry for being late to the party.

I originally posted to the list on May 2nd about documentation  
(“tag documentation feedback”), mentioning among other  
things a tag reference. This would have one page per tag, be in a  
wiki, and hopefully auto-import the current “available  
tags” documentation from the code (would it be possible to  
script that?). I’ve added this to the summer reboot wiki page as  
an appendix.


Currently the summer reboot documentation ToC is kind of book-like, in  
that a user would start at the start (or a chapter/topic of interest)  
and read linearly to the end. I’d also like to suggest we  
support reference style, for example the tag reference docs, and  
problem-solving style (how-to articles), for example short code  
example articles on one topic; how to implement blog-style categories  
using r:aggregate /, how to produce common variants of monthly  
archive lists etc.


Currently the docs are a little repetitive or fractured in places, for  
example tag information is spread over four places on the wiki and  
blog, so we should also think how to avoid repeating content too much.  
For tags I’d propose putting the most detail into a tag  
reference, and having eg the “Using the built-in tags”  
article be an overview grouped by topic with examples, with links to  
the tag reference and how-to articles for more detail. I think that  
putting the detail into atomic reference pages will make it easier to  
keep the main documentation articles light and quick to read, and help  
reduce repetition.


I’m happy to flesh out the tag documentation and add examples,  
but someone else will need to write the script to automatically  
generate/update wiki pages using the available tags text. If such a  
script is impractical I’ll start doing it manually if a tag  
reference header page is created.


Some reference for how others do this:

Movable Type: http://www.movabletype.org/documentation/appendices/tags/
Expression Engine: http://expressionengine.com/docs/overview/tags.html
WordPress: http://codex.wordpress.org/Template_Tags

These things would be nice for the tag reference:

* best practice code examples, with expected results
* code coloring in code examples
* links to related tags, how-to articles that use this tag, and  
relevant part of tag overview article and other documentation
* a link in the Radiant admin “available tags”  
documentation to the more detailed tag reference page on the wiki


Finally it would be great if there was automatic linking of how-to  
articles and tag reference pages, ie if a how-to article on monthly  
archive lists has a code example with r:children:each, r:find, r:date  
and r:header, that it would automatically link to those tag reference  
pages, and in turn the how-to article would be linked to on each  
relevant tag reference page.


hope that’s of some use

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


[Radiant] .htaccess mod_rewrite woes

2008-07-15 Thread Oli Studholme

Hi All,

I just can’t seem to get redirects going in  
Radiant’s .htaccess. Can someone enlighten me?


In the default .htaccess file after RewriteEngine On (shich should be  
after the Options at the top btw) I tried these vavriants


RewriteRule from.html to.html

RewriteRule from.html http://domain/to.html [R=301,L]

RewriteCond %{REQUEST_URI} ^/from\.html
RewriteRule .* http://domain.com/to.html [R=301,L]

which all work on another domain on this server. Nothing happens. I  
also tried adding the example ‘tell Rails to ignore this’  
rules, but I’m probably doing it wrong.


RewriteRule from.html to.html
RewriteCond %{REQUEST_URI} ^/to\.html
RewriteRule .* - [L]

Any ideas? I actually want to redirect one file and map it to a  
subdomain (eg http://domain.com/test to http://test.domain.com/), but  
I can’t even get simple file redirection going. Finally  
I’d like to know if it’s possible to use .htaccess to  
generate canonical URLs. Specifically I want http://domain.com/ to  
redirect to http://www.domain.com/, and all trailing slashes to be  
stripped eg http://www.domain.com/news/ to http://www.domain.com/news


Thanks for your time

peace - oli

PS This is using Radiant 0.6.6, the last version that supports the  
gettext interface localization plugin I’m using. Btw what needs  
to be done to resurrect jargon’s gibberish i18n support?  
I can’t even get jargon to install atm

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


Re: [Radiant] Suggestions on where to set the locale

2008-05-02 Thread Oli Studholme

Hi All,

On Apr 2, 2008, at 1:45 AM, Mohit Sindhwani wrote:

  Radiant::Config[local.timezone] = Pacific Time (US   
Canada)


I've been finding lots of little gems in the mailing list. Like what
should have been obvious... A better place than the console for  
setting
configuration data is, duh... in config/environment.rb. At the  
bottom I

put:

require 'radiant/config'
Radiant::Config[local.timezone] = Pacific Time (US  Canada)


I'd like a localized r:date / output for a bilingual English/ 
Japanese website eg 2nd March 2008 on an English page but 2008年5 
月2日 on a Japanese page. This would typically be done via  
locale, but I think Mohit's config option will change the date  
formatting for every instance. Does anyone know how I'd achieve this,  
say based on a lang page part or url regexp match? Would I need to  
make a custom date tag that accepts locale as an attribute somehow?


Thanks in advance.

peace - oli

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


[Radiant] how do I regex the output of a tag?

2008-04-29 Thread Oli Studholme
Hi All,

I want to manipulate the contents of r:url / using regex. I'm
wanting to do something like MovableType's regex modifier for
variables[1]:
In MT-ese what I want to do is:
mt:var tag=pagepermalink regex_replace=/^(.+)\/ja\/(.*)/,$1/en/$2 /
To change eg:
http://example.site/ja/optional/path
into:
http://example.site/en/optional/path

How would I do this? Is there a way to write ruby code directly into
templates? Or am I looking at a custom Radius tag or making an
extension?

Thanks in advance!

peace - oli

[1] 
http://www.movabletype.org/documentation/appendices/modifiers/regex-replace.html
___
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant