Sitecore: Powerful but mystifying
My Quickflix project (codenamed: phoenix) is going well and working with SiteCore has proven to be a challenge in both the best and worst senses of the word.
Articles on the net seem to be a bit thin on the ground when it comes to some of the more advanced areas of the application and it is proving to be a bit of a struggle. While the API documentation is great, finding out what certain parameters mean and also how / if I can do things is proving to be difficult, often ending up with just going back to trial and error.
If anyone out there has any knowledge about the following, or can point me to some help that would be great:
Passing fields as parameters to renderings: is it possible? can you do it from within the content editor? I would like to have a rendering that allows the user to specify some values from fields in the template (like the background image to use) but not actually specify the value, just the field to grab.
Can I write Sitecore or ASP control references in XSLT templates and still have sitecore render them? This would be handy in some of the controls I am trying to build, otherwise I will have to build ASP controls and write a heap of logic behind them, rather than just parsing the XML.
So far I am pretty happy with SiteCore and I am enjoying trying to meld it into something that will be easy for the content managers to use, whilst still allowing a heap of flexibility in page layout and functionality. Baby steps.
Labels: Project Phoenix, Quickflix, SiteCore


3 Comments:
Hello Simon,
Exiting stuff happening here.
The answer to your questions requires a bit longer explanation, but the answer to your first question is certinatly "yes": Create a web control, then pass parameters such as "PriceField" to it. The PriceField refers to a field in your item/template. The value should be a traditional web control property.
Then read that field when rendering the control; something like:
string price =
Sitecore.Context.Item[PriceField];
The second question is also possible, but not recommended (Sitecore has an API that allows you to render string controls diretly from XSLT).
Also, it's possible to refer directly to .NET from your XSLT code but even in .NET framework 2.0 (where XSLT is being converted into .NET), this cannot be recommended either as all embedded objects are not added to the garbage collection stack and therefore a direct source of memory leaks.
Instead, simply use the web controls from your Sitecore application. Any .NET web control can be referred; all you should do is create the control in your "layouts" section of Sitecore.
I would recommend that you post two individual questions on our (very active) forum to get elaborated answers. I'm certain you will get qualified suggestions within a day.
Good luck,
Lars Fløe Nielsen
Sitecore
8 May 2007 15:48
BTW. Here are the link to the forum:
http://sdn5.sitecore.net/Forum.aspx
8 May 2007 15:50
Thanks Lars!
See you on the forum!
8 May 2007 16:19
Post a Comment
<< Home