Re: [Radiant] share_layouts extension and filters

2009-03-10 Thread Sean Cribbs
That seems like a common enough use-case that the expected behavior 
would be to have no filter. I'd gladly take a patch to fix that.


Sean

Remko Steenstra wrote:

Hello everyone,

I have a question about the share_layouts extension. I am using it on 
a site that has the defaults.page.filter set to Textile. Consequently 
the content generated by my custom controllers and views is rendered 
out as Textile, which is not what I had in mind.


Is there a way to override this behaviour? Can I set the page part 
filter from my extension somehow?


I have read Sean's post about creating 'endpoint' pages, but my routes 
are dynamic so I can't create pages/page_parts for them.


Cheers,

Remko

___
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] share_layouts extension and filters

2009-03-10 Thread Remko Steenstra

Hello everyone,

I have a question about the share_layouts extension. I am using it on a 
site that has the defaults.page.filter set to Textile. Consequently the 
content generated by my custom controllers and views is rendered out as 
Textile, which is not what I had in mind.


Is there a way to override this behaviour? Can I set the page part 
filter from my extension somehow?


I have read Sean's post about creating 'endpoint' pages, but my routes 
are dynamic so I can't create pages/page_parts for them.


Cheers,

Remko

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


Re: [Radiant] share_layouts extension

2008-06-15 Thread Will Emerson
Nate,

I think most of the issues in upgrading to 0.6.7 with the rails_support
extension were normal ones you face going to Rails 2. Here is what
version control and my memory tells me I changed.

-- I backed up the database, dropped all the tables, and ran the
migrations for radiant and all extensions. Schema.rb was rewritten in
the new 2.0 style. 

--the new 'protect_from_forgery' functions stopped me for awhile. In my
controllers, I had to add the line

protect_from_forgery :except => new

--in environment.rb I had to add my customizations back in from
environment.bak which the upgrade to radiant provided. Be sure to put
your "requires" outside of and after the Initialize block. Be sure to
set config.plugins = [:all] and config.extensions = [:all] unless you
have special requirements. Be sure conf.action_controller.session is
uncommented and set. 

--I had to do the migration for sessions (rake db:sessions:create) and
comment out the line session :off at the top of site_controller.rb in
../gems/radiant-0.6.7/app/contollers. This may vary with your needs. I
don't really understand how Radiant handles sessions but the forgery
protection seems to need sessions.

--In my controllers, find_all needs to be replaced by find(:all).

--many plugins and gems need to be updated. will_paginate changed from a
plugin to a gem so install the gem and remove the plugin and add

gem 'mislav-will_paginate', '~> 2.3'
require 'will_paginate' 

to environment.rb
Since pagination has been dropped from Rails core, you have to use a gem
or plugin. Be sure to get will_paginate from here:

gem install mislav-will_paginate --source http://gems.github.com/

to get the latest version. My queries were getting messed up after page
1 until I got the latest gem and made sure I was referencing it.

--If you use the Gallery extension, it needs to be updated to the latest
version. 

--main.css in admin changed and any customization you have made needs to
be merged.

--Old scaffolding doesn't work. I just created views for the little-used
admin controllers where I had been lazy and used scaffolding.


So basically once I got past these hurdles, the rails_support extension
worked just fine. 

Good luck upgrading!
Will Emerson


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


Re: [Radiant] share_layouts extension

2008-06-14 Thread Chris Parrish

Whoops, I lied.  You do *not* need to uncomment:
require_dependency 'application'

for your extension to play with share_layouts (unless you're doing 
something with your controllers in the activate method too).


I was looking at the wrong extension's code when I mistyped -- sorry.

-Chris


Chris Parrish wrote:

Will Emerson wrote:

Through trial and error, I got the rails_support extension working in
0.6.7 and Rails 2.0.2. But now I'm trying out the share_layouts
extension and I'm having some problems getting it to work. In this
project, my app is already made into an extension and I'm trying to
integrate with the Radiant part of the site. Will share_layouts work
being called from a controller in an extension? Or does it expect there
to be a RAILS_ROOT/app folder.
I'm using share_layouts within an extension (using the extension's 
controllers to process the page) currently with 0.6.7.  Make sure that 
you uncomment the following line from your my_extension_name.rb file:


 require_dependency 'application'


When I use the line
radiant_layout 'Main'

I get an error that radiant_layout in an undefined method.
  


Hmm, that's weird.  Where are you putting that line?  It should be 
available as a class method like:


 class MyController < ApplicationController
   radiant_layout 'Main'

   ... your methods/actions here...

 end


When I use

@radiant_layout = 'Main'

it creates the page but displays it in the admin layout.  ???
If I substitute a fake name for Main, it does the same thing so it
appears to be defaulting to the admin layout.

  


Do you actually have a layout created in Radiant called "Main"?

-Chris
___
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] share_layouts extension

2008-06-14 Thread [EMAIL PROTECTED]
On Sat, 2008-06-14 at 14:40 -0700, Will Emerson wrote:
> Through trial and error, I got the rails_support extension working in
> 0.6.7 and Rails 2.0.2.

Do you have any pointers for getting the rails_support extension
working? I am about to tackle this and was wondering if you could share
anything about the process.

Thanks,
Nate

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


Re: [Radiant] share_layouts extension

2008-06-14 Thread Chris Parrish

Will Emerson wrote:

Through trial and error, I got the rails_support extension working in
0.6.7 and Rails 2.0.2. But now I'm trying out the share_layouts
extension and I'm having some problems getting it to work. In this
project, my app is already made into an extension and I'm trying to
integrate with the Radiant part of the site. Will share_layouts work
being called from a controller in an extension? Or does it expect there
to be a RAILS_ROOT/app folder.
I'm using share_layouts within an extension (using the extension's 
controllers to process the page) currently with 0.6.7.  Make sure that 
you uncomment the following line from your my_extension_name.rb file:


 require_dependency 'application'

When I use the line 


radiant_layout 'Main'

I get an error that radiant_layout in an undefined method.
  


Hmm, that's weird.  Where are you putting that line?  It should be 
available as a class method like:


 class MyController < ApplicationController
   radiant_layout 'Main'

   ... your methods/actions here...

 end


When I use

@radiant_layout = 'Main'

it creates the page but displays it in the admin layout.  ???
If I substitute a fake name for Main, it does the same thing so it
appears to be defaulting to the admin layout.

  


Do you actually have a layout created in Radiant called "Main"?

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


[Radiant] share_layouts extension

2008-06-14 Thread Will Emerson
Through trial and error, I got the rails_support extension working in
0.6.7 and Rails 2.0.2. But now I'm trying out the share_layouts
extension and I'm having some problems getting it to work. In this
project, my app is already made into an extension and I'm trying to
integrate with the Radiant part of the site. Will share_layouts work
being called from a controller in an extension? Or does it expect there
to be a RAILS_ROOT/app folder. When I use the line 

radiant_layout 'Main'

I get an error that radiant_layout in an undefined method.

When I use

@radiant_layout = 'Main'

it creates the page but displays it in the admin layout.  ???
If I substitute a fake name for Main, it does the same thing so it
appears to be defaulting to the admin layout.

When I backed up and ran the tests for share_layouts, I get a failure.
The results are below.

It looks like it is not loading a helper.

I appreciate any help and tips on how to use this extension.

Thanks,
Will Emerson





102:share_layouts willemerson$ rake --trace
(in /Users/willemerson/work/essence/vendor/extensions/share_layouts)
** Invoke default (first_time)
** Invoke test (first_time)
** Execute test
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
-Ilib:lib
"/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake/rake_test_loader.rb"
"test/functional/share_layouts_extension_test.rb"
"test/functional/share_layouts_test.rb"
"test/unit/radiant_layouts_test.rb" "test/unit/rails_page_test.rb"
"test/unit/share_layouts_helper_test.rb" 
/Users/willemerson/work/essence/vendor/extensions/page_attachments/lib/
geometry.rb:6: warning: already initialized constant FLAGS
/Users/willemerson/work/essence/vendor/extensions/page_attachments/lib/
geometry.rb:11: warning: already initialized constant RFLAGS
/Users/willemerson/work/essence/vendor/extensions/page_attachments/lib/
geometry.rb:28: warning: already initialized constant RE
Loaded suite
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake/rake_test_loader
Started
..FE.
Finished in 0.627939 seconds.

  1) Failure:
test_should_add_helper(ShareLayoutsExtensionTest)
[./test/functional/share_layouts_extension_test.rb:16]:
 is not true.

  2) Error:
test_should_assign_layout_of_page(ShareLayoutsHelperTest):
NoMethodError: undefined method `_layout' for #

/Library/Ruby/Gems/1.8/gems/radiant-0.6.7/vendor/rails/activerecord/lib/
active_record/attribute_methods.rb:205:in `method_missing'

/Users/willemerson/work/essence/vendor/extensions/share_layouts/test/
unit/share_layouts_helper_test.rb:35:in
`test_should_assign_layout_of_page'

29 tests, 56 assertions, 1 failures, 1 errors
rake aborted!
Command failed with status (1):
[/System/Library/Frameworks/Ruby.framework/...]
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:899:in `sh'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:906:in `call'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:906:in `sh'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:985:in `sh'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:920:in `ruby'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:985:in `ruby'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake/testtask.rb:117:in
`define'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1003:in `verbose'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake/testtask.rb:102:in
`define'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `call'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `execute'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `execute'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:508:in
`invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `synchronize'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in
`invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:518:in
`invoke_prerequisites'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1183:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1183:in `send'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1183:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:515:in
`invoke_prerequisites'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:507:in
`invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `synchronize'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in
`invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:494:in `invoke'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1931:in `invoke_task'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in
`standard_exception_handling'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1903:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.