how modules can linked - linker

In my dotnetnuke application i added so many modules, i want to display the content in the contentpane when i clicked on the items that is in in the left / right pane. Can you give me the code for navigating the modules..

There are a few options available to you for passing information from one module to another. The simple way is to put the shared state on the querystring.
The more robust way is to use Inter-Module Communication, which basically requires one module to implement the IModuleCommunicator interface, allowing it to send massages. You can then implement the IModuleListener interface in other modules to react to those messages.

It's hard to answer this question because I don't know what you're doing exactly. What is the module in the left pane, and what is the module in the content pane? How are they interacting?

Related

I want share data between two component that are unrelated to each other

here is my folder structure
Top-nav
Side-nav
screen having selector of top and side nav, and I want to pass title from side nav to top nav
Depending on the size of your project there can be various options.
If this is your pet project and nothing big, then you can hold data in the parent component(that holds both Top nav and Side nav).
If this is a medium-scale project which does not involve much sophistication, then data can be shared via any service, since services are singleton data sharing should be a piece of cake.
If this is a big company project and no boundary to libraries being added, then you can use NgRx or any other proper state management library(as suggested by #Filip Huhta above)
You could use NgRx service to pass values between components that are not related to eachother. Look at the examples in NgRx doc which are explained really well. Next time google before asking and read How to ask? and post your code here so it's easier for others developers to post more specific answers to your post.

How should Prism modules know about each other's views?

I'm very new to modules in Prism and am struggling to understand how to use them properly. I want to have a navigation panel like in the image below, which I stole from Google.
Let's say that I have 3 modules for 3 separate concerns: NavigationModule, HelpModule, and FeedbackModule. If I want to show "Help" when the app first loads, my understanding is that I would do something like the following:
Define Regions for navigation and content in my Shell (main WPF project)
Upon execution, load the navigation view into the navigation Region
Upon initialization of the NavigationModule, load a view from HelpModule into the main content Region
This leaves me with a few questions about what modules should know about each other:
Should the Shell's project have a reference to the NavigationModule in order to load its view?
Should the NavigationModule have a reference to the HelpModule in order to load its view? And a reference to FeedbackModule in order to load its views on demand?
If the answer to these questions is "no," then what's the best way for modules to be aware of each other's views? I could create a shared class library with constants for view names, but it seems a bit troublesome to maintain a bunch of strings that way whereas with references I could use nameof(). I would appreciate any direction. Thanks.
Modules should not "know" each other in the sense of having a project reference from one module to another, because that kind of defeats anything gained from having modules in the first place, that is, to have a modular application (built of components that can be swapped out independent of each other).
Modules should interact through shared interfaces, which are define outside of modules, that is either in the framework or in assemblies that "are" no modules themselves. Depending on your requirements, you should define upfront (and enforce in the build process) which modules there are and which interface-assemblies and which module is allowed to reference which interface-assembly.
So how to show the Help-view when the application loads? Send a message (e.g. via IEventAggregator or any other communication mechanism) when it's time to load the initial view (whatever that may be). The Help-module listens for the message and navigates to the Help-view. Important: the SessionResume-module might also listen for our message. It's the responsibility of whomever choses which modules to deploy to only deploy modules that are compatible with each other.

How do I introspectively discover defined directives (or controllers, etc) in an included Angular module?

I'm architecting a project where we have one module acting as our shell, handling global styles, navigation, etc, with an ng:view getting filled by directives provided by our second module with all the pages.
I would really like to find a way for the shell to inspect the pages module, discovering the nav structure dynamically, rather than defining it by hand or having every page inject itself both in the pages module AND to the shell module. On its own, the injector doesn't seem to like doing that.
EDIT
As clarification: while I have a fabulous workaround with a pagesProvider service, I am still looking for an answer as to whether Angular 1.2.x has a mechanism to introspect modules.
Firstly: at the end all injected objects (like services, filters, controllers) will end up in one big bag (something like global namespace). So it is enough to inject each page into pages and pages into shell. (mind the possibility of name-conflicts.)
Secondly: at this time, there is no support for lazy loading of modules. So you should know all your modules beforehand, so there is actually no need to check which objects are present and which not, as either there are all of them or the application has not started at all.
I do not know what you actually mean by discovering nav structure and how it will be defined. But, what you can do is:
in each page-module define a constant in which the nav structure of this page will be stored.
access this constant from shell when needed. If you need to know dynamically the idof active page, just set this information somewhere -- probably as value -- when the pages gets activated.
Some alternatives:
define one global hash-map from page-ids to page-nav-structures.
use a common service that will be injected to each page and will be used to register pages and all related information about it.

How would I repeat content on pages (and modify some) in DNN

I am trying to figure out how to place content across pages as well as modify only some of the "same" things.
For example, I have two services. Let's say I want to add a small box on the right panel. On the pages directly under the root of my site (Home, About Us, Contact Us), I want this box to contain generic information (We provide services for . . . ). On the pages related to service one (the service one page and sub-pages), I want that same box to contain pretty much the same text except changing it specific to service one (Our service one solution...). The same for service two and it's sub-pages (Our service two solution...).
To change content I think I'd be right to leave "Make a Copy" checked. However, I don't want this box to appear on every page, just one's that I choose (whether grouped or not; i.e. root pages, service one pages, service two pages).
How can I accomplish this? I'm working directly using the DNN 7.01 admin/host interface - I'm imagining I can accomplish this by creating separate .ascx files, but for this I think it defeats the purpose.
Thanks.
What you will want to do is use the "Add Existing Module" function to handle this.
For example for the content that you want to be the same, add it to the "main" page and setup the content. Then on the pages that need to have THAT version use "Add Existing Module" and add the module from the "main" page.
Then, when you have a variation that is to be shared across other pages, repeat this process.
DO NOT use the "Display On All Pages" option though as more than likely that will trash things!
I've not a lot of experience as Mitchel, and his answer seems the way to go. But as an alternative (when dealing with LOTS of modules with static content), I found using a template page with all the modules (and content within) helps to group things so that you can use that template for sub pages that have the same content. In other words, only the actual content pane for a sub page needs to be created because you are copying all the other "widgets" you have on your page.

Adding DNN module error when control has key assigned

I'm creating a module and I was able to add a user control as a view type and everything worked. I want to add a second control, also as a view type, but that's where trouble begins.
If I just add the new control to the module definition, it displays only that control and not both. If I remove it, the original control displays fine. Going back into the module definitions, I went to the module controls and assigned values to the respective Key properties. When I save, my module disappears from the page it was displayed on. If I try to add it again, I get "Object reference not set to an instance of an object."
It was through trial and error I discovered if I remove the key, I can re-add the module it works again (at least as described above).
Essentially I want multiple views for my module where individual views can be displayed on different pages (much like the Blog module). I'm not creating a package for distribution so I'm almost to the point of just creating a separate module, but where's the learning experience in that?
I've searched for a tutorial on creating a module with multiple views with no luck. Can anyone provide some insight?
I got round this issue by using the modulesettings to choose which display I wanted for that instance, in my case I used the setting to determine which front end was visable and which was not aswell as the backend code.
Another option is to have one view ascx which is a placeholder and inject either ascx view you want based on a modulesetting.
I have used both these methods before and both work well
In DotNetNuke there can only be one 'View' so if you want to make something that displays different views depending on the situation you have to create a Dispatch view. So depending on your module setting like you have, or a URL parameter, cookie, session, something in the primary View gets another user control to display what is needed.
This post talks about it a bit Dispatch View
Sounds like you found a solution that works for you.
Out of the box DotNeNuke also supports using multiple views, however as soon as you switch to a different view the module enters "Isolation Mode", where it becomes the only module visible on the page.
If this behavior would work for you, then you can add multiple controls, the FIRST control you add without a key, the secondary controls you add with a specific key. You can then use NavigateUrl or EditUrl to construct the link to the specific controls.
From an "edit" perspective, the use of this pattern ensures that your users have a consistent environment with only your module. From a View perspective the usage of other patterns is more commonly a "better" choice.

Resources