Identify page nodes that have specific layout controller - sitecore

I would like to search all pages that have a specific(based on GUID) layout controller node. Is there a way to do this in Sitecore?
I am hoping to avoid going through all the page nodes and identifying the layout controller via the presentation detail. This would be a tedious tasks if I have to do so.

You can also go to the layout in sitecore and click on the "Navigate" ribbon and use the "Links" menu option. The Referrers are the items that use the layout.

You can use the Development Center for it.
Go to the Sitecore Menu -> Development Tools -> Developer Center
Then, Select Tools -> XPath Builder.
The query you need is like this:
/sitecore/content//*[contains(#__Renderings, '{A5437488-E6FA-42D3-B201-25D3CFE0A02B}')]
Find all items that contain a specific id on the __Renderings field.
The __Renderings is a field like any other. It stores the information about the layou, devices and renderings. That said, you can use Sitecore queries to find items based on it. See:

Related

What is Sitecore Datasource and why should use?

I'm new to Sitecore XP 8.2 and try to study by articles and youtube.
However, I can't figure out why we should use datasource, instead of having multiple items in the content tree? How can I enable Global on the content tree?
If you by 'datasource' means 'Rendering Datasource Location' heres a real life example, where using datasource is helpfull, instead of having data items underneath each page item.
Lets say, you have a Footer module, which you would like to include on all content pages in your website. And the Editors should be able to change the content of the footer module on all pages, but the effect should be global.
In this case, could a solution be, to make a folder at the top of your tree structure called 'Shared Modules', and point the 'Footer Rendering Datasource Location' at this folder.
In case an editor changes the footer text on the main page or a subpage, the effect will allways be saved in the same location.
unlike, a 'Texbox module' which you would like to have multiple of on multiple pages. these would you like to have placed underneath each of your content pages in a folder e.g 'Page Modules'.
You can use Sitecore Datasource for a variety of reasons. One of the reasons is to use this instead of context item so that you can refer to another item in Sitecore content tree. Another good reason is to personalize your content or run the A/B testing, content testing. Using Sitecore datasource, make different parts of page componentize and all this helps content editor to improve experience in content editor.
For some good information on using Sitecore datasource, you can look at
https://www.linkedin.com/pulse/how-improve-experience-editor-sitecore-number-ways-rohit-chopra
https://www.linkedin.com/pulse/sitecore-personalize-content-conditional-renderings-sub-rohit-chopra
In short, with datasources you can re-use your items, makes your life much easier if you want to go with personalization and its easier to manage in terms of security/workflows.
A datasource is a pointer from your presentation to a content item. This item can easily be picked from a global or local placement in the content tree. You can still navigate from the datasource to other items (like subitems) if you want a more complex structure for your content.
The advantages of using datasources, is that Sitecores presentation engine, Experience Editor and marketing/personalization is based on the usage of datasources. Further you cater for reuse of content, as multiple presentations can point to the same datasource item.
By using datasources you decouple the content from the structure of your content tree and hierarchy.

Sitecore 8.1 Header and Footer Composite Component

In Sitecore I have created base Template & Renderings for "Header, Top Menu, Logo, Search ,Login Button…etc that comes in Header across all Pages of the Site."
Also the same template & Rendering is using in other website so we can't set value in Standard field.
Now the problem is “suppose we have 100 pages in a Site then each page we have to go and add/update rendering & data source.
Is there any way that a “Header rendering” contains child rendering and by placing “Header rendering” render all its child renderings.
Header Composite Component ===>
Logo Component
Top Navigation Component
Search Component
There is a composite component module on the Sitecore Marketplace :https://marketplace.sitecore.net/Modules/C/Composite_components.aspx?sc_lang=en
This fill's your requirements exactly.
It works by creating a "Composite Component" item, then you add your renderings for your header to that component. E.g. Logo, Navigation etc...
Then in the standard values of your page templates, you add a new Composite Component rendering and set the datasource to the component item you created.
The module will then inject the renderings from the component item presentation into your current item. So you only have to update a single place to update all pages etc...
I have this running in a few production sites and it works well. It even supports the Experience Editor.
I don't think there's a solution out of the box. SxA solves this with Partial and Page Designs at site level. Just wrote a blog about it:
http://reinoudvandalen.nl/blog/sitecore-experience-accelerator-partial-designs-and-page-designs/
I also made something that might help you: Partial Layout Presets
http://reinoudvandalen.nl/blog/sitecore-partial-layout-presets/
It even allows you to store presets per site, but keep in mind that it injects composed layouts. If you modify the preset then it does not get applied to the pages where it was injected (though you might be able to pull something of with a shared datasource per site).
Lastly the obvious solution would be to create a page template per site so you'll be able to have standard values per site.
You may want to take a look at using Placeholder Fallback.
This will allow you to add components and renderings to a top level page and then the child pages would "fallback" to using the renderings inserted into the placeholder of the top level page in the item hierarchy. The editors can also insert page specific renderings on each child page if required.
If you do not want to custom code and only out of the box features then you could use Devices. You can find more information in the documentation about Set up a device layout. Once the device is created you can specify a different default device per site:
Now when you open the Presentation Details on the __Standard Values of your templates you can specify a different Layout or Renderings per device, i.e. different ones for AltSiteDevice

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 Page Editor Add New Page Inline

In my content tree, I have "Folder" items that have no presentation, but have all the insert options on them. How would you be able to use the "Insert Page" button in the ribbon to insert a new content item in the right part of the tree?
For Example:
I have my home page Content(Folder)/Home.item
All of my insert options are on Content(Folder), how do I add a new Home.item type without nesting it under Home.item?
In order to be able to use the Insert Page button, the item you are inserting under must have Presentation defined. It doesn't need to have components added, and I've worked round this before by simply define a "blank" layout and setting it on those items. Maybe create yourself a new template (inheriting from Folder) and then set Layout on that. But, this is a workaround at best. You can only "Insert Page" below the current page you are on, so you would essentially have to navigate to a blank page in order to create the sibling.
From what you have stated, it sounds like you may want to re-think where your Insert Options have been set and your content structure, i.e. why would you want create another Home item? Creating so will require set-up of another <site> and related config. You probably also want to separate those sites out with other settings, there is some good example of multi-site structure in this blog post. If you go down this route look into using Branch Templates. But, difficult to know what you are doing without context...