How to share DotNetNuke content across multiple pages? - dotnetnuke

I have just created a new DotNetNuke 6 website. The default installation has a social links area which is on each page. Can I change the contents of the social links (e.g set the Facebook href) in one central place or do I have to go to each page and edit the contents in each place?

DotNetNuke has a notion of referencing modules that would come in handy here. Essentially you can drop a new module on the page and configure it as you please, then go to another page and instead of dropping a new module, you select an existing module from another page. Now each of the modules appear to be separate, but are actually just the same module appearing in different places. You can then edit the module and the content will change across pages. *
To answer your question specifically - I don't believe this is how the default content is set up. You would need to go in and delete all of them (save one) and then reference the remaining elsewhere.
A couple of notes:
This behavior isn't absolute across all modules, technically each module gets to decide how it's content is shared across pages. Most modules, and notably the text/html module, work how I described, but some more advanced modules may not.
Additionally, the "copy module" option in the photo above will create a new module based on the original. If you don't have copy module selected, no new module will be created, the existing one will simply be referenced.

Related

dnn - 2sxc - modules of a duplicated page / page template are using the same content

I created a page within dnn (v9.0.2, 2sxc 8.12.0) with all modules (only 2sxc content modules) like the page design had defined it. After this I created a template from this page. After this I created a couple of sites using this template.
My problem is, if I change the content of module A on page 1 - all modules A on the other pages 2..n of this template have this content now too. Same effect, if I use the duplicate functionality.
Does anyone have a hint how to use page temlating using 2sxc content modules?
What you need to do is open the template file in an editor and locate the section that describes the module. The best way to do this is to find the EntityId of the content item on the page from which you created the template. Then, find that number string in the template. Just remove the string, leaving the XML node otherwise intact.
When you build the page, you'll get a 2sxc module that is uninitialized and you'll need to specify the content.
If anyone is listening, I wish that this behavior was different. I'd prefer that the template assigned to the module could be preserved, but with the default content showing.
Basically the issue is that DNN has only one way to export a page, and we would need something where our code could contribute something before the export is complete.
At the moment there are two ways to do this.
One way is to use the method described by Joe, modifying the XML export
The other way is to place un-initialized blocks on the template page - meaning that you select your content-type / template, or your app, but don't start adding any content yet. This should result in the identical XML as the one modified manually.

Creating an index page automatically

I'd like to have dotnetnuke build an index page based on pages that have a particular tabid. Are there any modules that do this already?
e.g. we create multiple pages under /News and then the index page lists links to all the news articles. Would be handy if we could also enter our own HTML text (maybe on the News article page itself) that is then displayed next to each link on the index page.
Thanks!
By default, there are no 'real' pages in DNN. Everything is served up in the Default.aspx from content that is stored in the database.
What you could do is create a module that populates data based on the TabId or Path. Then, there is a setting in DNN to make a module appear on EVERY page. Since the module is on every page, it could populate its data based on the TabId or the path, or just not show anything if it doesn't match your criteria.
For something like that, I used a module called SQLGridSelectedView from www.tressleworks.ca (I have no affiliation) and I wrote my own SQL to fill in the fields, and I defined a custom layout (instead of the default data grid) so I was able to do something like what you are asking without code.
There is a module from Ventrian called Child Links that does what you are talking about. You can use it to grab title & description from the pages below a relative to a specific page to build out menus etc.
It allows for formatting however you want as well.

How to I access the template that DotNetNuke uses when creating new pages?

I recently applied a new skin to one of our existing DotNetNuke CE sites. The upgrade of the site worked, but when I add a brand new page (not imported) to the site there are some issues.
DotNetNuke attempts to copy content from my Slogan Pane, and Top Pane when I add a new page. However, it creates multiple copies of each (about 25 of each module in each Pane). I then have to take my new TabID, go into the TabModules table, and manually delete the duplicate rows to get the new page correct.
I am sure there is a template file somewhere that DotNetNuke is utilizing to create new pages. I hope to be able to modify this file to stop the problem or point DNN to a different file to use for default page creation. Does anyone happen to know where this template is? Barring that, is there any way to interrupt/modify the new page process (without source code mod) to fix the issue?
Thank you
Page Templates are stored in the Portals/# folder, where # is the ID of the folder. They can be within ANY folder inside of there, so you might have to dig around a little bit.
I would guess that you perhaps created a page template, and it has the 25 modules in it, but you also have those modules set to "display on all pages" so that is where the duplication comes from.

dotnetnuke clicking left bar opening page on the content pane(BEST PRACTISE)

ok i have created a picture gallery module in the left bar , there is a page viewpicturegallery.ascs . on clicking any image i want it details to open in the content pane in the middle . how would i do it.
can some tell me the process? i would made a new page or new module or what? for the details in the middle
here are some steps you can achive it:
create two controls in a single module for showing images and showing details for a single image and create two different definitions, each having a default view control as the one you want to show.
when you install the module in the page, it will show both definition controls in content page, you can re-arrange them in whatever panes you want.
search for inter module communication in dotnetnuke and grab a sample from net
you will find that there are two module definitions participating in the communication. Your list control will be the IModuleCommunication and your details view will be your IModuleListner
That's how you can achieve the things you want.
Please tell me if you have any other questions.
Short answer: use multiple DNN modules and communicate between them via querystring parameters, postbacks or IModuleCommunicator. Depending on your requirements, the details view may be possible to implement using a Text/HTML module and client-side tools like jQuery and plugins only?
More details on using multiple interconnected DNN modules:
You can define multiple modules in the .dnn manifest section.
This way, each interconnected submodule is part of the same install package, but you'll only have one visible module in the in the control panel's "Modules" dropdownlist. Adding this composite module to a page will add all the submodules, but you can remove any one of them independently of the others.
You should be aware that each submodule that directly inherits PortalModuleBase will have its own Settings object. If you want to share settings, you'll have to inherit from a shared parent ascx that inherits PortalModuleBase or write a function to read settings from another module in the same page (having the same ModuleID helps here).
Communication between modules can be based on querystring parameters, which is recommendable for opening a details view so that you can open it even if the gallery module weren't present. PostBacks let you use UpdatePanel, though. Modules in the same page can also use IModuleCommunicator interface for event-based communication. For example, I use an event calendar module with a "month view datepicker" module and a "list view of events" module. List view module communicates active days to the monthview via IModuleCommunicator. This way I can emphasize the active days with a boldface font in the datepicker. For more details on IModuleCommunicator, see Rafe Kemmis's blog post.

dotnetnuke: can we create a master page?

Can we create a content managed master page in dotnetnuke?
eg. I want the right pane and bottom pane to be content managed, but to show the same thing across all pages.
Thanks
What you are describing is essentially what DNN calls a Skin.
A DNN skin is actually just an ASP.NET user control (ascx) that dictates page-wide or site-wide look and feel, which offers developers the same functionality as a Master page, except that it ties into DNN-specific elements and uses some DNN-specific user controls, such as menu/navigation, logo, breadcrumbs, login/user account links, etc.
Now, in order to add the ability to provide content management capabilities site-wide, you specify an area in your skin to place a module (let's say, a Text/HTML module). This area is called a pane. Once you add a module to this pane, in its settings you can tell it to appear on every page. This way, the module can be edited on any page, and its changes will be reflected on all pages automatically.
Check out DNN's site, as it contains a TON of documentation on how to do many common tasks: http://www.dotnetnuke.com/Support/Documentation/DownloadableFiles/tabid/478/Default.aspx. Under the Technical Documentation section, you'll want to grab the Skinning document (I believe it's a PDF).
DNN Modules can be set to appear on all pages by checking a checkbox in the module settings. However DNN does not use the concept of a Master Page. It injects modules (user controls) in containers on a single aspx page at runtime.
A Master Page would be a great addition to DotNetNuke you cannot replace content in a single area of the page. The whole page refreshes. For example if you have a menu and you only want the content of what you select to appear in a specific content area without refreshing the rest of the page you have to resort to third party modules that attempt to do that but usually fail. There are 'module wrappers' but all the ones I've tested have issues with modules that allow the user to edit content. Edit screens are usualy different user control files (ascx) that are launched when you edit the module content. Since the page refreshes with the new page you have lost your place. Those module wrappers work fine for static content and some other controls but not for all controls.
IFrames can be used (DNN has one) to trade out content but that doesn't get rid of the probelms mentione above. I'm heavily invested in DNN, running the UCanUse.com web site so this isn't a slam on DNN. I just thought I'd try to answer the quesiton with detail.

Resources