Tag Info

New answers tagged

1

Keerthi's answer will work great if you want to place your JavaScript on one page. If you want to add it to a specific page layout, I would do it a little different. Editing the actual page layout or creating a new custom one would be best so you don't have to add your script to every page. To do this you will have to use SharePoint Designer. In ...


0

You can add a javascript file using the content web part. Edit page -> Add web part -> Media and content -> Content editor -> Add Edit the source of the web part and add the following code into it: ​<script src="/sites/subsite/list/SiteAssets/file.js" type="text/javascript"></script><script ...


6

If you have deployed the CSS file to the Style Library or an Assets library, make sure it is checked in as a major version and approved. It could be possible that your page layout is not published and approved as well. This is the typical symptom when an asset is not approved, it works fine for admins but not general users.


0

FYI, If you are only after using (simple) jQuery selectors. Microsoft has this thing called mQuery built in SharePoint. So jQuerys: $('#myID') becomes: m$('myID') straight out of the box, without the need for jQuery It is loaded on most pages (check in F12 developer tools) if not, use: EnsureScriptFunc('mQuery.js', 'm$', function() { // DO STUFF ...


1

You can also add your scripts in the following section too. <SharePoint:DelegateControl runat="server" ControlId="AdditionalPageHead" AllowMultipleControls="true"/>


2

In your custom page layout first add path to .js file (put path to src="") and then code. <script src="jquery-1.8.3.min.js">//<![CDATA[ //]]> </script> <script>//<![CDATA[ $(document).ready(function(){ //some code }); //]]> </script> <!--MS:<Publishing:EditModePanel ...


2

The quick and dirty version (no external CSS file) $webApp = Get-SPWebApplication http://****:26611/ $webApp.SuiteBarBrandingElementHtml = '<div class="ms-core-brandingText"> <a class="ms-core-brandingText" style="color:white" href="/" >Wp</a></div>' $webApp.Update() Might need an !important, I'm not connected to a farm to try it ...


2

In SharePoint you have three different entities which builds up a page rendering to the user. First, there is the master page, which controls SharePoint at a general level. You’ll find the foundation scripts and styles which works globally on the entire site (which uses this master page). The master page also has the most control of the outer styles. To make ...


1

This isn't set at the library level, it's set at the site level. Site Settings > Page layouts and site templates and add the layout to the page layouts list and seperately set the New Page Default Settings to your template.


0

The mobile view is using the same page layouts. You can check how your page looks on a mobile device by adding ?mobile=1 behind the page url.


1

Try going to default.aspx. If it shows up, you can then set it as the default home page. Edit: Since that doesn't work, since that doesn't work. Go to Site Settings and go to the Page Layouts and Site Templates Settings link. In the Page layouts section, add (Welcome Page) Blank Web Part Page and any other page layouts you may want. Go to your Pages ...


0

I couldn't find any option in the webcontrols that could highlight the current page. I used JQuery selector to apply style as shown below. Solution very specific to my scenario... $('.ms-core-listMenu-verticalBox .ms-core-listMenu-root > li > ul > li > ul > li.selected').css("background-color","#CEEDF9");


0

The marked answer is incorrect. The Site Collection feature SharePoint Server Standard Site Collection features needs to be activated.


0

Try this code snippet. public override void FeatureActivated(SPFeatureReceiverProperties properties) { SPWeb web = properties.Feature.Parent as SPWeb; PublishingWeb publishingWeb = PublishingWeb.GetPublishingWeb(web); string pageName = "MyCustomPage.aspx"; PageLayout[] pageLayouts = publishingWeb.GetAvailablePageLayouts(); PageLayout ...



Top 50 recent answers are included