Clay Tutorial Part 2: Zone Proxy (using Placement with Layout)

Topics: Announcements, Writing themes
Jan 24, 2012 at 2:03 PM
Edited Jan 24, 2012 at 2:10 PM

This week, see how you can rig placement to allow pushing shapes to any zone on the page. I know some people have been after an easy method for this for a while :)

Jun 6, 2012 at 5:18 PM

Hey Pete,

I'm trying to implement this and downloaded the files that you provided on your blog, but I have a couple questions on how to get it going.

1. Can I place these files in my theme and have them work? (my theme has  project file)

2. If I can place them in my theme, do they need to go in a particular directory or just dump them in the root?

3. Do I have to do anything other than include the files and then modify my

So, here's what I tried. I tried putting them in the root of my theme, in a folder named /Drivers under my theme. I tried putting them in the root of a module that I'm working on. And I've obviously modified my to: <Place Parts_Title="Layout@BeforeContent:1"/>

I can't seem to get the Page title to display in that zone though.

Thanks for any help you can provide.

Jun 8, 2012 at 5:34 AM

1. yes

2. no

3. no


This will also be available out of the box in Orchard 1.5.

Jun 8, 2012 at 6:24 AM

Thanks for the response...I've done just about everything I can think of to get this to work, but I'm still missing something. I'm not sure what else to try. Nothing is showing up in the log files. My Page title is not showing in Content, which means the Placement file is working as far as targeting the right shape, but I just can't get it to put it in the BeforeContent zone.

I put the files in the root folder of my theme and changed the namespace in the files to the theme name - didn't work

I put the files in the root folder of a module and changed the namespace in the files to match the module - didn't work

I've tried using every zone in Placement - didn't work

I tried running in debug mode - no errors (good I guess)

I think my biggest problem is I don't know how to troubleshoot this to figure out where my issue is. Grrrr

Jun 8, 2012 at 6:28 AM

And you correctly added the files to the csproj?

Jun 8, 2012 at 6:33 AM
Edited Jun 8, 2012 at 6:35 AM

I think so...I right clicked on the project and selected Add --> Class file. Did this for each of the files and copied/pasted the code from the stackoverflow post (instead of using the downloaded files from before...just to make sure).

This should have added them to the csproj properly, correct?


I opened the csproj file in Notepad and the class files are listed there 

Jun 8, 2012 at 6:36 AM

Oh...and I added a reference to ClaySharp

Jun 8, 2012 at 6:39 AM

If you saved all, yes.

Jun 8, 2012 at 6:47 AM

yes...did a save all

Jun 8, 2012 at 7:00 AM

So what happens if you put a breakpoint in that code?

Jun 8, 2012 at 3:08 PM

Absolutely nothing. I put a few, but in particular one at the beginning of the GetIndex method and nothing is I would assume the files aren't being read.

Jun 8, 2012 at 3:24 PM

I got it!

I created a brand new module and called it Downplay.Origami.ZoneProxy...gave the module a category, dumped those two files in there, recompiled everything, enabled the new module from the Admin area, and's working now.

Thanks for all the help in getting that working. It would be nicer to bundle it with the theme, but by the time I finish the theme, Orchard 1.5 will probably be out =) lol

Jun 23, 2012 at 10:23 AM

fantastic! this works really great and very nice to see it's included in v1.5!