I have an issue where my site doesn't load unless the user enters www. For example, if the user enters mysite.com (as opposed to www.mysite.com, or http://www.mysite.com), then my site only partially loads. I suspect this is either an issue with my use of angularjs or angular ui-router. My site has an html wrapper template that is used on every page. That is what is being loaded if the user doesn't enter www, but the template partial that should be inserted into that particular page isn't being loaded unless www is entered. For example, www.mysite.com/page would consist of my html wrapper template AND a page.html template partial that is supposed to be inserted into the html wrapper template, but page.html is only being loaded if the user enters www. Any ideas?
Related
How to change home page content in DNN while creating a site itself.
I need to change different page. I created a new page and created Template. And I replaced inside Templates folder named (Default. page. template). But it is not working out. Provide me a better solution.
Probably the easiest way to do this is to create a site using the default template, edit that site to create your own site, and then save that as a site template (suitable named). You can then use that site template to create sites with the page structure that you want.
The default page template (I believe) is used when you create new pages using the the Pages UI. I don't believe that the default page template is used by the default site template.
If you have created a page and would like to apply a specific page template to the new page retroactively. To do this, go to the page that you want to change and append ?ctl=ImportTab to the url. That will bring up a dialog that allows you to change the emplate for a page with lots of options. It
I am editing an app developed using MEAN framework. I have footer.html from views, and I have just put a link like:
<li>Privacy Policy</li>
Then I have created a html page inside views folder, named privacy.html.
When I click on the footer it does show up. It works well with the other link and page there, which is FAQ. What I am doing it wrong? Is there anything else I need to code or use controller to get the new page shown.
I want to hide the admin part of my site if you are not in the admin role.
This means that while not logged in, the routing for the admin should return a 404 as not existing, and the view templates should not be served. Once logged in the routing table should be updated and templates should become available.
I think that the server part of not serving the pages could be done if using something like MVC for serving the templates, but I don't know if it is possible to have no references to the admin in angular till you are logged in?
So somehow angular needs to refresh its template for the menu, and routing table.
I have a login system maded with AngularJS. Now I want that if somebody is not logged in the template is blank. If somebody logs in the template will continue. The problem is that when you load the page the templates loads also. So when you log in you get a blank page, you need the reload the page and then its working.
Is there a function that refresh the template? So that you don`t have to reload the page?
When you use Angular it's best to have the web server serve static content (images, css, js, and static html) and data (almost always JSON).
In your case I would always serve the template and use ng-show and/or ng-hide to toggle the template display. Here's a simple example:
Instead of
<?php
echo "Hello " + $name;
?>
Do this
greeting.html
<div ng-show="authenticated">{{name}}</div>
greeting.json web service (I'm not a php person, my php might not be entirely correct):
<?php
json_encode($name)
?>
I have a problem in hand in AngularJS and need some pointers.
I have a view where I want to embed an external url (e.g. http://www.w3schools.com). The embeded html page should respond to events like click and touch like a normal html page.
I have used ng-include directive to get that working.
Here is a code snippet:
<ion-content>
<div ng-include src="'http://www.w3schools.com'"</div>
</ion-content>
If I load the external html, I am getting the external webpage loaded, but all the links inside the page are broken. If I click on any link inside the loaded page, all links point to localhost now instead of the external url.
How can I fix this problem?
Thank in advance!
It sounds like you really just want to host the external site inside your view, and then you should just link it in an iframe.
<iframe src="http://www.w3schools.com"></iframe>
If you want something magic/dynamic stuff to happen, you will need to parse the content and rewrite the urls, attach handlers etc. The reason your ng-include does not work like expected is because it only reads the content of that url and embeds it into your view "as-if" it was just a template you made (including angular markup) and wanted to host externally for some reason.