dnn how to uniquely identify instances of the same module - dotnetnuke

I am currently building a page that is supposed to have multiple instances of the same DNN module but I'm having trouble uniquely identifying each instance. I thought the ModuleId property would do the trick but further research revealed that ModuleId is shared across all instances of that module. Does anyone know of a way to uniquely identify each instance of a DNN module?

Try using TabModuleId instead, though ModuleId is shared across all "copies" of a module, not all instances of a module.
If you were to add a module to a Page A (via the control panel), then add the same module to that same page (via the control panel), you would get a new ModuleID and a new TabModuleId
If you were to COPY a module to another page (via the control panel add existing), choosing the modules on the first page. The ModuleId of the two modules would be the same, but the TabModuleIds would be unique.

Related

Abp.io Data seeder from external module

Abp.io data seeder works when the class implementing IDataSeedContributor is in the *.Domain project, but it's not being executed when the class is in another AbpModule.
Is there a way to tell Abp to check my module when searching for seeders?
https://docs.abp.io/en/abp/4.4/Data-Seeding
If you need to seed a data related to an other domain, it means you are dependent on to an other module. You need to add reference of the Domain project of the other module.
If you don't care about DDD layering or bounded contexts seperation to seed, just create a shared project and add your DataSeedContributors and reference to that project.
They will get executed as long as you have reference.

gtag.js tracking on multiple domains but no linking

My company has an angular component library that we want to track usage of. This means that multiple developers will us it on multiple domains. I have included a single tracking id and am dynamically loading the gtag.js library when components are loaded. This works on the main domain but the tracking isn't logged in the dashboard. Does anyone know of the settings required to make this possible? Also I am not trying to link any pages or sessions, just have unique tracking per application.
It turns out that I had upgraded one gtag emit call but a second one was still in the ga syntax and wasn't registering in the dashboard.

Manually create modules and their dependencies with angularjs

We do a modular application where the UI is divided in components/modules like billing area, staff management, real time charts, shipment etc... The customer pays for this component/module and only the modules he paid for shall be loaded on client side. I name these paid modules "main modules" on client side because every main module is route/button to sub content where user with different claims can do different things.
What I would like to do now is before angular is initialized I would like to manually create the modules basing on the array of licensed module names. Those modules who are not licensed are not created.
Here I have an understanding problem and can not find any similar case in google.
1.) How can I tell angularjs to load a specific module with all its attached controllers/services and their depending modules?
2.) What happens with the common javascript includes which will cause an immediate creation of the angularjs modules?
User #mpm put me on the right track. Its the best if all the files belonging to a angular module are copied over to the index.html before the body tag before the Index.html is initially sent to the client side. That way the client does not know about how the modules are loaded. It just gets the modules... Only the server knows and is doing still more stuff about the modules to be licenced like loading only the module depending endpoints/ApiController`s.
To second this answer as a recommend approach, you can watch this video:
https://www.youtube.com/watch?v=62RvRQuMVyg#t=486
from the angular conference where they recommend the same approach :-)

Dotnetnuke inject script only for particular module

I want a javascript to be executed when a particular module loads only for a particular portal.
On only one portal this script needs to be executed when that module loads,
Is this possible, could you provide any references, i have googled and dint find any links
thanks
This really depends on exactly what the module is, but if it is a limited item. You could just add the needed JS to the "Header" or "Footer" of the module that you can find under "Settings" for the module.
This way, you are handling it as a one-off and it is ONLY done on the instances of the module that you need it to be done on.

WPF Prism reloading module using IModuleManager.LoadModule

I need to display views in a Module.The Module Registers it's view using in Initialize method.
User will select module name from drop down list. First time it works using IModuleManager.LoadModule(string ModuleName). If I want to re-display the same module again(in the same region after clearing the previously displayed module) IModuleManager.LoadModule is not going to work. I dont know the views and regions contained in that Module. I know just ModuleName and I need to display it's view.
How can I do that?
Your questions is very confusing. Can you provide more information? The IRegionManager is the component to register Views to your predefined Regions. The ModuleManager is only responsible to load an assembly if I got that right.
I don't think you can Load a Module multiple times, because the second time it is loaded already. The logic for displaying views should be regulated via Services within your Modul so inside your Module should be a Method that uses the IRegionManager to register a specific View to a Region.
I don't know whether you use Unity or MEF ( or another IOC ) but you can obtain the IRegionManager within your Module via the Container.
Maybe you should watch this Tutorial series Prism Tutorial Series. It seems to me you are missing some basic principles

Resources