Custom Module DetailView Content Status

Posted by Community Admin on 05-Aug-2018 13:51

Custom Module DetailView Content Status

All Replies

Posted by Community Admin on 02-Nov-2011 00:00

Hi Guys,

We have a few custom modules, based on the the Products SDK and some posts by Josh

http://www.sitefinity.com/blogs/joshmorales/posts/11-07-18/creating_sitefinity_4_content_modules_part_4_frontend_controls.aspx

For some reason our custom Model item based on the Content class that is assigned in the InitializeControls is of Status "Master" and not "Live", I am sure this isn't correct is this a bug our end or yours?

Thanks
Sean

Posted by Community Admin on 07-Nov-2011 00:00

Hi Sean,

Master is the status all content items are saved. Master lists Temp and Live version of the item. temp is used to reflect the item in a state of editing and Live is live item (either draft or published, item that is present in the backend).

If this proves problematic in any way for your project can you send me the problematic method?

Greetings,
Stanislav Velikov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Posted by Community Admin on 07-Nov-2011 00:00

Hi Stanislav,

Thanks for the lesson in the states of the how the content Items are stored, I am pretty sure I had that all figured out.  What i am trying to point out though is that there is some inconsistencies in the way the ContentView serves up the items.

I put break points in the MasterView of the Content View and all the items are returned with a Status of Live, I then put a breakpoint in the DetailView and the exact same Content Item returns with a Status of Master.  Now in a very basic module like say the News this isn't an issue because there is no other data linking to it.  Of course where this does throw up problems is when you have some sort of Linked data like a Child Collection.  Any child collection is going to use the ID of the Content Item to store the link, following so far?  Now of course the ID of the item when it has a Master status and when it has Live status are of course different.  So what I want to know is why would they possibly be serving 2 different states from the same control?

I know I can use the Manager.LifeCycle.GetMaster or .GetLive extension to convert it, but would a Newbie figure this out, I don't think so.  So I would suggest that Telerik Picks a Status and returns the same Status for both views.

Cheers
Sean

Posted by Community Admin on 10-Nov-2011 00:00

Hi Sean,

Different statuses are returned because the master status contains live and temps status. Temp is created when item is edited and saved temporary changes that can be previewed (click preview on a page or news item). When the changes are saved they update the master status. So the master status contains is a content lifecycle status, different from workflow status. The details view returns list of all items that are visible at the frontend (also .Live returns draft items, but at the frontend there is another filtering visible = true). So if this view returns master is should load all the contents and comments of each listed item, which is avoided by just returning another status with just limited content. The  DetailsView  returns the master containing the whole content item contents. I hope my description is clear, if you need further information please write back.

All the best,
Stanislav Velikov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Posted by Community Admin on 15-Nov-2011 00:00

Hi Stanislav,

Thank you for the explanation, while your explanation is clear it still doesn't make any logical sense as to why the same content item would have even the slightest difference in both views?  Surely both should be Visible = true, or Master or Live or Temp, not one be Master and one be Live you haven't explained as to why that ContentItem is differerent?  

You say that is should load comments etc, but my experience is that when I use the Content Items ID property to retreive a related record with Linq I am not safe to do it this way because in either view that ID could be different because of what you are saying?  By the very fact that they are different I found that I could retrieve related records in the MasterListView, but in the DetailsView for the exact same content I couldn't?

Cheers
Sean

Posted by Community Admin on 17-Nov-2011 00:00

Hello Sean,

So you have master, temp and live, temp is created when you edit an item and at certain times saves the state of the edited item. When you save the temp all updates become Master. When you click publish the contents of master are transfered to Live. This way you have content lifecycle- changing content without publishing it so they are not reflected in the frontend.

Can you provide me some more information on related items? What related item you retrieve?

Kind regards,
Stanislav Velikov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Posted by Community Admin on 17-Nov-2011 00:00

Hi Stanislav,

Thank you for another lesson on content lifecycle,  I already had this lesson in the Sitefinity Certified Developer Course, I don't have any misunderstandings with how the lifecycle works and I understand why temp, live and master statuses exist and when they are created.  You are missing the point of my posts which was the second half of my last post.

Why would the MasterView and DetailsView control, on the same site on exactly the same page,part of the same ContentView, return the same ContentItem, yet in the MasterView it returns the Status as Master and on the Detail it would return Live?  This content item I am referring to hasn't been edited or modified or anything in between me hitting a breakpoint on each view to do the test.  So what I want to know is Why would they not be the same?

Once you can explain this question I will be able to explain how it affects my related item.

Posted by Community Admin on 22-Nov-2011 00:00

Hi Sean,

I examined further and the items truly have to be both Live as set in the widget advanced properties. Since MasterListView has a filter expression "Visible = true AND Status = Live" (it can be changed to return other). When select details view of item it takes the filter expression of the MasterListView of that item. I also tried to examine the status of DetailsrView, but it returned the status of the MasterListView. If DetailsrView this is a bug. I am not sure how exactly are you getting it to show master. Can you give me some steps in Initialize_Controls of ProductDetailsView?

Best wishes,
Stanislav Velikov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

This thread is closed