Reuse content in different pages with different templates

Sep 17, 2014 at 7:24 PM
I have two pages:
  1. Home
  2. About
On my About page, I have a list of testimonials. And on my home page, I have the same list of testimonials but in a fancy rotator (it uses a different template).

Is there a simple way that I can display the same content, on two different pages, using two different templates?

Nokiko showed me a way to do this through the template but I'm wondering if there's an easier way. This could be a really useful feature because then I could teach a client how to manage this and they wouldn't have to create this through templates.

Perhaps a setting in the module to "use content from: <dropdown>"
Coordinator
Sep 18, 2014 at 7:01 AM
hi dnnsuperfan
Yes, this is very easy. There are at least two ways
  1. Manual: where the editor adds content in one module, and then goes to the second module and adds existing entities to it. This is low-tech and very practical, and what's great is that the editor has full control - so if he needs something specific (like a manual ordering of the items or if he doesn't want to add a specific item).
  2. Automatic: this is where you use a bit of Razor-code to automatically display some content somewhere else. This is good for things like "always show the newest news on home" because content is created elsewhere, and a clearly defined extract can be used somewhere. The automatic mode needs much more work as soon as the user wants more control (like if not every new news should appear on home, or if he wants to change the sort order elsewhere).
In most cases, I recommend #1. To understand this, feature, go into an edit-item dialog and press the "..." button at the end which hides advanced features.

For #2 there are again different ways, but a simple one would be to use the ModuleDataSource which will deliver data from a specific module.

Did this help?
Daniel
Sep 18, 2014 at 6:19 PM
Yes, this helps a lot, thanks. I'm already using method #2 on a website and it works great.

That said, it would still be a neat feature to be able to select the data source through the module - instead of through the template. Is this idea worth putting into the GitHub suggestions?
Coordinator
Sep 19, 2014 at 7:20 AM
Wait with the github. Benjamin is working on something very complex for his Master's thesis - and as a side effect the module selection would also be possible.
Sep 19, 2014 at 8:03 AM
Daniel

is appswitch the same as module switch or is is it just purely content of a specific app no matter where in which module ( it is added )
Coordinator
Sep 19, 2014 at 9:05 AM
App-Switch is All-data from an App. It has streams named by the data types like
Data["Categories"] etc.

ModuleDataSource is all data from a specific module - usually much less (often just 1 list, maybe including presentation-items if available). It usually has 1 - 4 streams, namely
Data["Default"] // content
Data["Presentation"] //...
Data["ListContent"]
Data["ListPresentation"]