1 / 23

Sitecore Data Reuse

Sitecore Data Reuse. Dan Solovay Lead Web Developer Grand Circle Travel November 16, 2011. Why Reuse Data?. Easier navigation Consistent site experience Information architecture Managing change. Data Reuse Options. Aliases. Simple to implement SEO impact Multi-site issues.

jayme
Download Presentation

Sitecore Data Reuse

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Sitecore Data Reuse Dan Solovay Lead Web Developer Grand Circle Travel November 16, 2011

  2. Why Reuse Data? • Easier navigation • Consistent site experience • Information architecture • Managing change

  3. Data Reuse Options

  4. Aliases • Simple to implement • SEO impact • Multi-site issues.

  5. Creating an Alias • Add to /Sitecore/System/Alias. • Name of item is alias value. • Data contains link to item to display.

  6. Canonical Links • Get the context item URL. • Put a link in the HTML <head> element like this: • <link rel="canonical" href="http://www.example.com/product.php?item=swedish-fish" /> • Canonical links should be evaluated in all data reuse scenarios.

  7. Aliases and Multi-Sites • Alias appears under all site roots. • Path always points to the original item. • Site name points to the site root in the URL.

  8. Proxies • Same content item exists in two locations. • The proxy item gets a different ID. • Performance impacts. • Deprecated in Sitecore 6.4. • Some features not yet in clones.

  9. Enabling Proxies • Proxies are not active by default. To enabled them, make the following changes to Web.config. • To activate, set <proxiesEnabled> to true in the master database node. • To publish proxies as normal items: • Set <publishVirtualItems> to true in the master node. • Set <proxiesEnabled> to false in the web node. • To publish proxy definitions only: • Set <publishVirtualItems> to false in the master node. • Set <proxiesEnabled> to true in the web node.

  10. Creating a Proxy • Defined in /Sitecore/System/Proxies. • Define original item, and location for new items. • Select Entire Sub-tree, or Root Item Only • For cross database proxies, use DB name as defined in configuration, and use item GUID for selected item.

  11. Proxy Behavior • Proxies show on screen with gray text. • Changes flow both ways. • Only difference is Item ID. • Proxy changes are missed by Incremental Publish. • Proxies do not handle deletes consistently.

  12. Proxy API calls • From SDN: • To access the ID of the source item from a virtual item, use: Item.InnerData.Definition.ID • Item.RuntimeSettings.IsVirtual: - Indicates whether the item is a virtual item. • Item.RuntimeSettings.IsExternal: - Indicates whether the source item is from a database other than the target database. • Item.RuntimeSettings.OwnerDatabase: - The database that owns the source item.  Note the Item.Database property will always return the target database. • It is also possible to enable and disable proxies programmatically. • boolSitecore.Context.ProxiesActiveEnable (set to true) or disable (set to false) proxies for the current session. • Sitecore.Data.Proxies.ProxyDisabler Disable proxies for a block of code.

  13. Clones • Manage change between copies. • Clone changes with itssource, or goes its own way. • When the source item is deleted, the clone is promoted. • Example: An item tree is moving, but needs to appear in two places during the migration.

  14. Adding a Clone • Requires read access to Clones ribbon chunk. Currently only Admin sees it. • The only input is the location of the new item(s). • Clone Relationship is defined in __source field. • As of 6.4.1, build 3, clones are version agnostic.

  15. Reverting a Clone Field • Clones will show “original value” next to fields inherited from the source, rather than “standard value”. • Use Reset ribbon action and field.Reset() method to revert to Clone value. • Revert screen has a bug, showing Standard Value instead of Original value.

  16. Clones and Uncloning • Unclone, to make a clone a regular item. • Deleting a source item also works the same … • … in theory. We have seen this break at GCT, so we follow a Unclonethen Delete process. • This is useful for content migrations.

  17. Clone Notifications • Notifications for overriden fields: • Stored in Notifications table. • Many different workflow options. • Security implications—use inherited security to lock clones.

  18. Clones and Publishing • Changes in source items do not cause clones to go to PublishingQueue, so they are skipped by Incremental Publish. • Clone changes are picked up by Smart Publish, even though the Revision Guid field is not changed. Sitecore has dedicated logic to push them through. • When clones are published, they become normal items.

  19. The Clone API • Item.IsClone • Field.Resetto set a field to the source value. • Item.GetAllClones is private, but the logic is documented on SDN: http://sdn.sitecore.net/SDN5/Forum/ShowPost.aspx?postid=34012 • Field.InheritsValueFromOtherItemindicates whether the field inherits form its source. (compares to Field.InheritsFromStandardValues) • Database.NotificaitonProvider.GetNotifications(Item clone) gets notifications of conflicting source field-level changes.

  20. Wildcards* • Asterisk item matches any unmatched content. • Matches any unmatched path—up to developer to parse the URL. • Content is not duplicated. • Keep items in one place (e.g. Repository), reference via a Selection field. • Allows flexible handling of content relationships. • Can be used to display external data (e.g. books by ISBN number) * Are probably best.

  21. Conclusions • Aliases provide a simple solution to item reuse. • Proxies should be avoided for performance reasons, and are deprecated. • Clones provide a nice mechanism for data migration, but are conceptually complicated. • Wildcards are more difficult to implement initially, but lead to a simpler tree and avoid complicated workflow issues. • Massive is coming. what does this mean for data reuse?

  22. To Learn More… • Data Reuse: • http://sdn.sitecore.net/upload/sitecore6/64/reusing_and_sharing_data-usletter.pdf • http://adeneys.wordpress.com/2011/07/01/virtual-items-in-sitecore/ • Aliases • Creating a canonical URL: http://stackoverflow.com/questions/6919116/how-to-check-whether-sitecore-item-is-using-alias • Canonical Links: • http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html • Proxies • http://sdn.sitecore.net/Articles/Administration/Using%20Proxy%20Items%20in%205,-d-,3.aspx • Clones • http://www.sitecore.net/Community/Technical-Blogs/John-West-Sitecore-Blog/Posts/2010/10/Sitecore-CMS-6-4-Cloning.aspx • Wildcards • http://www.sitecore.net/Community/Technical-Blogs/Getting-to-Know-Sitecore/Posts/2011/09/Wildcards-and-Data-Driven-URLs.aspx

  23. Thank you! • Dan Solovay • Lead Web Developer, Grand Circle Travel • dsolovay@oattravel.com • dan-explorations.blogspot.com • @DanSolovay on Twitter

More Related