Adding Blogengine.net Javascript file references
I have a new blogengine site up and want to set up syntax highlighting. The problem is that I have a few files (javascript and css) that I need to add the the head of the page, but there is no one page or masterpage. Does anyone one know where to write out these references so they will show up on all pages? Thanks
R开发者_JS百科yan
Just figured it out. Its in the admin control panel under settings.
Just adding a more complete answer.
After logging into DNBE, go to the settings page in your administration section. You will find a section called:
HTML head section
You can put any additional header elements there.
Blogengine is really good for bloggnging and good for SEO. It brings me good rankings and traffic. The 1.5 version has lots of new plugins and new added features.
Referencing root as what you're trying to do, resolving a URL that doesn't exist. Blogengine works differently. The newer version you must use something like this within your master to reference custom javascript files within your own theme.
For example, I am using jquery version 1.11.2 and need its libraries and my customer code to foot the work. So I have to reference the jquery library inside my project as below.
<script src="<%=(Utils.AbsoluteWebRoot + "Custom/Themes/" + BlogSettings.Instance.Theme + "/js/lib/jquery-1.11.2.min.js")%>" type="text/javascript"></script>
And then I have to add one for my script.
<script src="<%=(Utils.AbsoluteWebRoot + "Custom/Themes/" + BlogSettings.Instance.Theme + "/js/scripts.js")%>" type="text/javascript"></script>
If you are trying to include a javascript or css include into the page template, you can directly edit the site.master file that lives inside the folder for the theme you use. So for instance if your theme is called MyTheme, then you can edit /themes/MyThemes/site.master.
You can also use a little ASP.Net code like this to make the path portable rather than relative to the root of the domain:
<script src='<%# ResolveUrl("~/themes/MyTheme/jquery-1.2.6.pack.js") %>' type="text/javascript"></script>
Also notice that if you have <head runat="server">
inside your site.master file, then css link tags will resolve out correctly, relative to the site.master file, so you don't have to write any special code to make the path protable like the script tag example above.
<link rel="stylesheet" href="master.css" type="text/css" />
精彩评论