uploading themes keeping site content

Jan 11, 2011 at 10:28 AM
Edited Jan 11, 2011 at 12:07 PM

Hi.

When I change from one theme (like the theme machine) to some other I've created, only the navigation and page content are kept.

Wouldn't it be expected that the theme changed only the css and html of the website, keeping all contents (widgets for example)?

So the question is, how and does it make sense to reuse existing site contents? If I took hours or even days creating my site, will I loose everything once a new theme is applied?

 

Also, will V1 still require manual install&enable of Indexing+Search+Lucene and enable of Packaging Services+Packaging+Gallery features? Cause if I decide to ship the search bar, orchard will crash for @using Orchard.Search.ViewModels; and without those 3 other features, an unexperienced user won't be able to upload the theme directly.

If this will work the same way in V1, is there a way I can make the theme package activate those features if not active yet? Or I'll have to create a script that runs Orchard.exe feature activation commands? It would be great if these features became active right after installing Orchard.

Developer
Jan 11, 2011 at 3:17 PM

AFAIK the theme is just a special case of a module, so you should be able to add dependencies to it in Theme.txt file, like for any other module. Dependent features will be automatically enabled when you enable your theme.

- Piotr

Jan 11, 2011 at 3:37 PM
Edited Jan 11, 2011 at 3:41 PM
pszmyd wrote:

AFAIK the theme is just a special case of a module, so you should be able to add dependencies to it in Theme.txt file, like for any other module. Dependent features will be automatically enabled when you enable your theme.

- Piotr

I'f the dependencies work as search and indexing and others, they have to be enabled manually before the last feature can be enable too

 

And also what about the widgets not being reused?! Must be a way to enable that

Coordinator
Jan 11, 2011 at 4:16 PM

Widgets will be conserved IF the new themes have the same zones with the same names correctly defined. Dependencies can be declared in the manifest as has been said, and the bug about the order of activation should be already fixed. If you see a crash, that's a bug that should've filed in the issue tracker. Thanks.

Jan 11, 2011 at 4:21 PM
bertrandleroy wrote:

Widgets will be conserved IF the new themes have the same zones with the same names correctly defined. Dependencies can be declared in the manifest as has been said, and the bug about the order of activation should be already fixed. If you see a crash, that's a bug that should've filed in the issue tracker. Thanks.

got it.

thanks!

Jan 11, 2011 at 4:55 PM

widgets seem to work

 

now how do I incude module dependancy in my theme

Indexing+Search+Lucene and Packaging Services+Packaging+Gallery features

 

Coordinator
Jan 11, 2011 at 7:19 PM

Like you would in a module, in the manifest. Add a feature that has the same name as the theme and put dependencies there. You can take an example from one of the modules in the source.

Jan 13, 2011 at 6:16 PM
Edited Jan 13, 2011 at 6:29 PM

I've added this to theme.txt

 

Features:
    mytheme:
        Name: mytheme
        Description: Custom Theme
        Dependencies: Gallery, Orchard.Search

 

it still crashes if search not active and does not activate it

 

help please

 

I guess it's a no go, since the feature doesn't even come installed after installing orchard

Jan 13, 2011 at 6:29 PM

This is probably a little tangential to the discussion, but I would think that most themes would benefit from *not* relying on specific module dependencies.  I realize you probably have a search box in your design or the like, but ultimately that's a widget which should be added/removed independent of the theme, to my mind.  

Jan 13, 2011 at 6:33 PM
pvencill wrote:

This is probably a little tangential to the discussion, but I would think that most themes would benefit from *not* relying on specific module dependencies.  I realize you probably have a search box in your design or the like, but ultimately that's a widget which should be added/removed independent of the theme, to my mind.  

the thing is, people are creating themes with instruction files attached for search form customization procedures, when in my opinion it should be installed and enabled ootb

Jan 13, 2011 at 6:39 PM

I'm not sure I follow your point, nor do I see why it's a problem that it's not installed out of the box.  But we have different backgrounds and experiences, so that's fine.

What I think would be a great solution (and indeed, have been thinking on how to do it) would be to create a site template package feature.  So you setup a site on your dev box, add whatever features, themes, startign data, etc that you want, and then you can package that as a site template and use that as a different unit of reuse than the Theme, which really should be all about styling and look and feel, not functionality.

Jan 13, 2011 at 7:07 PM
pvencill wrote:

I'm not sure I follow your point, nor do I see why it's a problem that it's not installed out of the box.  But we have different backgrounds and experiences, so that's fine.

What I think would be a great solution (and indeed, have been thinking on how to do it) would be to create a site template package feature.  So you setup a site on your dev box, add whatever features, themes, startign data, etc that you want, and then you can package that as a site template and use that as a different unit of reuse than the Theme, which really should be all about styling and look and feel, not functionality.

Whenever you build features that use Search functionality, after installing the feature your users will come up with a crash for missing reference. I think Search should at least be installed, even if disabled by default.

The site template is a feature known from SharePoint, and maybe other CMSs, and should be nice to have in Orchard, since it enables a kind of "one-touch" build up.

 

Coordinator
Jan 13, 2011 at 7:11 PM

Your feature should not crash if there is no search provider installed.

Jan 13, 2011 at 7:16 PM
bertrandleroy wrote:

Your feature should not crash if there is no search provider installed.

it crashes in @using Orchard.Search.ViewModels;

it does not crash if search is not ACTIVE. but without it installed, it does crash

if there was a way if conditionally add the reference, then I'm sure it would work even if without search functionality

Jan 13, 2011 at 7:20 PM
Edited Jan 13, 2011 at 7:22 PM

yet another thing.

Is there a way to uninstall a module? I mean other them removing the foder in \Modules...

 

and of course using orchard.exe uninstall package

Jan 13, 2011 at 7:27 PM

Maybe there is a better way to add a search form to the layout, conditionally

Jan 13, 2011 at 8:06 PM
ftlcd wrote:
bertrandleroy wrote:

Your feature should not crash if there is no search provider installed.

it crashes in @using Orchard.Search.ViewModels;

it does not crash if search is not ACTIVE. but without it installed, it does crash

if there was a way if conditionally add the reference, then I'm sure it would work even if without search functionality

Yeah, so that was exactly my point, you should not be hard-coding the search form into your theme layout, in my mind