1
votes

I want to get the ModuleName in a DotNetNuke Module, but I'cant figure out how I can do that?

I feel like it's very difficult to find information about the classes and how to do things in DNN? Are there any good and actual documentations around?

1

1 Answers

0
votes

One thing with DNN API's that is important is to understand the terminology, as sometimes things aren't exactly what you think they are.

When talking about a Module, your custom code, is a Module. Therefore its "Name" is the name that you define it. When a user adds a module to a page, there is a "Module Title" that they can access via the little gear icon "Settings" link on the module.

You can get access to this, it appears through the ModuleController class. Using something such as

var mc = new ModuleController();
var myModule = mc.GetModule(this.ModuleId);
var title = myModule.ContentTitle; 

There are other title properties there, you might need to look a bit to find the "right" one for your DNN version and needs.

As for the other question regarding documentation. The DNN Wiki is helpful, but it doesn't contain everything.