are you always typing the same code like <sc:text field=”Headline” /> ? After I spoke about XSLT at one meeting by the german .NET User Group niederrhein, Daniel Fisher showed how to insert code snippets for xml. We tried to create a snippet for xslt as well and it’s pretty easy.
After this I thought of typical code lines I write for Sitecore projects. I think one is: <sc:<control> field=”<field name>” /> isn’t it? Yes it is possible to create editable areas for xslt code snippets as well, I show you how.
I created a Sitecore.snippet file and placed it under: C:\Dokumente und Einstellungen\<Your Username>\Eigene Dateien\Visual Studio 2008\Code Snippets\XML\My Xml Snippets.
After that you can insert an element for a snippet:
<CodeSnippet Format=“1.0.0“>
<Header>
<Title>Sitecore sc:text</Title>
<Author>Christopher Wojciech</Author>
<Description>Adds an sc:text element to your code</Description>
<Shortcut>fld</Shortcut>
</Header>
<Snippet>
<Declarations>
<Literal Editable=“true“>
<ID>type</ID>
<Default>Text</Default>
<ToolTip>Type your function name here.</ToolTip>
</Literal>
<Literal Editable=“true“>
<ID>field</ID>
<Default>field name</Default>
<ToolTip>Type your field name here.</ToolTip>
</Literal>
</Declarations>
<Code Language=“XML“><![CDATA[ <sc:$type$ field=”$field$” />$end$]]></Code>
</Snippet>
</CodeSnippet>
You can insert an editable area by typing $yourId$ in your CDATA section under <Code Language=”XML” />, you also have to specify the <Literal /> element under <Declarations />. Now you can use your code snippet in xslt by typing <fld>[TAB] and can edit the type of the sitecore control and the field name.
I also added the <xsl:value-of select=”sc:fld(..)” /> code snippet.
Please post me your snippets you want to have, I will add it to the sitecore.snippet file and upload it to my blog.
as a Developer in a the german area, I’m creating solutions in the german language more than in english. If you have seen the already the issue that in another website language some buttons aren’t translated you can resolve it yourself, I will also create a support ticket at the Sitecore support; but then you have to wait until the next release.
The “self-doing-way”:
Go into the Core Database (you can switch the databases by clicking on the icon left beside the clock) . Open the content editor and then you have two solutions:
Set the field called “Header” in the “WebEdit Button” data template to shared
Add new versions to the languages in the “Header” fields under the path: /sitecore/content/Applications/WebEdit/Buttons/Associated Controls/*
You have to be aware of the way to change a template field and set it to shared that other language versions are being lost, and it’s also a heavy change in the Sitecore core database, but in order to point out all ways I have to mention that as well. I would go for the new language versions on content items.
Another issue is that you have to rename the language to the same item name / key as it is in the Sitecore core database. For example: I have created a language called “de-DE” for german, but in the core database is only the “de” language item. So I have to rename the language from “de-DE” to “de”. (Also you can go the other way round, but changing the core database should only be the last solution!)
That’s it for today I guess. I will update my post if the Sitecore support has answered.
Thanks to Steen Pedersen, who a really nice guy and pointed me to the items having the header field. It has been a pleasure to meet you guys.
sitting in the Sitecore 6 Training and solving questions come up while the training I have tried to create my own replacer tokens for Sitecore 6.
You may already know that there is:
$name
$date
$time
$now
available in Sitecore 6, but I wanted to know where to hook into to create my own tokens if I maybe want to create default values for the current user or something else.
In the web.config are two pipelines called:
<expandinitialfieldvalue help=”Processors should derive from Sitecore.Pipelines.ExpandInitialFieldValue.ExpandInitialFieldValueProcessor”>
<processor type=”Sitecore.Pipelines.ExpandInitialFieldValue.ReplaceVariables, Sitecore.Kernel”></processor>
</expandinitialfieldvalue>
Fixed: The Sitecore Client Authoring role had been assigned all access rights for the /sitecore/content item, which gave all content authors more access rights than intended.
Fixed: A runtime error could occur when a user attempted to select a workflow command to move an item from one state to another.
Fixed: Despite restricting access to an item in a specific workflow state, the “Edit” button was still enabled and allowed users to edit the item.
Fixed: The AccessResultCache was not always cleared after an item was moved to another workflow state, which could result in inappropriate access rights assigned to the item.
Fixed: The Page Editor Edit mode attempted to open the contentStartItem of the Shell Web site, rather than the startItem of associated Web site, which caused editing issues in multi-site installations.
Fixed: The ComponentArt grid control used in the User Manager initialized itself multiple times, causing slower than necessary startup performance in sites with many thousands of users.
It’s good to see that Sitecore is still pretty active to resolve all issues.
I got a message by Phil Heltewig from Siteore Australia, that there is a really outstanding Sitecore implementation.
LoadIt by Sanity is Microsoft Australia’s online music store which is completely integrated into the Windows Media Player. Every WMP user has the application starter installed by now and can install the full application by clicking on the LoadIt icon in the Windows Media Player.
And its all based on Sitecore! […]
Have a look at the youtube video or read more on Phil’s blog. Really nice.chris
After working with sitecore 6 for a while, I missed the feature to unlock every locked item by any user. Especially after a sitecore sales training some of my co-workers missed it as well. I customized the “MyItems” client application in a way, that you now can unlock any item and see every locked item.
I created a sitecore package, but didn’t have the chance to test it yet, so if you want to help me. Just leave me a comment and you will get the sitecore package with all changed xaml, dlls and items. But now, step by step:
I added a ribbon to the locks chunk. In the core database under: /sitecore/content/Application/Content Editor/Ribbons; also I added read permission for the admin user and denied it for sitecore\everbody
Copied the my items xaml application from \WebSite\sitecore\shell\Applications\WebEdit\Dialogs\LockedItems to \WebSite\sitecore modules\Shell\AllLockedItems and changed some messages and text
The reflector helped me to get the code from this application and to modify it in the I need to get all items instead of the items of the current user. (The MyItems app used the new sitecore fast:/ query, but because this is still a little buggy I removed the fast query.)
Create a new csproj and insert the code I need and change the references in the xaml file.
I guess that every step I made. I hope you can give me some feedback and help you to save some time Just leave me a comment and you will get the sitecore package.
while I’m working with Sitecore 6, I missed the feature to sort my layouts in subfolders, so called “node item(s)” in the new version (the treepicker on the right hand side).
So if you want to list subfolders as well, go to this “\WebSite\sitecore\shell\Applications\Layouts\DeviceEditor\DeviceEditor.xml” file and replace this line:
This adds the template id of the node item template to the filter of displayed items in the tree picker.
Good night, cheers chris
Read Alex’s comment to learn how to do it in a nice way, use the override folder instead of changing the original xml layout and use the folder template id instead of the node template.
while I’m watching the Euro 2008 or Formula 1 I’m writing about the new layout editor in crestone.
If you are a user with page designing features, you get a button in the page editor at the top (first screenshot) and if you click on it; the new page editor opens at the top of your page. As you see in the second screenshot you have a list with all aviable placeholders (and a description and/or an image - if you add a so called “placeholder definitoon”). All of you know the problem, you have to remember the given placeholder key or you have to open the layout and look for it.
At the top you can set the layout as well.
Look at the “blue arrow” in the screenshot, you can see where the placeholder is. Pretty nice
You can also set allowed controls for a special placeholder, nobody can add a rendering which isn’t for this placeholder. You can set a description for a rendering / sublayout as well.
All this features are rendered in realtime, you click on add and the rendering gets inserted in the placeholder you selected.
The old school property editor is still alive and is still be used, as you might see in my last screenshot.
I still don’t know I like this feature or not , if you are a smart reader of my blog you might know the placeholder selection for Sitecore 5.3. To be honest, I really love this! In my last days I forgot to write an entry, because I was so interested in building a new site in Crestone instead of writing.
Have a nice weekend, and enjoy the Euro 2008. cheers
So,
our next stop on the way to Crestone is the whole new webedit client in Crestone, now called “Page Editor”. The upcoming Sitecore version finally supports inline editing of content.
So, if you want to edit the current site, you have an edit button at the top at your page. And if you click on it you get a menu: Save, Save & Close, Close (without saving the changes), Ribbon. On the screenshot to the left you see the new onsite editing. You can change or insert an image as well (the question mark). That’s a feature what everybody wanted to have, you can see how it looks like, live. No more preview ;-).
If you click on the “Ribbon” button, the well know ribbon strip in the content editor is inserted at the top. You can change the versions, duplicate or navigate thorugh the tree for example. Pretty handy and useful for every content editor.
Sitecore changed a lot in the security concept, so my Crestone beta comes with a preinstalled starter kit. On the left site you see a couple of new Sitecore roles, “minimal authoring features” for example. Or with “page designing features” - sounds pretty interesting, he? I will write about that in my next entry.
Sitecore introduces three different types of content editor rights: minimal, limited or normal. See the differences in the screenshots below.
Well guys, the time passed and I have to finish. Hope I could give you some insights of Sitecore Crestone. Good night