9

I have a Sitecore 8 project where we have created a component for the editors to use.

A component takes Datasource of "Datasource-Folder" with X numbers of "Datasource-Item" below.

The tree looks like this:

  • Globals
    • Datasource Folder
      • Datasource Item1
      • Datasource Item2
      • Datasource Item3
      • Datasource Item4

The user can change and add a datasource item with the Experience Editor.

Now the issue. In the Experience Editor the user can edit the Datasource Item's fields, i.e. he can edit image, text, general link field of this Datasource Item. If they save it I can see saved data in the master database. But when the user is publishing the Context Item from the Experience Editor, then the datasource items are not publishing. Is that a Sitecore bug?

I have also referenced this. But my question is if it's possible without customizing the code?

Thanks in advance.

  • are you using publishing related items option also when publishing ? publishing context item only will not publish your datasource items – scFootsteps Oct 5 '16 at 9:33
  • Yes I have checked related item checkbox. – Gaurav Agarwal Oct 5 '16 at 10:28
7

No, it's not possible without custom code.

And to be honest, I don't think this is really what should come out of the box with Sitecore. Your component uses Datasource Folder item as datasource and that datasource will be published. And it's your own code which takes children of that datasource and uses them to display some content.

That's why I would say that you need to write your own code (or find some existing solution in the net) for publishing those items which are required by your component.

  • 3
    You could use a template like a marker interface, such as BasePublishChildren, and if an item of this template was published a custom step in the publishing pipeline could then add the children of the item into the publish queue too. – Kasaku Oct 5 '16 at 9:36
  • @Kasaku you're right, that's one of the options. Still, there has to be custom code added. There is no way of achieving what's in the question without coding. – Marek Musielak Oct 5 '16 at 9:39
  • 1
    Oh yes, wasn't disagreeing, just taking your answer and adding more thoughts! :) – Kasaku Oct 5 '16 at 9:41
  • 1
    I don't think it works that way. It does not consider children as related items. It would have to republish whole database if children and parents and their children and parents where considered as related. See doc.sitecore.net/sitecore_experience_platform/content_authoring/… – Marek Musielak Oct 5 '16 at 13:08
  • 1
    @GauravAgarwal - That's how it is in your solution but not necessarily in all others. What if you had referenced another page as your datasource, should it publish all children too? Related goes by direct item references but it doesn't spider out from there to find other content. – Kasaku Oct 5 '16 at 14:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.