dotnetnukehiddenstatus2sxc

Unwanted Hidden/Show status change when using content-blocks


I am using DNN 9.11 with 2sxc module version 14.07 installed. I have created an application - a simple CMS. When I create a new article I set its status to "Hidden". Unfortunately, as soon as I add new content (my application uses content-blocks) the status of the article changes automatically to "Show".

I thought it was a problem with my application, but I created a new VM with DNN, in which I installed the 2sxc 16.1.0 module and the Accordion v4 application. I added two items and set the status of one of them to "Hidden": Accordion with two items Then I added some content to it: Item 1 with new content Now when I clicked on the edit icon (with a pencil) or simply refreshed the page, the status of "Item 1" changed to "Show". Is this a bug in the application or in the 2sxc module itself? Am I doing something wrong?


Solution

  • What 2sxc does and the code handling the output in the View both need to "follow the rules" regarding an Item's .IsPublished state and .IsDemoItem state. Its best to discover (usually by trial and error) the intended workings and usage of these features. And then customize your View code to accomplish your desired user experience.

    Just changing an item's Status from Show to Hidden doesn't do much when you are logged in as an Administrator, though when hidden, there is an extra Toolbar button (eye with a slash through it) to show it again.

    But for the anonymous user, when an Item is hidden, 2sxc defaults to showing them a demo (or placehold) item IF the View is configured to show one. This can be confusing until you learn to work with these settings and handle when to show or not show them.

    We've managed to get things working as needed, but almost always by testing and carefully writing the code to handle what we want the anonymous visitor vs. the content editor to see.

    On a different but related question I answered with a lot of details and code that you might find helpful here: Issue with Content Module (list of links) in 2sxc.

    Also, I recommend you upgrade both DNN and 2sxc to the latest versions (currently 9.13.02 and 2sxc is now v17.01), both updates are important and 2sxc actually made a few fixes and additions related to the IsPublished feature in v17.00 that might be helpful in both learning and using these features.

    You can also get more help and answers in the DNN Community Forums as well as the DNN Community on Discord!