Sitecore personalisation - DropLink - sitecore

Not fully used personalisaiton yet, so have what I hope is an easy question.
My page is setup where users can use a droplink to pick content for 3 "slots" on the homepage, from a "bucket" of available content items that can appear.
I want to use a "rule" to show different items in each slot, depending on if the rule is met or not, but I can't seem to work out where I set this.
Right now, my page editor view is broken (currently have an open ticket with Sitecore for work out why this is), so I am hoping this can be done from the content editor.
I have already ticked the "Show the Personalization Section" under Application Options.

This sounds like a conditional rendering rule that you're wanting to create. If that is the case, unless you want to apply the rule to ALL renderings (which I wouldn't recommend), you would create the rule under
System -> Marketing Center -> Personalization -> Rules. Here you can set up a conditional rendering rule that will check conditions and then do something. Since this is going to apply to presentation, the actions are limited. Mostly to presentation.
Now to apply that, you go to the layout details on the item or the standard values for the item template. When you click on the rendering (like you would to set a data source), it brings you to the edit screen and you should be able to scroll down to the Personalization section. If your rule is not in the list, then it's most likely in the wrong place. Anyway, if it's there, you simply put a check next to that box and it will now apply that rule when figuring out the layout details when the item is rendered.

Related

Sitecore 8 implement tooltip on RTE authored content

We have a requirement to implement tooltips for words that are authored in Sitecore RTE.
The idea behind is that user should be able to hover over the word and see it's description/meaning.
Is this possible to achieve in sitecore? Did a quick search on marketplace but could not find any modules.
Below are some options to consider for achieving what you described.
Inject Tooltip HTML in a renderField pipeline
In this option, you would extend the renderField pipeline. First, you will need to ensure that you are dealing with a rich-text field, and if so, locate terms and replace them with the necessary markup that is required for the tooltip. This could be as simple as wrapping the word in an <abbr> or perhaps a <span> element with a CSS class. The list of terms and tooltip content could be sourced from items in Sitecore or a custom Sitecore Dictionary. Caching the terms would be essential as this pipeline processor is invoked frequently every time a field is rendereded.
Progressive enhancement with JavaScript
This approach is almost entirely based on the client-side. Terms could be located and replaced fairly easily with the help of JQuery. If the list of terms is of a reasonable size, they could be bootstrapped into a JavaScript variable. Once terms are located and enhanced, a separate, asynchronous call to a REST endpoint could be made when hovering or clicking the term. The API would accept a term and respond with the term's definition.
HTML Snippet in RTE Editor
Sitecore RTE editor can be extended with additional buttons. One of these options allows you to insert predefined snippets of HTML. The RTE editor also has a setting to specify a CSS file to style the content within the field (<setting name="WebStylesheet" value="/css/yourstylesheet.css" />). Styling would be necessary in order to target the description markup and make it visible to be edited, whereas, on the public site, the description markup would normally be hidden by default until the term is clicked on or hovered over.
Dynamic Link Replacement
http://www.layerworks.com/blog/sitecore-token-replacement

Specify order of slides in carousel?

Is there a way to control the order of slides displayed to users in a carousel from the Experience Editor perspective? (or even the Content Editor)
Basically, based on the user that has been identified or not identified, I would like to display a different slide as the first slide of the carousel. All the other slides would still be present, just in a different, specified order.
Is there a way to accomplish this via rules or should I look at having to create separate datasources that have the different slide orders already specified?
TL;DR
Personalization can do three things:
vary a datasource for a rendering
vary a rendering (use another rendering basically)
hide a rendering.
I guess the question you need to answer is whether what you need can be accomplished by doing either one of these actions.
If you've used nested structures to represent your carousel (like we do in SCORE, you can see how it looks like here or here) it's not hard to show/hide certain panels based on personalization conditions and thus reorder the carousel. Depending on how exactly it looks on the published site you may only need to repoint datasources. Either way, it's personalization out of the box and your content structures working nicely together.
If you've used a (variation of a) MultiList field to represent a list of your panels with panels themselves being items somewhere in the shared content area it's not something personalization engine can change based on a condition. Changing a field value is, unfortunately, not on the menu. I am sure you can code around it thanks to Sitecore being so open and flexible but I am not sure you can make it seamless (e.g. variations preview in Page Editor).
Rendering parameters is also not something you can change but if yours are static and defined on the rendering definition item (as opposed to being supplied when component is bound to the placeholder and thus recorded inside the presentation details) you can get away with having two definition items for your carousel component (same code behind it) and picking the right one based on the personalization condition.
Hope it helps.

Sitecore Personalization - Change Sublayout parameters based on visitor profile

Is there any way to set different parameters for a sublayout based on visitor profile. When I goto presentation details and click personalize I can only set different datasource or rendering for different conditions.
Very short story is; you can't. While you might be able to via the Rules Engine as Vincent suggests; a more common solution is to not have a component rely too much on component parameters.
Try looking into moving your parameter into the datasource template for the item itself. That way, whatever it is you need to control when personalising, becomes something you define on the content item itself. Semantically also more correct - parameters should not really be used for anything that would change in personalisation scenarios.
You can create rules under /sitecore/system/Marketing Center/Personalization/Rules. To understand rules this could be a start point http://sdn.sitecore.net/reference/sitecore%206/rules%20engine%20cookbook.aspx
The diea, is that you create different rules, which will execute some actions when a set of conditions are satisfied.
Then, in the presentation detail of your control, you can chose which rules to apply.
In order to view the personalization section in the presentation details you need to go to:
Sitecore => Control Panel => preferences => Change your application options => View tab => Third section "Control properties" and check the "Show the personalization section.

Sitecore Conditional Showing of Fields

So I am rather new to sitecore, and it's a topic that wasn't covered during my training. My questions is just to help point me to the correct term, or documentation on a method to do the following.
I have a definition item, with a ton of field groups, what I want to do is something like:
if Value of Field X is "yes" then collapse/hide Field X or Field Group X.
Does that make sense? Is it a validation rule? or some other kind of rules, is it a workflow I need to attach? Do you place it on just the field I want to hide, or the field that triggers the action?
I appreciate any guidance.
There is nothing out-of-the-box in Sitecore to achieve what you want but there is no reason you cannot create a composite custom field type to do this. The following articles will help you achieve this:
Creating a custom Sitecore Field
Getting to Know Sitecore: Custom Fields, Part 1
Create a new control, inheriting either from Droplist (if the comparison of the value is to be text based) or Droplink (for comparison of ID). You could add a parameter in the Source field of the control to specify what the values that trigger the hide should be.
The underlying control in the Content Editor is just a standard HTML select element. Add onchange events to the control and add your Javascript handler to hide the other controls. Since I could not find a way of adding additional custom css classes to the Sitecore controls, it would be best/easiest to hide all other controls in the same collapsible group after you control. This would mean you would need to group your controls better (or logically at least).
The Javascript will be something like this (the Content Editor uses the Prototype JS framework):
if ($(this).getValue() == 'no') {
// find the parent container of this control and then hide all the next siblings in the same group
$(this).up('.scEditorFieldMarker').nextSiblings('.scEditorFieldMarker').invoke('hide');
}
You can test this by running the above in the console, change out the keyword this with the id of your field, e.g. $('FIELD2292054').
What I am not sure about is how to trigger the hide on initial load, i.e. when someone returns to an existing item, it may be possible by adding to one of the pipelines, but would be better using a JS solution if possible. I'll have a think about this and get a proper code sample up over the next few days.
EDIT: You can add an event handler to sc:contenteditorupdated to handle the content editor being rel-oaded.
document.observe("sc:contenteditorupdated", myFunction);
I wrote up a blog post and put the code on GitHub if you are interested.
Not sure if you have come across Andy Uzick's this blog post.
He wisely talks about hiding fields in the Content Editor and has also created a Sitecore Module called Hide Field Template Extension which is hosted on the Sitecore Marketplace with the full source code to extend.
After reading through and trying the extension, I do feel that it will not completely resolve your issue (how you have described it in the question).
But it will give you:
A mid-term solution to hide a few unnecessary field that some content editors would not like to view.
Fields that are only required by administrators for admin purpose - to de-clutter these fields could be hidden.
Just one thing to bear in mind that it mentions in the requirements Sitecore 6.5 & 6.6. I have not tested it in Sitecore 7. If you are using Sitecore 7, which I think you are, one could modify the source code and make it work for Sitecore 7.
Have a look and share your findings.
Happy Sitecoring!

How to find which items uses a particular layout

Is there a way in Sitecore to see if/which items uses a particular layout. I would like to change a layout but cannot find a way to see which items will be impacted by the change.
You could go to the layout item in Sitecore under for example '/sitecore/layout/Layouts/customername/page/standard layout'. Then you could open the references tab by opening the 'navigate' ribbon on top and selecting the arrow next to 'Links'. You will see a dropdown with the referers in it, which makes it easy to see what items depend on the layout.
Good luck!