Boostrap left menu, Header footer in separate unique file - twitter-bootstrap-3

after have read tons of different article on the web
i'm looking on a simple way to have in bootstrap my left menu, header and footer on a separate and unique file
this is to prevent having to re-write anythings on each different pages of my application (i'm using a boostrap admin template)
thanks for your advices

Finally, after lots of tries, I use:
$(function(){ $("#header").load("header.html");
$("#footer").load("footer.html"); });
Don't know why, it doesn't work 100% on a local file, but it's ok on the web site.

Related

Should I place a script partial on EVERY page, or in the Layout.cshtml partial file?

My organization is currently working on a new ASP.Net Core web app. We have a couple of common Javascript functions that are used on all pages. At first we put the scripts in a partial file and started adding the following to the Scripts section on every page.
#{await Html.RenderPartialAsync("_CompanyScriptsPartial"); }
At this point we have only added it to a small handful of pages, but have around or so left to add it to.
Is it better to add that on every single page, or can I just put the same code in the layout.cshtml (it works when I do it, I just don't know if I should do it)? What is the 'best practice' method for this scenario?
If the scripts are used on all of your pages, or even if they are used on most of the application pages, then it is better to add the script link to the layout.
This way you avoid duplicating code by not adding RenderPartialAsync to every page.
Best practice is not copy and paste code and to have a single location for common code.

Alfresco File Upload forms in a Share dashlet

I'm sometimes working on Alfresco dashlets that need a file-upload functionality. Instead of making stuff up, I want to use the YUI Uploader provided by Alfresco. For new pages that I build, it's easy, just list the components and put them in the page template. But for dashlets, I always have to put the upload components in the dashboard-1-column*, dashboard-2*... etc, in all of the dashboards.
I think that this is a needless HTML on a page, especially for those sites or users that don't use the dashlet in question.
Is there a neat way to include Alfrescos' file-upload forms (classes/alfresco/site-webscripts/org/alfresco/components/upload/* components) only in a dashlet?

Alfresco Share site's dashlet for document library

I was wondering whether exists any dashlet which allows you to explore a site's document library. As far as I know doesn't exist such dashlet out of the box, there only exists the "Site Content" dashlet but it is slightly limited.
I have been searching around and "googling" and I found these useful resources that could be useful as a starting point if I had to create my own:
http://ecmarchitect.com/archives/2012/05/08/1592
http://code.google.com/p/fme-alfresco-extensions/wiki/GalleryPlusDashlet2
Do somebody know more dashlets/resources targeting this issue? Any suggestion?
As a temporary solution, I'm also thinking in the possibility of taking advantage of the "Web View" dashlet, by configuring in it such URL that retrieves the documentlist region/component in the documentlibrary page. For example:, share/page/components/documentlibrary/documentlist or share/page/site/{site}/documentlibrary?region=documentlist. Maybe it is crazy or what I'm saying doesn't make any sense, but it is just an idea.
Another idea that have just came to my mind is the option of creating a custom Surf/Share page which includes the component/webscript that implements the explorer of the document library, specifically the documentlist component. Then configure the "Web View" dashlet giving the URL that points to the custom page created. Would it make sense?
Thanks in advance.
You are going to see a couple of site visualization and navigation dashlets on Alfresco Visualization Tools available on https://github.com/bhagyas/alfresco-visualization-tools. The project is still at it's initial phase, but you will find interesting snippets of code used to retrieve the document library content trees within the dashlets.
The project was presented by me at Alfresco DevCon in Berlin just a week ago to bring interactive navigation and content analytics. If interested, you can find the slides at the lightening talk slides in the DevCon 2012 site at Alfresco.
Cheers! =)
Hi I've done exactly the same, it was not really needed for a Dashlet but for to embed the documentlibrary of a site in an iframe for another site.
So what I did was indeed create a new page template embedded-documentlibrary.
I've copied first the following files and renamed them:
site-data/pages/documentlibrary.xml
site-data/template-instances/documentlibrary.xml
site-webscripts/org/alfresco/documentlibrary.ftl
If you rename file 3 or put it in another folder, you need to check the paths in file 1 & 2.
So to make only the documentlibrary appear instead of everyting I just removed everything in file 3 within the <div id="alf-hd"> tag.
If you remove the tag, the document-tree will also be removed and it gave some javascript errors. This should be fixed in the latest version, but haven't tied that.
So it's extremely easy to create your own page and instead of navigating to site/documentlibrary you just navigate to site/embedded-documentlibrary or your own name you've chosen.
And yes then you'll need to use the web-view Dashlet to show it.
The only thing you need to know is, that the links open within the iframe. So if you use the web-view Dashlet, you need to open the links in a new window.
For my situation I needed an iframe, in your case you could also just let the freemarker from your Dashlet render the components needed.
There is a document-liberary-display dashlet available in the alfresco add-on list which can be used to show all the documents from document-library on site-dashlet.
http://addons.alfresco.com/addons/document-library-display-dashlet

Modify login page appearance, run javascript/jquery when login fails

I want to modify the appearance of the login page. I've added some jquery and javascript to DesktopModules/AuthenticationServices/DNN/Login.ascx so i could have a virtual keyboard which the user can use to type the username and password. The problem is that when the login fails, it seems to me that the jquery and the javascript scripts are not executed and consequently the virtual keyboard does not appear.
I've done a lot of search on this one. I'm considering making a new login module, but i'm not sure how or if this will enable me to solve the problem.
Any suggestions out there?
DNN Version: 6.1.3
I would advise against changing the core login directly, because it's considered a "core change" and would be overwritten in an upgrade. It would require that you merge your changes before upgrading every time.
Instead, if you require that level of access, I'd suggest creating your own login module.
In looking at your problem though, I don't think that's necessary. You could achieve this same effect by creating and implementing a skin widget. Skin widgets will allow you to manipulate the UI in nearly any way you can think of since you can use jQuery and inject jQuery plugins.
This is a much more elegant solution that can scale, is testable, safe against upgrades, and allows you to reuse it as needed across multiple sites and installations.
Examples of widgets and documentation can be found in the following two links:
DNN Widget Suite Project
Skin Widget Wiki Article with many linked resources
Like Will said you definitely should not edit or add code to the core files as they will get overwritten in DNN upgrades. You should be able to solve this with just Javascript, but you could also look at a 3rd party login module like this one: http://www.dnnspot.com/Modules/DotNetNuke-Custom-Login
Has features to customize the sign in view, logged in view, even error messages. So you should be able to inject different javascript as needed in different situations.
Disclaimer - I am affiliated with DNNspot.
I used this javascript On-Screen-Keyboard (OSK) which is lovely.
(http://www.greywyvern.com/code/javascript/keyboard)
I am using DNN 5.6.8 so I'm not sure if my solution works for DNN 6.x .
I modify the "page.ascx" file of the "skin" I'm using, but I think you can modify the "page.ascx" of the default skin as well.
At the top of the page.ascx, below the list of "Register"'s I wrote this:
<script type="text/javascript" src="/js/keyboard.js" charset="UTF-8"></script>
<link rel="stylesheet" type="text/css" href="/js/keyboard.css">
Those 2 files (keyboard.js and keyboard.css) are the on-screen-keyboard. You may store them in other folders than "/js" of course.
At the bottom of the page.ascx, I put this script:
<script type="text/javascript">
$(document).ready(function () {
if (document.getElementById('dnn_ctr_Login_Login_DNN_txtUsername') != null) {
$("#dnn_ctr_Login_Login_DNN_txtUsername").attr("lang", "es");
$("#dnn_ctr_Login_Login_DNN_txtPassword").attr("lang", "es");
VKI_attach(document.getElementById('dnn_ctr_Login_Login_DNN_txtUsername'));
VKI_attach(document.getElementById('dnn_ctr_Login_Login_DNN_txtPassword'));
}
});
</script>
These names: 'dnn_ctr_Login_Login_DNN_txtUsername' and 'dnn_ctr_Login_Login_DNN_txtPassword' were the ones I saw by right-clicking and "View source code" of my DNN site running, and I think there's no reason to think they can be different in other DNN sites, but nevertheless you can check yours.
Obviously you must have jQuery active in your DNN installation. :)
That's it. It works great!!
HTH!

How do I switch the theme used on a Sitefinity based website?

We have a Sitefinity 3.2 site in production and the users want a whole new look and feel. Upgrading is not an option.
I have created new templates for them but they will need to go into the site and create all new pages using the new templates. This is a problem because they want the current site to remain unchanged until they are done - then they want to instantly switch over.
One problem that I see already is that pages will not show up in the menu control until they are published.
I am very new to Sitefinity. Is there a standard practice for doing this?
You don't need to re-create all of the pages to change the look and feel; simply change the template assigned.
This video shows how to work with themes and templates.
I'd think that changing the theme of all the templates late at night should be "instantly" enough for most people. :)