Re: [Radiant] Best way to refer to a stylesheet?

2008-06-08 Thread John and Catherine Allen

Chris,

Thanks - in fact I had successfully installed the Styles 'n Scripts 
extension but was not clear about how to make use of it. I'll try the 
r:stylesheet tag approach.


John

Chris Parrish wrote:
I see that Casper already sent a reply but I thought I'd mention the 
Styles 'n Scripts extension here since it was made to make things like 
this simpler.  You would simply use the r:stylesheet or 
r:javascript tag in your Page/Layout/Snippet to render the thing you 
want:


r:stylesheet name=my_stylesheet.css as=link /
  generates:
link rel=stylesheet href=/css/my_stylesheet.css type=text/css /

while...
r:stylesheet name=my_stylesheet.css as=url /
   generates:
/css/my_stylesheet.css

Of course the /css directory in the examples is the extension's 
default but you can change that to whatever you want.


You can also use these tags to pull the content from a stylesheet of 
javascript into your document's head section.


-Chris


John Allen wrote:
This has to be a really basic question, but despite reading the 
documentation and many mailing list posts, I still don't get it...


For stylesheets which are stored in the database
1) In a layout, what is the recommended way to refer to a stylesheet ?
2) In a page, what is the recommended way to refer to a stylesheet ?

My stylesheets work fine when I refer to them as files in the 
filesystem, but not when they are in the database.

--
John Allen
Bofferdange, Luxembourg
[EMAIL PROTECTED]
http://allenlux.dyndns.org

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


[Radiant] Re: ActionController::InvalidAuthenticityToken in Radiant Ad

2008-06-08 Thread Bartłomiej Frydrych
Sean Cribbs wrote:
 Make sure that you ran `rake radiant:update` after upgrading your site
 to 0.6.7.  We had to make a change in the sitemap.js file to deal with
 this issue.  Essentially, retrieving the children of the current page
 should be a 'get' request, but the default for Ajax.Request is 'post'.
 'get' requests aren't checked for authenticity.  This was fixed.
 
 Sean

thanks sean it works!!

-- 
Posted via http://www.ruby-forum.com/.
___
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant


Re: [Radiant] And what happened to the clear page cache button?

2008-06-08 Thread Casper Fabricius
Yes, well that's because you are running radiant in sub-directory; at http://allenlux.dyndns.org/radiant3/ 
 rather than  http://allenlux.dyndns.org/. Rails applications are  
generally expected to run in their own subdomain, and radiant is no  
exception. It is definitely possible to run it in a sub-directory, but  
then you have to aware at things like that.


I'd recommend using the absolute path for the css file in your layout,  
though:
link rel=stylesheet type=text/css href=/radiant3/mystyles/ 
new.css /


Cheers,
Casper


On 08/06/2008, at 0:49, John and Catherine Allen wrote:


Casper Fabricius wrote:
Yes, that's right, John. Clearing of the page cache is done  
automatically upon changes.


With regards to your stylesheet question, I tend to just write a  
standard link tag, referring to the slug of the stylesheet. For  
instance:


link rel=stylesheet href=/css/standard.css type=text/css  
media=screen /


Here I have a hidden page with the slug of css, and below that, I  
have a stylesheet page with the slug set to standard.css.



Casper,

Thanks, that pointed me in the right direction at last. I was  
getting confused between the Radiant path, made up of slugs, and  
the filesystem path.


However, on my test site it did not work at first. After looking at  
the Apache error logs, I tried omitting the leading slash, and now  
it works fine.


To be concrete:

Test page: http://allenlux.dyndns.org/radiant3/hello_world

Working version: the layout contains this reference:
link rel=stylesheet type=text/css href=mystyles/new.css /
where mystyles is the hidden page as you suggest in your message.

Non-working version:
link rel=stylesheet type=text/css href=/mystyles/new.css /
doesn't work (it seems to be looking for a non-existent filesystem  
folder

DocumentRoot/mystyles/

John




On 07/06/2008, at 15:35, John Allen wrote:


Another beginner question:

The older (?) Radiant documentation refers to a clear page cache  
button on the admin page.


My Radiant 0.6.7 sites don't have this button - I am right in  
thinking this is because Radiant now automatically clears the page  
cache when something is changed in the database?


John



--
John Allen
Bofferdange, Luxembourg
[EMAIL PROTECTED]
http://allenlux.dyndns.org

___
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


Re: [Radiant] Can't log into wiki?

2008-06-08 Thread Jay Levitt

Bjørn Michelsen wrote:

On Sat, 7 Jun 2008, Jay Levitt wrote:


Jay Levitt wrote:


At wiki.radiantcms.org, when I try to Sign In, it takes me to 
http://wiki.radiantcms.org/login?return_to=/Documentation.


That gives me the Login/Create Account screen, with Username and 
Password fields.


When I fill those in (username = JayLevitt), it tells me Username 
has already been taken.  Well, yes - by me, when I logged in 
yesterday...


I'm still seeing this, on both Firefox 3.0 nightly and Safari 3.1... 
ideas?


You'll get the error message Username has already been taken if the
password you provide is incorrect. So my guess is that you're simply
entering the wrong password.


Ah!  No, but that was the clue I needed.  It also gives that error message 
if you supply the wrong case on the username!  (Strange..)  I had registered 
as jaylevitt, but was trying to log in WikiName style, JayLevitt.


Darn you, Junebug..

Jay

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


Re: [Radiant] And what happened to the clear page cache button?

2008-06-08 Thread Sean Cribbs
If you're using the built-in tags, like r:url / and r:link /,  the 
relative path issue will be handled properly.  For those of you 
developing tag libraries, you can take advantage of the relative_url_for 
method that is in StandardTags:


relative_url_for('/mystyles/new.css', tag.globals.page.request)

used in the context of the example would produce 
'/radiant3/mystyles/new.css'.


Sean

Casper Fabricius wrote:
Yes, well that's because you are running radiant in sub-directory; at 
http://allenlux.dyndns.org/radiant3/ rather than  
http://allenlux.dyndns.org/. Rails applications are generally expected 
to run in their own subdomain, and radiant is no exception. It is 
definitely possible to run it in a sub-directory, but then you have to 
aware at things like that.


I'd recommend using the absolute path for the css file in your layout, 
though:
link rel=stylesheet type=text/css 
href=/radiant3/mystyles/new.css /


Cheers,
Casper


On 08/06/2008, at 0:49, John and Catherine Allen wrote:


Casper Fabricius wrote:
Yes, that's right, John. Clearing of the page cache is done 
automatically upon changes.


With regards to your stylesheet question, I tend to just write a 
standard link tag, referring to the slug of the stylesheet. For 
instance:


link rel=stylesheet href=/css/standard.css type=text/css 
media=screen /


Here I have a hidden page with the slug of css, and below that, I 
have a stylesheet page with the slug set to standard.css.



Casper,

Thanks, that pointed me in the right direction at last. I was getting 
confused between the Radiant path, made up of slugs, and the 
filesystem path.


However, on my test site it did not work at first. After looking at 
the Apache error logs, I tried omitting the leading slash, and now it 
works fine.


To be concrete:

Test page: http://allenlux.dyndns.org/radiant3/hello_world

Working version: the layout contains this reference:
link rel=stylesheet type=text/css href=mystyles/new.css /
where mystyles is the hidden page as you suggest in your message.

Non-working version:
link rel=stylesheet type=text/css href=/mystyles/new.css /
doesn't work (it seems to be looking for a non-existent filesystem 
folder

DocumentRoot/mystyles/

John




On 07/06/2008, at 15:35, John Allen wrote:


Another beginner question:

The older (?) Radiant documentation refers to a clear page cache 
button on the admin page.


My Radiant 0.6.7 sites don't have this button - I am right in 
thinking this is because Radiant now automatically clears the page 
cache when something is changed in the database?


John



--
John Allen
Bofferdange, Luxembourg
[EMAIL PROTECTED]
http://allenlux.dyndns.org

___
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


Re: [Radiant] Multiple languages, links and search engines

2008-06-08 Thread Mohit Sindhwani

Stefan Urbanek wrote:
I found neat Translator extension of radiant from Philip Burrows. I 
like the simple way how it handles multiple languages of various parts 
of the site.


There are couple of things I am missing in the extension:

Language dependent URLs: they should be in form something like this:
www.myradiantsite.com/[language_part_of_URL]/radiant_destination
Reasons behind this are direct links to translated versions of 
articles and allowing search engines to index translated page. For 
example, google starts at page root in english, then goes:


[en] site.com -- [sk] site.com/sk -- [sk] site.com/sk/some_page

Is there any workaround for that at the moment? I would not mind 
modifying .htaccess file and include all languages there (they are 
just three), however I do not know much technical details how to do 
that. Or is there any other way?


Also, how I can make radiant to generate language dependent URLs? I 
want the language code or name to be present in translated version of 
an article/page.


In addition, what are plans to integrate multilingual support directly 
in to the Radiant CMS? That would be great and it will add huge 
competitive advantage(*) in the CMS if done in simple way. The 
Translator extension looks very promising...


Regards,

Stefan Urbanek

(*) I have seen no open source CSMs with properly and nicely 
implemented multilingual support.


Hi Stefan

I notice that there has been no reply to your original email.  I have 
looked at this in some partial detail and implemented something that may 
not be fantastic, but it works.  You can see the solution at work on the 
following site: http://onghu.com/te -


See, for example, the following pages:
* http://t-engine.onghu.com/cn/news/t-news-tron-show-2008/
* http://t-engine.onghu.com/th/articles/booting-t-engine-from-usb/

You'll notice that there is a language bar that connects you to the 
other languages for which this article is available.  I've implemented 
it with a few constraints in place.  Now, I have written a bit about 
this in earlier posts to the mailing list, so I'll just paste the stuff 
here:


It's a bit fragile but it works.  It also relies on convention, but it works (for 
me).  I mentioned the idea and the solution somewhat in this thread.  
Let me know if it interests you.


[1] The first concept - 
http://lists.radiantcms.org/pipermail/radiant/2007-September/006364.html
[2] The details - 
http://lists.radiantcms.org/pipermail/radiant/2007-October/006881.html


Unlike some other solutions, mine doesn't disable caching, but it is more 
difficult if you have multiple page parts that are common to each of the 
pages.  Mine works quite well if you you want to/ can assume that each 
translation is completely independent.


If this looks interesting, just buzz me at mohits at onghu.com - the 
catch is that I have not at all tried it on Radiant 0.6.7 - I think my 
site is currently on 0.6.4.


Best wishes,
Mohit.


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


Re: [Radiant] [ANN] SnS Extension v0.4

2008-06-08 Thread Mohit Sindhwani

Chris Parrish wrote:
Over the weekend I added file uploading capability so now you can 
upload your stylesheets and javascripts right into the database -- Woo 
hoo!  This is my first stab at using Rails uploading and RJS so I'd 
really love any feedback anyone has to offer.


You can get it here (while supplies last):  
https://secure.svnrepository.com/s_swanki/open/radiant/extensions/styles_n_scripts/tags/latest 





Wow, this looks awesome!  Thanks a lot!

Cheers,
Mohit.
6/9/2008 | 12:31 AM.

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


Re: [Radiant] Best way to refer to a stylesheet?

2008-06-08 Thread Mohit Sindhwani

John and Catherine Allen wrote:
This has to be a really basic question, but despite reading the 
documentation and many mailing list posts, I still don't get it...


For stylesheets which are stored in the database
1) In a layout, what is the recommended way to refer to a stylesheet ?
2) In a page, what is the recommended way to refer to a stylesheet ?

My stylesheets work fine when I refer to them as files in the 
filesystem, but not when they are in the database.


John


Hi John

If you have your stylesheet set up as a page in Radiant, you need to 
know its slug.  Once you know the slug, you can render it with something 
like this in your layout:


|link rel=stylesheet type=text/css href=/styles.css /

This requires you to have a stylesheet under the root of your site in Radiant 
with a slig of styles.css.
|


This tutorial of mine very briefly touches on it:
http://notepad.onghu.com/2007/5/26/hello-world-using-radiant-cms

Cheers,
Mohit.
6/9/2008 | 2:35 AM.




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


Re: [Radiant] Proposal for a drafts or staging extension

2008-06-08 Thread Mohit Sindhwani

Jamey Cribbs wrote:

For our current radiant app, my client is asking for this functionality:

i'd like to use our current setup of radiant and add a selection
under status called staging.  When the staging status is selected,
we'd have an area we can check the page to make sure it looks and that
the links work.  Then we can change status to published and it would
be available on the live site.  The problem we're going to run into is
that there are more and more people updating content who have very
little html knowledge.


So, after doing a little investigating, I wrote up this proposal for
how I would like to solve this problem:

In the Admin section, under the Pages tab, each page name in the tree
would have a link next to the name called draft if a draft version
exists. Clicking on the draft version would allow you to edit it and
also set it's status to Published. If you did this, it would
overwrite the Published version. You could also delete the draft
version. You could also click on the page name itself, whereby you
could edit and delete the published version. If there was only a draft
version of the page, then only the page name would show up and
clicking on the page name would take you to the draft version. Here is
an example of what it would look like:

Products draft
Resources

In this example, the Products page has both a published version and a
draft version. The Resources page only has one version.

To preview the draft version of a page, you will be able to go to
http://dev.location_of_radiant_app which will be a version of the site
that shows draft pages if they exist, otherwise it shows the published
page.

Technically, this will be accomplished by creating a new radiant
extension. The extension will provide for a new table called
redrafts (and a redrafts_parts table). The redrafts table will
mirror the structure of the pages table. When a user creates a new
page, it will be added to the pages table with a status of draft. This
will be the page that the user edits when he clicks on the page name
link on the Pages page. Once the page is ready to publish, the user
changes it's status to Published. Now, let's say the user wants to
edit the page. We need to create a new draft of the page, but we need
to keep the current published version for production. So, when the
user goes to the edit screen for the published page, they will be able
to edit the page and then click a button called Save as draft. This
will make a copy of the edited page and save it to the redrafts table.
Now, the page will have both a drafts link and a link to the published
page. Once they are ready to publish the new draft, they will be able
to go to the edit screen of the drafted page, change the status to
Published and save it. This will overwrite the current published
page in the pages table with the draft page from the redrafts table
and delete the copy from the redrafts page.

Likewise, if you were to delete the published version of a page that
also had a draft version. The draft version would automatically be
moved from the redrafts table to the pages table, but would still have
a status of drafted. In other words, whenever only one version of a
page exists, it must be in the pages table. The redrafts table will
only hold draft versions of pages that currently have a published
version.

My plan is to use the Shards extension (which, actually, has been
incorporated into radiant core in version 0.6.7) to manipulate the
admin ui to present the draft links and the new buttons on the page
edit screen. To add the back-end model functionality, I will add a
redrafts migration and also callback methods in the Page model. To add
the controller functionality, I will need to override some of the
instance methods of the Pages controller.


My thinking for having the extension work this way is that it will be
as unobtrusive to the current functionality as possible, i.e. if a
user never needs to create a new draft of an existing page, then the
extension won't come into play and things will function as if this
extension does not exist.

My question for this mailing list is, does my proposed extension sound
do-able?  Is there an easier/better way for me to accomplish this?
Anything I missed?

Any advice or suggestions would be greatly appreciated.

Thanks.

Jamey Cribbs


Jamey

If your site is installed to http://www.example.com/ Radiant serves up a 
'draft' version at http://dev.example.com/ if I remember correctly.  You 
can change the subdomain by setting it in the Radiant config under 
environment.rb as mentioned here:

http://wiki.radiantcms.org/Additional_Configuration_Options

Not sure if it does *all* of what you want, though...

Cheers,
Mohit.
6/9/2008 | 2:38 AM.

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


Re: [Radiant] Best way to refer to a stylesheet?

2008-06-08 Thread Chris Parrish

John and Catherine Allen wrote:

Chris,

Thanks - in fact I had successfully installed the Styles 'n Scripts 
extension but was not clear about how to make use of it. I'll try the 
r:stylesheet tag approach.


John



Both the r:stylesheet and r:javascript tags have explanations if you 
click on the available tags link on the Edit Page screen.  These 
descriptions should be self explanatory -- well, I understand them, 
anyway ;-)


It's also worth noting that the SnS extension uses default locations for 
your stylesheets and javascripts (they are /css  /js respectively) but 
you and your users never need to know these locations to use the tags.  
Just fill out the name of your stylesheet and the rendered output will 
include the full path automatically.


You can also change the default settings (including these asset 
directories) via the custom_settings.rb file.


Let me know if you have any troubles -- I want to make that extension as 
usable as possible for the community.


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