Can you render an adva theme "layout" in standard controllers?

0 views
Skip to first unread message

khoward

unread,
Oct 29, 2009, 1:12:45 PM10/29/09
to adva-cms
I have a rails app, with adva-cms installed. I have a controller
called "tasks" that I would like to have render the /public/sites/
site-1/themes/mytheme/layouts/content.html.erb layout. Is there a way
to do this?

I noticed that in my controllers, I can do layout "default" and it
will render the adva cms default layout, however, if I use layout
"content", it breaks.

I'm not sure if I am using the incorrect syntax, or if I need to add
the current enabled-theme to the layout search path somehow...

Saurabh Bhatia

unread,
Oct 29, 2009, 1:14:03 PM10/29/09
to adva...@googlegroups.com
Can you post the syntax ?

Regards

Saurabh
--
Best Regards

Saurabh Bhatia

http://safewlabs.com/
http://github.com/saurabhbhatia



khoward

unread,
Oct 29, 2009, 1:45:11 PM10/29/09
to adva-cms
I figured out how to add it, but that leads to another problem.

class TasksController < ApplicationController
self.append_view_path(File.join(RAILS_ROOT, 'public/sites/site-1/
themes/mytheme/templates')) # Add adva cms theme path(s)
layout "content"
...
end

This works now... but adva_cms is pre-populating the @site variable
with several before_filters in ArticlesController < BaseController
(article_controller.rb). Is there a way to populate the @site
variable so that I can use the theme across my entire rails app? Or,
with the amount of theme integration into adva, do I need to duplicate
my theme and customize it for my own controlllers, and leave the
template inside of /app/views/layouts/? That would be less DRY... is
there a best practice or recommendation for this use-case?



On Oct 29, 1:14 pm, Saurabh Bhatia <saurabh.a.bha...@gmail.com> wrote:
> Can you post the syntax ?
>
> Regards
>
> Saurabh
>

khoward

unread,
Oct 30, 2009, 1:08:18 PM10/30/09
to adva-cms
This problem in general is best solved with using CELLS to display
widgets/blocks/partials that rely on other controllers (your personal
controllers) (not adva-cms engine controllers).

To read about cells read the guide (I skipped that part since it's
only 5% complete...). I have been unable to get the full set of cells
features working (e.g., in a MyCell "pseudo-controller",
render :layout doesn't seem to work to render a cell with a specific
layout.
Reply all
Reply to author
Forward
0 new messages