Answers module interfering with Discussion Module - dotnetnuke

I am using dnn-8. I have one page which has Answers module. On another page I have added Discussion module. Now I require to add all the post from the answers module in the rightPane of the second page. I did that using existing module and it is showing as i require. But when I click on any topic url of discussion module to view its detail it gives 404 error. It is working perfectly if i remove the Answers module from right pane.
How to resolve that?
If you need any more info, please ask.
error snapshot

I believe that you are encountering a situation where two modules use a similar URL structure and the information is crossing. I believe that these modules need to remain on their own separate pages. Gien this, it isn't exactly possible to change.

Related

Navigating to new page with new content and new css in react

I'm a complete beginner in ReactJS. I'm currently designing a website using it and currently working through localhost.
My main page is on localhost:3000 and I want to navigate to localhost:3000\University(I have designed a separate file University.js for this).
On navigating to the content of this file, it overlaps with the existing content (ie that of localhost:3000). Is there any way to show the new content without overlapping as well as with separate CSS. Any help would be really appreciated.
Actually, I'm not getting what you mean by "overlapping content"! For the css part maybe you are looking for something like "local stylesheets" aka "css modules".
This answer has an example of using local stylesheet for each component. Also, there are various libraries, as mentioned in this post, which can come handy for you.
Go through this article, and pay attention at method 4 there. CSS modules is one of the best solutions in case you are experiencing CSS overlapping.
PS: react-native and react-js are two different tags!
You can understand react routing here, if you have some doubt over it. (Mentioning this because of tag!)

DNN 9 SPA Module QuickSettings

I am very sorry to have to do a post like this, but I have been looking everywhere and I have not found a good example of how to use/reference quick settings on a SPA module for DNN 9. IS there anyway that someone could point me to some sample code or give an example of how you can save/reference a modules quick settings.
My Restaurant Menu example module has a SPA version that with a full, working implementation of the Quick Settings.
Edit:
In my above example, I just access the setting in the controller webAPI method for the view. If you would like to spit out the setting as a SPA token in your view html, you use [ModuleContext:{SettingName}].
In my above example, I am setting the module setting in with the following code:
ModuleController.Instance.UpdateModuleSetting(ActiveModule.ModuleID, "RestaurantMenu_CurrencyCulture", settings.CurrencyCulture);
The second parameter is the setting's dictionary key name. Therefore, to get this setting value in the View.html, I would use the following SPA token: `
[ModuleContext:RestaurantMenu_CurrencyCulture]

Module circular dependency due to using the same resource

I'm using parse.com as my backend. I have 2 tables: post and comment. A post have multiple comments, so it is a one to many relationship. so I have comment point to the post (which is easy) but also an array on post that list all the comments this post have. I imagine if I used MongoDB or any other NoSQL it will be the same.
On front end, I have 2 modules: "post" and "comment". Each have a resource that is hooked with the backend. Each module also have all the CRUD pages that create, read, update and delete. When I write the view part, a post need to display all the comments below, so my post module depends on comment module and will use comment resource to find all comments for this post.
But when I write the create part for comment, I found myself need to update the post array and add the newly created comment to the array. Which means I need the post resource to update the post. The post resource is in the post module so now my comment module depends on post module and created a circular dependency.
I have 2 solutions I'm going to share, but I want to know if anyone have anything better:
I use angular-ui-router in my project. After a comment is created, I route back to a post state called "app.post.commentCreated" . This state is handled inside the post module. It will update the post array of comments.
I separate the post resource and comment resource to their own module called "postResource" and "commentResource" and make post and comment module depends on both. I have not done this yet. I'm about to.
Do you have anything better?
Thank you very much!

I am trying to creating a polling app on the mean stack. I think my routing is messed up but I am not sure

I am trying to create the polling app described in this tutorial here.
I have step 2 finished, and I am about to start step 3(once my application is running properly) which is to incorporate the DB portion. My application is not behaving like the application listed in the tutorial currently though.
I have scanned my code numerous times and debugged it and still cant seem to catch what is throwing it off. When I run the application it runs fine, but none of my partials are being displayed only what is provided in the inital index.html view, so it is simply showing my blank navbar.
I have provided my git repository. If anyone has a moment and can take a look at it. Thank you for your time in advance.
Some of the key things I fixed in my pull request:
You need to include angular-route.js as a separate file now, and have your module depend on ngRoute.
You were missing quotes around the first $routeProvider in the following line:
.config(['$routeProvider',function($routeProvider){
You now need to register controllers using a name (string) with the module, rather than using global functions.
app.controller('ControllerName', function ($scope, ...) { ... });
You also forgot to actually reference a few of the JS files you need in index.html using <script> tags.
There are other small things, but see the PR for the full details. I also changed the way bower components are done.

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.

Resources