Themes and widget

Topics: Administration, Customizing Orchard, General
Nov 15, 2011 at 5:35 AM

Hi,

I have created new themes. And i have put html widget to before main and footer. When i create another page, those home page before main and footer content has in new page. If i edit those content home page content also changing. How can i keep each page content seperately?

 

lakmal

Nov 15, 2011 at 2:35 PM

You can use Url layers to have a separate widget layer on each page, although this is a bit fiddly and not very good if you change any urls of your content.

My Mechanics module has a "Paperclips" feature which allows you to attach content to your pages and push it into different zones, it achieves the same thing as widgets but it uses proper relationships between your content items instead of arbitrary url-based rules. Only thing is, it's a bit harder to understand in the first place (and my documentation is quite poor), but much better once you get your head around it, and you can use it for a lot of other things as well.

Nov 15, 2011 at 3:38 PM

Can i use layer rules for each widghet?  Then each widget display only perticular page. Is is efficience way to handle page?

 

Nov 15, 2011 at 4:02 PM

A widget is always attached to a specific layers (and a layer can have multiple widgets in different zones).

A widget only displays if its layer is active.

A layer is only active if its rule returns true in the current context.

Therefore, widget display is entirely controlled by layer rules.

Nov 15, 2011 at 4:06 PM

Do you recommend widget to handle each page content? My web page has more than 30 pages

 

 

Nov 15, 2011 at 4:13 PM

I wouldn't really recommend layers for managing that many pages, especially if you plan to grow your website any more. But, it's built into Orchard and doesn't require any learning.

The other way is to use my Mechanics module and have the Paperclips feature push related content out to zones. It's more flexible but you might find it a steep learning curve. I recommend cloning the source from my codeplex site: http://scienceproject.codeplex.com - read the documentation there before you start, it explains the important concepts, and beyond that I can try and help. Whatever you do, don't install the package from Orchard gallery, it is badly out of date.

Nov 18, 2011 at 4:06 PM

Hi,

 

Can i have link to download ur mechanic module

 

lakmal

Nov 18, 2011 at 5:01 PM

You have to use Mercurial to get the source from the default branch on http://scienceproject.codeplex.com, and following the instructions for using CreateSymbolicLinks to virtualise the projects in your Modules folder. I did say the learning curve was steeper ;)

Jan 20, 2012 at 8:18 AM
Edited Jan 20, 2012 at 8:20 AM

hi randompete, i have getting a same problem like galgodage. can u please advise me how i assign different Urls to Aside widget. suppose i am using this rule for services page (  url '~/services'  ). now i want to show this widget  onto about us page or any one or them...how can i do... i try to add different Urls in rule but it is not working. (  url '~/services' and url '~/aboutus'  ). i am very thankful if you advise me :)

Jan 20, 2012 at 1:46 PM

The rule " (  url '~/services' and url '~/aboutus'  )" can never match true, because you can never be on one Url and another at the same time. You want 'or' instead.