Posts

Showing posts from February, 2010

Access lists from subsites (here we go again)

Where did "Connect to another library..." go? It is gone (at least for beta). My fix is to create a fully filtered and customized data view webpart in the root site, and then export it to a file to add to a subsite later. You can also use the Content Query Web Part. Here goes a post from someone on the inside: "unfortunately, we removed the UI for connecting to other lists. This feature had some issues in 2007, so we decided to cut it. Here are a couple workarounds in SPD 2010: 1. If you are a site collection admin, you can go to the library's view in SPD and save it to the web part gallery (web part tab > save to gallery). From there you can insert it into any site in that site collection. 2. If you are not a site collection admin, you can go to the library's view in SPD and save it to a file (web part tab > save to file). From there you can drag and drop the file onto the design surface. These touch on what I meant to say in my previous comment - "...

SP2010 Cannot Activate WSP User Solution

After uploading solution to user solution gallery, Activate Button does nothing! PowerShell comes to save us: Install-SPUserSolution -Identity MySolution -Site http://mysite or simply run "Install-SPUserSolution" when enter the required parameters

SP2010 Save Site as Template

1) Link available in SPDesigner, Home, Save as Template in the Ribbon, or directly to /_layouts/savetmpl.aspx 2) Activate the feature (on my case, the browser throws javascript errors on this) Install-SPUserSolution -Identity MySolution -Site http://mysite ("MySolution" does not include file extensions) 3) Remember to add your saved and activated template to template list or it won't show on new site dialog. /_Layouts/AreaTemplateSettings.aspx http://sharepoint2010.macaw.nl/archive/2009/10/19/sharepoint-2010-site-exporting-as-wsp-solution-part-1.aspx

Rename any matches from all files

get-childitem -Path *est*.txt | rename-item -NewName {$_.name -replace "est", "iag"} http://andrwwatt.wordpress.com/2006/05/13/limitations-of-the-rename-item-cmdlet/

posting from google feedburner to twitter

Image
experienced issues with twitterfeed.com :-( Also, activate PingShot and your posts will be twittered in "real time"! http://googlesystem.blogspot.com/2009/12/feedburner-socialize-add-your-feed-to.html

Multiple Web Part instances on page?

Image
When adding a second instance of a webpart: "Unable to add selected web part(s). xxx Web Part: A Web Part with this ID has already been added to this page. Solution: - Remove ID attribution for main web part class (don't do this.ID="...") - Send webpart id as editorpart parameter and add it to the editorpart id (do editorpart->this.ID="editorpart"+webpartid) http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/03600775-2e0d-426c-9be4-e5db77588d72

SharePoint 2010 Basic DataViews

Simplest things could be crazy to find in 2010. What a fully customizable Data View like in 2007? - SharePoint Designer - Ribbon - Insert - DataView - Empty Data View (chosing this option will enable more design options than usual) - Add a data source - Add a field from the data source - Click "Design" under Data View Tools - Select "Plain list of titles" (this will enable full customization) - Write your own divs / tabs / whatever

Thumbnails in SharePoint

I take it there aren't any too easy posts so here goes: Say you need a list item query in a page and a new page to unique item view. You'd want to have a picture, right? But how do you show it smaller on the query? css? not so good... The best way is to have both a list for articles and a separate picture library for images, and site columns in the list for picture and thumbnail picture. So, use two fields on list contents, picture and thumbnailpic, where you keep: NEWS LIST picture --> /NewsPictures/pic01.png thumbnailpic --> /NewsPictures/_t/pic01_png.jpg SharePoint creates a thumbnail for each picure in picture libraries in jpeg format, 160pixels width.

Internet Explorer 64 bit is default?

I go crazy when I open Outlook links for pages with Flash animations and stuff and it opens in Internet Explorer 64 bit! These things simply don't appear, since there aren't still plugins for these things. My "fix": Rename C:\Program Files\Internet Explorer to C:\Program Files\Internet Explorer64bit Copy C:\Program Files (x86)\Internet Explorer to C:\Program Files I know, it's kind of tricky, but it gets the job done, and without losing the 64bit version. Update: Change default .mht file program http://social.technet.microsoft.com/Forums/en/w7itproappcompat/thread/d7864b30-f178-4d62-8f9a-1d765802ed79

Lightbox or LyteBox ?

Great news for lightbox lovers Here's one for SP2007 http://blog.drisgill.com/2008/10/new-codeplex-project-lytebox-for.html Thank you Randy!

Window alerts in C#

the javascript way if(error) //your logic here {   ClientScript.RegisterStartupScript(typeof(Page), "test", "<script>alert('Hello');return false;</script>"); } to a button btn.Attributes.Add("onClick", "javascript:alert('Message Here');"); using messagebox class (using System.Windows.Forms;) if (MessageBox.Show("Do you want to continue?", "Question", MessageBoxButtons.YesNo) == DialogResult.Yes) { //if user clicks yes, do stuff } or System.Windows.Forms.MessageBox.Show("This is a message"); If errors should occur, go to project -> add reference, then scroll down to System.Windows.Forms and select it. This will add to web.config: <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies> Ajax Modal Popup http://www.asp.net/AJAX/AjaxControlToolkit/Samples/ModalPopup/ModalPopup.asp...

Windows XP Hidden Song

Ever wondered where the cool song on after-install time was kept? I did. c:\windows\system32\oobe\images\title.wma (hidden)

Copyright and copyright symbols in page

&copy; --> © &#169; --> © http://www.copyrightauthority.com/copyright-symbol/

Download Office 2010 & SharePoint 2010 VMs

Download Virtual Machines for 2010 apps http://www.microsoft.com/downloads/details.aspx?FamilyID=0c51819b-3d40-435c-a103-a5481fe0a0d2&displaylang=en

SharePoint Masterpage items in dialogs

If you create contents to masterpage body, such as a div containing a footer, it will show in modal views (dialog windows). To keep this from happening, add the no dialog class to the div: <div id="footer" class="s4-notdlg"> Copyright @ 2010 </div> -> remember to place the div before the last div (inside s4-workspace) div#footer { clear:both; text-align:center; position:relative; padding:10px; } optionally, use css negative clauses to undo the "damage": .ms-dialog .class { background:none; } http://www.heatherwaterman.com/blog/Lists/Posts/Post.aspx?ID=23

Exporting layer to new file

Sometimes the simplest things can be hard to do. To easily creating a new file with an existing layer: 1. [If layer contains transparencies] Click layer and chose Convert to New Smart Object 2. Ctrl + A (Select Canvas) 3. Ctrl + C (Copy -> New files will be created with the same size as copied item) 4. Ctrl + N (New file) 5. Ctrl + V (Paste) 6. Remove automatic white background layer

Add links to top right global breadcrumb

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\CONTROLTEMPLATES Open MySiteLink.ascx Add this line <asp:HyperLink runat="server" id="hypBack" NavigateUrl="http://localhost"> Main Portal</asp:HyperLink> | It should look like this: (result will be Welcome User X | Main Portal | My Site | My Links) <asp:Literal id="hlMySiteSpacerPrefix" runat="server" /> <asp:HyperLink runat="server" id="hypBack" NavigateUrl="http://my_sharepoint_url">Portal_Name | <asp:HyperLink id="hlMySite" runat="server" /> <asp:Literal id="hlMySiteSpacerSuffix" runat="server" /> http://www.theartofsharepoint.com/2007/07/adding-custom-global-link.html

Roll over images

js script linked img tag (right click, save target as...)

AllWebs Access Denied

SPSite MySite = new SPSite(Url_string); SPWeb MyWeb = MySite.AllWebs[Web_string]; SPList MyPictureList = MyWeb.Lists[List_string]; this code will crash for anonymous users or those without enough permissions instead do (which returns all but the root site): SPSite MySite = new SPSite(Url_string); SPWebCollection UserSites = MySite.OpenWeb().GetSubwebsForCurrentUser(); SPWeb MyWeb = UserSites[Web_string]; SPList MyPictureList = MyWeb.Lists[List_string]; or even better: SPSite MySite = new SPSite(Url_string); SPWeb MyWeb = MySite.OpenWeb(Web_string); SPList MyPictureList = MyWeb.Lists[List_string]; Source http://wssdevelopment.blogspot.com/2008/01/access-denied-when-using-spsiteallwebs.html

Foreach Conditional Job

foreach (SPListItem listitem in MyPictureList.Items) if (condition_for_skipping) // or if(!condition) {     continue; } } *** if condition happens, it skips to next item on foreach (continue=skip)

Variations Issues - welcome page cannot be deleted

You may run into this: "The item that you are trying to delete is the current welcome page and cannot be deleted." Problem: Startup page does not exist (languages removed?) Solution: Site Actions -> Site Settings -> Modify All Settings -> "Welcome page" under "Look and Feel" Set it back to default.aspx Also check the hidden list: /Relationships List/AllItems.aspx

Multilanguage startup

Image
http://www.codeproject.com/KB/sharepoint/MOSS_multilingual.aspx http://social.msdn.microsoft.com/Forums/en/sharepointdevelopment/thread/769097fd-4e3d-4a1d-b3f0-3a2c87ef9a2e http://blogs.microsoft.co.il/blogs/egady/archive/2009/01/21/sharepoint-site-variations.aspx http://stsadm.blogspot.com/2008/04/fun-with-variations.html

Enabling content types for dummies

Content types are a great way of structuring our site's contents, creating ease for data access, and also saving time while reusing data. 1) Create All Site Columns for fields going to be used (pub html, mail, user, etc) all in a group "my new site columns" * remember to create fields with no spaces or whatever (preferably pure lowercase letters) to avoid the _x20_ conversions later 2) Create Content Types for Page Layouts (My new site page layouts) and List Content Types (My new site lists) 3) For page layouts, go to master page and page layout gallery and click "New" and use the newly created page layout. Go to SPD and set a table structure with the content type's fields (such as publishing html) and web part zones / web parts. For Lists, create a new custom list, go to list settings, advanced settings and set "Allow management of content types" to yes, and add & set as default content type the "My new site lists". Disable the manag...

Fixed Width SP2010

<div ID="s4-bodyContainer" class="s4-nosetwidth" style="width:960px; margin:auto;"> http://social.technet.microsoft.com/Forums/en/sharepoint2010customization/thread/cef5a30f-b853-490b-8e4d-ab1084baa20a

Login / Logout links

Using these with an ASP.NET LoginView is a functional way for having a dynamic login/logout button Login /_layouts/Authenticate.aspx Logout /_layouts/SignOut.aspx this code adds a dynamic login/logout footer and hides the globallinks breadcrumb on anonymous users Get Header&Footer Code

Randy's Blog: Enable Anonymous View in SP2010

Image
Central Admin > Web Applications > Authentication Providers > Default > Enable anonymous access Site Collection > Site Actions > Site Settings > Site Permissions (under Users and Permissions) http://blog.drisgill.com/2009/11/sp2010-branding-tip-9-turn-on-anonymous.html Troubleshooting: - Make sure "Annonymous access" is enabled in IIS website, "Authentication"

Playing audio and video files

<OBJECT id="VIDEO" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject"> <PARAM NAME="URL" VALUE="FileURL"> <PARAM NAME="SendPlayStateChangeEvents" VALUE="True"> <PARAM NAME="AutoStart" VALUE="True"> <PARAM NAME="uiMode" VALUE="none"> <PARAM NAME="PlayCount" VALUE="1"> </OBJECT> FOR WMP 11 <object classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" width="600" height="400" id="mediaplayer1" title="Win Media Player"> <param name="FileName" value="http://Test:2312/MyVideo/clock.wmv"> <param name="AutoStart" value="True"> <param name="ShowControls" value="True"> <param name="ShowStatusBar" value="False"> <param name=...

Start up usage reports

"Both Windows SharePoint Services Usage logging and Office SharePoint Usage Processing must be enabled to view usage reports. Please contact your administrator to ensure that these services are enabled." You have to enable two options. Open “Central Administration” -> “Operation” and click on “Usage analysis processing” under “Logging and Reporting” and check “Enable Logging”. Then, move to “Shared Service Provider”, Click on “Usage reporting” under “Office SharePoint Usage Reporting” and check both options. Credits for this solution goes to Meher Kanth's blog http://meherkanthch.blogspot.com/2009/01/moss-2007-site-usage-report-error.html

Change SharePoint file icons (pdf)

Image
get icon 1) open C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Template\Images paste the icon 2) open C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Template\xml\Docicon.xml paste under ByExtention <Mapping Key="pdf" Value="pdficon.gif" /> 3) restart IIS http://www.adobe.com/misc/linking.html http://zebracube.wordpress.com/2009/06/18/how-to-add-sharepoint-pdf-icon/

Messed up RSS View

Once you activate RSS for a site, when you configure RSS on a list for the first time, it creates a file "RssView.aspx" in the list folder If for some reason, editing or erasing it, you break the file, you'll get this error: "The selected view is invalid" After this, creating new lists, copying Rss views or whatever, won't solve this issue. My solution was to create a new view on the browser's list settings and call it exactly "RssView"

Working on a SharePoint IE6 PNG Fix

Source http://perishablepress.com/press/2008/05/28/css-hackz-series-png-fix-for-internet-explorer Also, check out Grace Hunts Web Parts http://gracehunt.codeplex.com For now, none of them successfully fixed both img inline images and css background-image styles. Ideas anyone? Update: Use Grace Hunt's png fix to fix inline images, and create a conditional css for IE6, with png non-transparent images (thus, copying background colors to white transparencies, making it look the same)