Tag Info

Hot answers tagged

37

At a high level, it often depends on your view of the function of the files: site 'infrastructure' which is critical to branding (e.g. public-facing WCM). Here you might choose to store on the filesystem as users/content authors will never be modifying the files content specific to an individual site, open to customization (e.g. a team site in a collab ...


21

I posted this exact question a few years ago and got 2 detailed responses back, one being from Andrew Connell! Both responses were of similar view point. Andrew said: Anthony- The way I do it is all content goes in one of the three special libraries in each site (Images/Documents/Pages) and all branding stuff goes inside the Style Library. I ...


12

Looks like someone already posted my $.02 :) I don't like them in _layouts... I prefer them in the Style Library. Want my long winded response? Read my article on MSDN: http://msdn.microsoft.com/en-us/library/dd221375.aspx


10

If you can deploy to _layouts (i.e. not restricted to sandbox) and you anticipate needing these libraries across many site collections, I would deploy them to a folder within _layouts. Generally, it's good practice when deploying into _layouts to deploy to a subdirectory within _layouts, something like "_layouts/MyCompanyOrMyProduct" to avoid file naming ...


9

The key word in your question is "farm", and this answers your question for you: HIVE. THE HIVE The SharePoint hive was designed to house a single instance of those files which are used across all the sites and web apps within a SharePoint farm (regardless of the site type or branding etc). An example... A typical corporate SharePoint topology ...


8

Since your file in _layouts directory, why not to use GetGenericSetupPath method? Something like this: var path = SPUtility.GetGenericSetupPath(@"TEMPLATE\LAYOUTS\MyPoject\data.xml"); UPD: This method is obsolete in SharePoint 2013, you should use GetCurrentGenericSetupPath or GetVersionedGenericSetupPath Thanks for noticing that fact in comments.


5

Don't do it, you will break your farm. Also, you'll leave it completely unsupported and the next service pack or cumulative update will probably just replace it. What is it you need to do? There'll be a better, supported method for what you want to do without renaming out-of-the-box system files. Edit your question and provide some more information, I'll be ...


5

There is no needs to add a module if you place it inside a Mapped Layout Folder.


4

The blog post rendered by xslt transformation. In this case you should change XSL template for your posts in 14\TEMPLATE\LAYOUTS\XSL folder. You can use this post as start point to understand how does it work.


4

I've always put my javascript and css files in a document library where they can be called relatively from a script. The only reason I would say putting them in the _layouts folder is if you plan on implementing the css files into more than one site collection. Why bother? If the styling for CSS is going to stay with the site collection, it's more logical ...


4

Another reason to let your CSS files, JavaScripts, images etc stay in the Style Library, Site Assets or other document library is Sandboxed Solutions in SharePoint 2010. If you plan or even thinks of moving your solution to a user code solution then the file system is a no go.


4

SharePoint requires the WelcomePage to be a sitepage (not in _layouts), if it isn't it'll use default.aspx, so you have to introduce a redirect page as I suggest as answer to the question Change default site in Sharepoint foundation Or you can just use Sharepoint Designer to give default.aspx the content I suggest for redirect.aspx


3

You need to modify the XSLT generated to create your custom look. Once you add your DVWP, SPD adds the XSLT to the page. If you switch to split view, you can click your DVWP, and the code block will be highlighted. Before you modify the XSL directly, there are a couple of things you can do to make it easier. Select the base layout that is closest to ...


3

They should be in a site collection so that css designers can change them without having to go through a system modification process with the server admins. Even though the files cannot hurt anything, typical sys mod procedures require multiple approvals and scheduling which is excessive and unnecessary for style sheet changes.


2

Yes it could be done by directly editing the subnew.aspx page, but I tend to stay away from editing internal files for several reasons (like support from Microsoft). Although the approach mentioned by Kit Menke is supported by Microsoft, it creates additional burden because you have to maintain a copy of each layouts file and keep them synchronized in case ...


2

Depending on what you're doing, a less-invasive option would be to store data in the property bag for the web application, which would avoid the need to modify the web.config. You can use the SharePoint Property Bag Settings 2010 project to add/manage property bag keys, or create them with PowerShell or an Event Receiver.


2

The final answer to this is that both will provide images which can be used for branding. There are reasons for both, however I believe the better way (especially when using publishing) is to use the Style Library in a site to insert branding images. Images are then stored in the content DB, and when a content DB is restored (e.g. DR scenario), the images ...


2

There is a web.config in Layouts folder. Turn off errors in that file. Ref: http://msdn.microsoft.com/en-us/library/ms460914.aspx Or you can also turn on developer dashboard which will also show you the stack trace information. $service = [Microsoft.SharePoint.Administration.SPWebService]::ContentService $addsetting =$service.DeveloperDashboardSettings ...


2

As far as I know, code-behind usage in SharePoint requires you to specify the full assembly name of the assembly that contains the codebehind class (that is - assuming that your assembly is deployed to the gac). Please see if by using the full name your problem is resolved, ie: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Frameset.aspx.cs" ...


2

If you deploy your web service to the layouts directory, you may run into some unexpected behavior with your web service. ISAPI is the best practice location to deploy any custom web services. This is because this folder is set up to serve your web services via wswsdl and wsdisco. As explained by James Tsai in his article Where do you deploy custom ...


2

can you deploy your solution to both the 14 and 15 hive? Check out this link: http://technet.microsoft.com/en-us/library/ff607534.aspx and the compatibilitylevel parameter. Install-SPSolution $SolutionName -GACDeployment -Force -Confirm:$false -CompatibilityLevel {14,15}


2

This "error" occurs when you manually change the file directly in the layouts folder instead of through the solution w/ deploy. Try deleting the js file from the layouts folder on the drive, check that the js file is included in the package file in your solution, then deploy the solution. It should put a fresh copy of the js file into the layouts folder on ...


1

I lean towards the hive for two reasons: one is as you mentioned, it's globally available and I find easier to manage. The other is anything in a list or library is blob-ified into SQL, therefore to call your images for your branding, SharePoint calls SQL to get the files (of course you should use blob caching here to help with the performance). The biggest ...


1

I recently ran into the same requirement for a company Blog where several authors are posting articles but the visitors should not see the author name. The simple approach is to use the following CSS, e.g. add it to your masterpage, to hide the author: .ms-rightblogpost div.ms-PostFooter span.ms-postfootercolor:first-child, .ms-rightblogpost ...


1

Since you are putting the file in layouts, can I assume this is a file that going to remain static, and not be edited? If that is the case you might like to try an alternative method, and that is to take advantage of the .NET resource framework. Rather than put the xml file in the layouts folder, create a resources file in your VS project (eg Strings.resx) ...


1

Basically, you need to pass your default credentials for this to work. Check this post where a text file is read from a layouts folder. I believe you are having similar issue.


1

agree with James. try to put your InputCsvFile.aspx in a subfolder in Layouts, then put web.config file in the same subfolder with your nodes (configuration -> location; etc)



Only top voted, non community-wiki answers of a minimum length are eligible