Beth Wilson (Customer) asked a question.

Is it possible to include share content block in widget view file?

I'm trying to write a custom view that shows the details of an employee (data stored in a custom module). It also needs to include some large sections of text that is the same on every employee's page. I was just going to put the text into the view itself, but we plan on the site going multi-lingual in the future, so that would be problematic.

 

So, I've being trying to figure out how to include a shared content block in the view. I found a support article about it on the SF site, but the code was for versions 11 and prior. We are using .Net Core renderer and SF 15.1.8326.0.

 

Any suggestions would be appreciated!


Jochem Bökkers likes this.
  • Jochem Bökkers (Enso DX)

    Hi @Beth Wilson (Customer)​ 

     

    Given it's not out of the box and your code reference is v11 and before, I'd take a step back and instead of using a shared content block, actually use the module builder to create a content-type for your text. This gives you all the features of a shared content-block, plus the extra advantage of having the option to have multiple versions and use filters - as well as use related data to link it (or different versions) to various employees.

     

    Wouldn't take you more than 10 minutes to set up and you stay neatly in the 'box' instead of having to write and maintain custom code.

     

    BR,

    Jochem

  • Jonathan Read (Progress Software)

    @Beth Wilson (Customer)​ 

     

    Since you are using a content type this is easy to achieve with out of the box functionality. Due to the dynamic nature of Sitefinity and you are using a content types 'employee' they will all use the same page to present the details of the items. My recommendation would be to a have listing page of employees and then a detail page. The detail page would have a content block on it and that would be present on all the details pages.