How to hide the list ribbon in XSLT List Web part in SharePoint 2010? - list

In SharePoint 2010, I have a custom list "Clients" on a site. On the home page of the site, I have added a Clients List Web Part. When I access the home page in a browser and click anywhere in that list, it displays the "List Tool" ribbon group which has "Items" and "List" ribbons. I do NOT want these ribbons at all when clicking on the list. How do I achieve this? Should I disable the click event on the list so these ribbons do NOT appear? How do I disable the click event on the list? Or What should I do to hide these ribbons when clicking on the list?
Basically I want it to behave same as content query web part. In content query web part, if you click anywhere in it, it doesn't show up any extra ribbons. I want the same behavior with list web part.
Thanks
Hitesh

One approach would be to follow the tutorial outlined in this blog post: Remove actions from the ribbon: SharePoint 2010
The end result is a UserControl that you can place on any page and "trim" (i.e. hide) certain portions of the Ribbon: entire tabs, or individual groups or buttons on the ribbon.
If you follow the prescribed solution from the blog, then you would add the following lines in your Page_Load event:
SPRibbon ribbon = SPRibbon.GetCurrent(this.Page);
if (ribbon != null) {
ribbon.TrimById( SPRibbon.ListTabId );
ribbon.TrimById( SPRibbon.ListItemTabId );
}
Additional ribbon element IDs can be found at:
As referenced in the CMDUI.xml XML file
As defined by public fields on SPRibbon (used in example above)
Of course, the downside to using this approach is that the particular ribbon elements you hide are hard-coded in the UserControl. To get around this, I used the UserControl as a basis to create a Web Part that allows you to define which ribbon elements to hide via a property. It works great and is generic enough to be applicable to many different scenarios.

Related

Sitecore replicate changes throw all the pages

I'm trying to implement a menu in sitecore page. Menu that will be available in all the pages.
I can do a rendering that goes to some specific datasource and assign the rendering to a placeholder inside Design Layout of the layout.
However how can they edit the datasource (order, ammount of elements, etc..) item in page A that will be also replicated in page B.
Without going through all the pages to change order, color, text, items etc...
To do that you will want to create a new data template that holds the shareable content on it. So it would have fields for navigation items etc... any setting that you wanted to be shared across pages.
Then in your rendering, you can set the Datasource to this item. Any changes to that item would be reflected across all pages that use it.
You should add the rendering to the standard values of your page templates and set the Datasource to your main default navigation item, then all new pages will get the navigation ready setup.
You need design your view in such a way that it should be editable in experience editor mode.
If you have implemented using Glass Mapper there is good section on how to use Edit Frame.
Also you can check below community blog. for more details.
https://community.sitecore.net/technical_blogs/b/sitecorejohn_blog/posts/render-field-values-for-mvc-solutions-using-the-sitecore-asp-net-web-cms

Experience Editor custom functionality

In some of our pages, we have a component that is a list of links. In Sitecore, this is stored in the following manner -
- Component data source
- list item 1
- list item 2
- list item 3
Right now the Sitecore users can only add links to the list by going into the Content Editor and manually adding a list item. This is not very convenient for users as they have to constantly switch between Content and Experience Editor.
I would like to provide a functionality in the Experience Editor itself which can allow users to add these link items using a layover type functionality.
I did a quick search and wasn't able to find anything concrete. Is there a way to update achieve this functionality?
You should create a custom WebEdit button which will allow to add children to your datasource.
You can read more about it here Sitecore Page Editor: Creating a WebEdit button

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

Sharepoint 2013 | Direct link from List Item to Document Set

I need a direct link from a list item lookup column (other column types might be correct I am not sure) to a document set.
At the moment a dialog opens and then I have to click open to then send me to the document set. This doesn't feel very cohesive and isn't the best for the user experience.
I have a custom list of 'solutions' and want to link to the relevant document sets.
Your 'Associated Documents' column should be a hyperlink/picture column, which will allow you to directly launch to whatever your URL is without a dialog.

how to set the rights for placeholder ribbon

beginner question for sitecore about settings the right.
So I have an item is open in the page editor.
The renderings on the page has bunch of icons on the ribbon. One of them called 'select the parent element (element name)'.
In my case when I click on it, I am presented with the placeholder with button 'add here' and the ribbon with some component buttons that a user can use to add the controls.
So, QUESTION:
"how I add access to the button on that ribbon for certain role? Where do I set it up? "
For some certain role that placeholder's ribbon is completely empty, including there is no button 'select the parent element' even though
i know there is a parent element.
thank you very much for help,
HF
Here are the screenshots (no icons on the placeholder ribbon, and the user's rights:
enter image description here
And here is how that looks for the admin:
All the settings for the Page Editor are held in the Core database. So in the Sitecore Desktop, switch to the core database and open up the Content Editor.
Navigate to : /sitecore/content/Applications/WebEdit
This item holds the items that make up the page editor. To edit the ribbon menues, go to:
/sitecore/content/Applications/WebEdit/Ribbons
I don't remember seeing that particular button in the Core database, so this is likely a built-in feature that requires the user to have one of the built-in permissions.
The first thing I would check is that Designing is turned on. Have the user go to the 'View' tab in Page Editor and make sure they have checked the 'Designing' checkbox.
If that doesn't work, it sounds like the user you have does not have design access to the page. I would examine the inherited roles using the User Manager and check if they have the Sitecore Designer role inherited.
It is possible they just need to be provided the correct role in the system so that they can access the buttons.
Have you tried the "Sitecore Client developing role"?
Also, for the blue arrow drop list location, in order for the rendering button to show up in that location, you have to check whether the button in the webedit folder under core database(/sitecore/content/Applications/WebEdit/Default Rendering Buttons). The Type field needs to be "Common" in order to show up in the blue arrow droplist.
Example can be the "Edit related item" (/sitecore/content/Applications/WebEdit/Default Rendering Buttons/Edit related item) shows up in the blue arrow droplist.