Sharepoint solution packaging: how do I get a custom icon for my features? - sharepoint

I am not sure how foolish I am being here!
I have a solution that packages up some master pages and layouts etc which I can deploy fine and the feature appears in the "Site Collection Features" list fine. However I would like to put a custom icon next to my feature. I would like the icon to be in the solution package and so require the image to be put in a list or folder when the solution is deployed (rather than a feature activated).
Is this possible? simple?
There is something about all this sharepoint solution/feature.xml/element.xml I don't grok yet!

It is possible and simple.
In your Feature.xml file, simply include the ImageUrl="" attribute and specify the location of your image. The best practice is to create a folder under the Template\Images folder with your images and then reference this location
Include the folder which contains your images in the solution ddf file
Once deployed, you should have a %12HIVE%\Templates\Images\ACMEImages folder which contains your image
Feature.xml sample:
<Feature
Id="21F724AE-9C1C-4F4D-AAE9-7789CA01A7E3"
Title="ACME Lists"
Description="List definitions for the ACME"
Version="1.0.0.0"
Hidden="false"
Scope="Web"
ImageUrl="ACMEImages\acmelogo.png"
xmlns="http://schemas.microsoft.com/sharepoint/">
<!-- other feature file info omitted -->
DDF file sample:
.Set DestinationDir=IMAGES\AcmeImagesRootFiles\TEMPLATE\IMAGES\ACMEIMages\acmelogo.png

In SharePoint 2010, the Microsoft Default icon is: GenericFeature.gif - a 31 x 22 image. With VS 2010 and SP 2010, you can add a SharePoint "Images" mapped folder to your SharePoint project. Then place your image in this folder. Be sure to provide the Image URL in the Properties panel of the *.feature object. Use a path to the image as noted above.

Pete's solution didn't work for me although I did exactly as he suggests. My problem is that SharePoint is looking for the image in the /_Layouts folder rather than the Templates/Images folder.

Related

Adding a custom t4 template to DDL Generation Template dropdownlist

I know I can add the template in the folder
C:\Program Files (x86)\Microsoft Visual Studio
11.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\DBGen
to make it visible in the DDL Generation Template dropdownlist, but then I need to distribute the template to my team members so they can add the template to the same folder.
I was hoping that I could achieve the same result by adding the template to the VS 2012 solution somehow and make it visible in the same dropdownlist
Do you know a way to achieve this?
I'm using VS 2012 and to generate the database I use Model First approach
I played around with this tonight and found it is possible, but it's kind of a hack. You'll have to edit your edmx file by hand, and make sure it is version controlled because you have to edit the designer section of the edmx file (auto-generated). First thing is to copy the t4 template to the root of your project (might actually have to be in the same folder as the edmx, not sure). Then add the t4 template to your project. Now remove the custom tool entry (in properties) so it doesn't try and auto gen the t4 template. finally add the designer property below in the correct location in the edmx file (i included context to find the right place):
<!-- EF Designer content (DO NOT EDIT MANUALLY BELOW HERE) -->
<edmx:Designer xmlns="http://schemas.microsoft.com/ado/2009/11/edmx">
<edmx:Options>
<DesignerInfoPropertySet>
<DesignerProperty Name="DDLGenerationTemplate" Value="SSDLToSQLite3.tt" />
I ended up making a custom template to generate datetime2 fields. Although I could not get the template to show in the drop down in the properties box, I was able to add the template to the same folder as my .edmx, include it in the solution, then type the file name of the template directly into the designer's property field replacing the default. The value appears to be retained after generating databases and entities, I didn't need to directly edit the edmx XML, and my custom template is now source controlled right next to where it is used.

Change SharePoint Library URL

How do you change the URI of a SharePoint library? Based on Google searching, most people say that changing the name of a library in Designer (via right click->rename) will result in the URI change, but it is only changing the name for me.
I am using SharePoint 2010 Foundation and these are the steps I am following:
In Designer, navigate to List and Libraries
Right click library -> rename
Notice that name changes
Notice that URI does not change
This is one of the resources I found claiming that this works:
change URL spelling/case on sharepoint library
In SharePoint Designer just navigate to All Files navigation node (not List and Libraries node), find your document library there -> right-click library -> rename.
The URI would change then.
Edit:
At least at SharePoint 2010 it is possible to change library URL, without using SharePoint Designer.
Just go to a library trough 'All Site Content'. When inside the library choose on the ribbon 'Library' tab. Then select 'Open with Explorer'. That will open your SharePoint's library in Windows Explorer window. Navigate one folder up and you will see list of your libraries as folders. Rename required library's folder name as you want the URL to look like.
SOLUTION:
Thank you! I found the suggested SharePoint Designer solution above to work beautifully!
Here are the steps that I took:
Follow the instructions above by opening the List in SharePoint Designer, selecting All Files under the navigation node (near the bottom)
A bunch of folders appeared - I selected the folder named 'Lists'.
From here, it will show the list names and the display names. Change the actual name of the list (first column) by right-clicking on it, rename. This will update the url. You may wish to match this to your display name.
When you return to your site, the navigation link for the list may still go to the old URL. To update this, enter in the new url in your browser, go to List Settings > Title, Description and Navigation. Simply hit the save button without making any changes. The navigation link is now updated.
Please note: If you are updating list urls and names of a project site (from Project Server), do not rename the Risks, Issues lists. These must remain for Project Server to function properly.
Thanks for this solution. I only have Designer permissions but was still able to change a List URL within the browser (not Sharepoint Designer, and must be IE to have Open in Explorer enabled). Steps:
Go to Site Contents and open a Document Library in the site
Click on Library ribbon tab and select Open In Explorer option
Click up one level in the directory structure - there should be a
Dir called 'Lists' - open
Your List should be there to right click and rename.
I was surprised that the system let me do this (it didn't let me delete a document in the same DL that I need to get rid of), but after testing for some time the URL change seems to have held.
Finally - you might have to re-Resolve some views and overlays, as these might not automatically cascade with the new List location.
Cheers,
Ross
I have changed the library URL from SharePoint Designer 2010, in the "Site Object" section --> "All files" option. Then I selected the right library in left pane and press F2 (to change name, like in windows) and worked for me. I hope that helps someone.
You cannot change Document Library URL , only name.
If you want to have a new URL :
Create a new document library with good URL
Batch import all docs from old to new document library
warning :
all new imported doc will be flagged with username used in the import process
all datetime fields will be reinitialized
I don't have Sharepoint Developper installed and can't install it.
I needed to change the address of a List and not a library, so the "Open in Explorer" doesn't work for me (only get "Open in Access" and "Open in Project").
I managed to do it by opening Explorer by myself and paste the URL "http://MyServer/MySite/" (can be also "http://MyServer/MySite/MyPage/").
I got the "All Files" you get through Sharepoint Designer.
In my case I had to go to "Lists" and change the name of the folder for the list I wanted to change the name.
Next I had to change the name of the list from the "List properties" (to change back the visible name of the list)
I am only a Site Collection Administrator for a SharePoint online platform. The powershell and sharepoint designer usage are not within my access so the only option I have is the "Open in Explorer". I tried the steps seen online but didn't get the result. When I saw ragmaxone's step, I got an idea. Then I took the following steps:
I copied my url without the document library eg "http://MyServer/MySite/MyDocLib/ is the URL of the document library but I copied "http://MyServer/MySite/ instead.
Next I opened the document library in classic SPOnline because I use modern SPonline.
Then I replaced the pathway address with the copied URL and saw all my document libraries as folders.
With right clicking on the document library of interest, and renaming like is done in windows, I went back to my document library and saw page not found.(Don't worry! Something had changed already).
Then I went to the homepage of the platformand navigated to the document library in question to see that it has been renamed and the URL also corresponds to the new name.
Thanks for all your answers and help.
In Designer go to "All Files" -> then search for "List" folder ther you can find your List right click it rename it and boom.
By going to Lists and Libraries tab from left menu will only change the title of list. So go to All files and follow the steps.

Changing Discussion Folder Names in SharePoint 2010

Is there a way to change the name of a folder within the discussion area of SharePoint 2010? The folder by default is given the name of the discsussion name when it is created, however, if you then change the discussion name, it does not (quite rightly) automatically update the folder name - I would like to though.
Just had a go there, I was able to rename it using SharePoint designer (use the All Files link on the left).
However if you need to do it automatically then you'll have to build an List Item Event Handler, and update the folder name using the API using the ListItemUpdated Event.
Shane

Custom SharePoint List View - can I put it in a feature (WSP)?

Here's my situation:
I'm working in SharePoint 2007 Enterprise, I have a feature that creates a list for me when I deploy and activate it. My usual workflow thus far has been to deploy the solution, activate it, then open up SharePoint Designer to customize the list.
My customizations are typically pretty complex, but I'll keep things simple. In this case, let's just say that I edit AllItems.aspx, convert the data view to an XSLT data view, then I add one column with static text.
I've used a few different tools (SPSource, VSeWSS, SharePoint Manager, OCDExportList, etc) to extract my custom schema.xml and all the default views, but I have yet to have any luck figuring out where the the code for AllItems.aspx is now that it's been customized.
When I extract (using any of the tools above) AllItems.aspx is no different than the default. The <View> element in schema.xml is reduced to one line, for example:
<View DefaultView="TRUE"
MobileView="TRUE"
MobileDefaultView="TRUE"
Type="HTML"
FPModified="TRUE"
DisplayName="All Documents"
Url="Forms/AllItems.aspx"
Level="1"
ContentTypeID="0x" />
I'm really stuck here... I've got no clue what to do. Is it even possible? It would save me a great amount of time (and documentation) if I could include my customizations in my feature.
If there's any other info I'm missing that would help, let me know... thanks!
Latest findings:
I've found out a bit more in the past couple hours. If I save the list as a List Template, then save the .stp file locally as a .cab file I can extract its contents. One of the files is manifest.xml which contains the schema.xml as well as a few other sections.
One of those sections is a <webparts> section that has a <webpart> for each view. Each of those <webpart> elements contains a really long string of characters... no clue what those characters actually represent.
The important thing is that I think any custom views have to actually be Web Parts if deployed as part of a solution... but I'm not positive.
I have faced a similar issue a while ago. I had to create a very customized view and I had to give up the ListFormWebPart completely, and have created my own webpart to render the data.
Generally, when you customize the aspx file in SPDesigner, all your changes will be in the aspx file itself. Open it in SPDesigner and you will see there all the changes you have made. After you have converted to the XSL Data View, the standard ListFormWebPart is replaced by a DataFormWebPart, which doesn't care about the <View> tags specified in the schema.xml; Look in the aspx file itself for the ListFormWebPart.
Why not do all the customizations you want on a list, save the list as a template (it will include the associated AllItems.aspx) and then use that template in your feature to create your list? You could add the extracolumn from code (if it's dynamic and cannot be included in the template), and so on.
Yes you can. Get the Sharepoint manager tool from Codeplex
http://spm.codeplex.com/
Install it on a machine in your farm, it will allow you to browse the farm via a tree view that shows all objects.
Make the list via the Sharepoint GUI, then browse to it w/ SPM.
SPM will allow you to extract the MOSS/WSS created xml that describes the list view (it shows up in the left hand property grid), which you can then plop into your manifest.xml
I have a similar issue and have been doing a lot of research into this. The dataview web part to me is one of the most powerful components in Sharepoint. Unfortunately I have to provide my solution as a .wsp package and that means that I can not just make the site and use Designer on that site. I have taken a 2 step approach in that I used designer to create my dataview and I also edited the code of that dataview to replace the ListID and Guids to ListName and the actual list name. This allows it to be exported and used in any page/site as long as the list name is the same. I am creating a webpart page document library also in my solution and I believe I can add the pages that have the webparts to this library using the onet.xml file. I will try to get the results of that test in as soon as I can do it.

Deployment of custom content type, forms, cqwp, and xsl

Right now I have a visual studio project which contains a custom content type that I made. It also contains all the necessary files for making a sharepoint solution (wsp) file and a script to generate this.
Now, I would like to do 2 things.
First, I'd like to create a custom display form for the content type and include it in my solution so that it is automatically deployed when I deploy my solution. How do I include this in my solution and make my content type use it?
Secondly, you can query this type with the CQWP. I've thought about exporting it, adding more common view fields, and then modifying the XSL that is used to render it. How do I include this into my solution so that it is also deployed. I know i can export the CQWP webpart once it's all setup and include it in my project as a feature. But what abuot the XSL?
Looking forward to see your suggestions, cheers.
Did as described in the first answer. Worked like a charm.
Use STSDev to create the solution package.
That should help with creating the WSP. The custom form, CQWP webpart and the .xls file should also be deployable within the project.
To deploy the xslt, your feature will have an
<ElementManifest Location="mywebpartManifest.xml">
This then points to a files such as
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="Yourfile.xslt" Url="Style Library" Path="" RootWebOnly="TRUE">
<File Url="yourfile.xslt" Type="GhostableInLibrary" />
</Module>
</Elements>
for the webpart:
<Module Name="myWebpart" List="113" Url="_catalogs/wp" RootWebOnly="FALSE">
<File Url="myWebpart.webpart" Type="GhostableInLibrary" />
</Module>
Now that file will need to be contained in the solution manifest.xml. This is done automatically from the STSDev project.
e.g.
<Resources>
<Resource Location="SimpleFeature\Feature.xml"/>
The actual schemas are:
Site
Solution
Feature
and a link to someone else with the issue
But where in the folder structure do you deploy the form and the .xsl to?
I have followed your guide and although it deploys the xslt to the feature in 12 Hive it does not place it in the correct style library folder
You need to deactivate / reactivate the feature. This will give you any error messages that are associated with copying the file over.

Resources