0
votes

DNN Platform 9.3.2 / 2sxc 10.25.2

I have a DNN website that uses 2sxc. I created a "Notification Bar" content type and c# razor template that I use to display special notifications to the user. This module is meant to display on every single page of the website. I used the "Add Existing Module" functionality to manually add the module to every page but it's a bit cumbersome and I run the risk that my Content Editors move the module by accident, delete, or forget to add it to new pages.

Is there a special 2sxc skin object that I can use inside of my .ascx DNN skin to load a 2sxc module so that I don't have to add it to every page through DNN? Apparently there is one in DNN OpenContent.

(More than just the notification bar, this would be super useful for the site's header or footer that gets occasionally updated. For example, social media links, contact info like address or phone number, or other links that aren't part of the DNN pages menu.)

2

2 Answers

1
votes

There are two ways

  1. create a pane for this specific module (it's the easiest to edit and work with) and just show the module on all pages

  2. create the module on a hidden page and then inject it into the skin, using the Factory to get the CmsBlock - see https://docs.2sxc.org/api/dot-net/ToSic.Sxc.Dnn.Factory.html#ToSic_Sxc_Dnn_Factory_CmsBlock_System_Int32_System_Int32_

0
votes

Daniel, this is how we did it in the past. I notice your call is similar but simpler (above in the comments). Is that because the API changed somewhere after v10?

<script runat="server">
// get 2sxc to Render() the output from the module on the SITE/Manage Flyout Links page
private IHtmlString RenderFlyoutMenu()
  {
    return ToSic.SexyContent.Environment.Dnn7.Factory.SxcInstanceForModule(3354, 606).Render();
  }
</script>
<%=RenderFlyoutMenu() %>