0

In module we have 2 files sameple.txt and custommaster.master. Here is an sample image:-

enter image description here

I would like to know from the URL you can see in the above elements.xml file, where would the sample.txt and custommaster.master page get deployed to? Is it the hive or content db?

UPDATE

Here are the 2 ways to use the module:

First method:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="ModuleName" Path="ModuleName" Url="_catalogs/masterpage">
    <File Url="testmaster.master" Type="GhostableInLibrary" IgnoreIfAlreadyExists="TRUE" >
    </File>
  </Module>
</Elements>

Second method:

   <?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="ModuleName" Url="_catalogs/masterpage">
  <File Path="ModuleName\testnaster.master" Url="testmaster.master" Type="GhostableInLibrary" IgnoreIfAlreadyExists="true">
</File>
</Module>
</Elements>

In 2nd example we do not use Path in module tag. Hence, we have to mention path under the File tag.

2

Sample.txt file is added on its own when a Module is added to the project. Normally, it is renames to whatever you want to add to module. Both the files will get deployed to the site and hence content Database as is clear from the Url.

  • Hi Nadeem, consider this as an example and along with master page there is this sample.txt as well, just want to know where it will reside. URL="CustomMasterPages/sample.txt".. Where is this folder CustomMasterMages. – variable Mar 5 '14 at 5:57
  • 1
    Append CustomMasterPages/sample.txt to the site url and you will be able to get it. So it is stored in content database and is unique to the site only compared to file which is deployed to physical path like layouts and hence can be accessed from any site by putting something like /_layouts/name of file – Nadeem Yousuf Mar 5 '14 at 6:00
  • nadeem can you give me any reference link for an article on this topic. – variable Mar 5 '14 at 7:02
  • I don't have any reference. Just answered out of my experience. – Nadeem Yousuf Mar 5 '14 at 7:11
  • I would like to know more about implications and possibilities of using the path and url attribute... – variable Mar 5 '14 at 8:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.