CHUVASH.eu
  • About
  • Search

Posts

October 21, 2011

Hide my site link with css

Want to hide my site link without disabling social features. my site link Well, the simplest way to do it is to use css:

#mp1\_0\_0\_Anchor { display: none; }
```If you want to hide my profile instead, just hide #mp1\_0\_1\_Anchor:

#mp1_0_1_Anchor { display: none; }

.ms-MenuUIUL li[text=‘My Site’] { display: none;}


##### Disable the my profile feature An even better solution is maybe to disable the ability to change the profiles. [Just remove the permission to "user personalization..." for All authenticated users in User Profile Service](http://blog.libinuko.com/2010/10/10/sharepoint-2010-howto-disable-my-site-and-my-profile-link/).

## Comments from Wordpress.com


#### 
[John]( "johnandrewdavies@hotmail.com") - <time datetime="2012-03-07 00:15:32">Mar 3, 2012</time>

Be careful this cannot be used, the classes for pop up menus are generated dynamically on the page, and that class can be applied to a number of menus I assume depending on the order which they load on the page, which isnt the same every time, so for instance this hides something in the site actions menu, or the new button on a library sometimes.
<hr />
#### 
[Brett Anderson](http://sharepoint2020.wordpress.com "brettando@live.com.au") - <time datetime="2012-05-02 06:13:05">May 3, 2012</time>

Hi, The amended solution does not work in IE7.
<hr />
#### 
[Fredrik]( "fredrik.eriksson234@gmail.com") - <time datetime="2012-03-09 15:27:24">Mar 5, 2012</time>

Thank you Anatoly, that worked perfectly in all browsers! I had problems with the first suggested solution, because it would hide other menu items, like "edit this page" from the site settings dropdown!
<hr />
#### 
[Anatoly Mironov]( "mirontoli@gmail.com") - <time datetime="2012-03-07 09:10:36">Mar 3, 2012</time>

You are totally right, John! I realized that too. Fortunately, I didn't need that then. But while using that I saw that sometimes Site Actions -Edit Page disappeared. These IDs are really generated dynamically. Thanks for your comment. I'll update my post.
<hr />
#### 
[vishal]( "vishals.shivan@gmail.com") - <time datetime="2012-03-07 07:27:54">Mar 3, 2012</time>

Hi Anatoly. Thanks for the solution. but the problem we are facing one problem after implementing this. Once we make this change and when login to the portal next time, the "Edit Page" link under site action menu is not getting displayed and the My Site Link is getting displyed. any suggestion?
<hr />
#### 
[Material SharePoint &raquo; Hide &lsquo;My Site&rsquo; Link from Welcome User Dropdown Control](http://sharepoint.jsturges.com/2012/05/hide-my-site-link-from-welcome-user-dropdown-control/ "") - <time datetime="2012-05-12 17:45:13">May 6, 2012</time>

\[...\] of my enterprise level clients that we usually hide it all together! To do this, you can use an awesome CSS trick I learned from Anatoly \[...\]
<hr />
#### 
[Anatoly Mironov]( "mirontoli@gmail.com") - <time datetime="2012-03-07 09:24:39">Mar 3, 2012</time>

Hi Vishal. Unfortunately we cannot rely on these IDs, as John in previous comment mentioned, because these IDs are generated dynamically. I'll update my post. One possible solution would be use attribute selectors... Something like .ms-MenuUIUL li\[text='My Site'\] { display: none;}
<hr />
#### 
[jim]( "jim.omara@gmail.com") - <time datetime="2014-02-12 17:38:05">Feb 3, 2014</time>

.ms-welcomeMenu #mp1\_0\_0{ display:none; } .ms-welcomeMenu #mp1\_0\_1{ display:none; } .ms-welcomeMenu #mp1\_0\_2{ display:none; } .ms-welcomeMenu #mp1\_0\_3{ display:none; } .ms-welcomeMenu #mp1\_0\_4{ display:none; } .ms-welcomeMenu #mp1\_0\_8{ display:none; } .ms-welcomeMenu #mp1\_0\_9{ display:none; } these work for me.
<hr />
#### 
[Anatoly Mironov](http://chuvash.eu "mirontoli@gmail.com") - <time datetime="2014-02-12 23:20:59">Feb 3, 2014</time>

Thank you for sharing your solution. Appreciate.
<hr />
read more
October 21, 2011

Go back in javascript

Add link for “Go Back” in javascript (inspired by Webmasters tips):

<a href="javascript:location.href=document.referrer;">Back</a>
```If you have access to the code behind you can [do the same](http://www.beansoftware.com/ASP.NET-FAQ/Referrer-URL.aspx) with:

Request.UrlReferrer.ToString() ```If you want to go to site collection root, it is simple, too: <SharePoint:SPLinkButton runat="server" NavigateUrl="<% $SPUrl:~SiteCollection/%>">Start</SharePoint:SPLinkButton>

read more
October 20, 2011

.gitignore for .net

At appharbor there is a simple .gitignore file for .net applications. If you use Resharper, you may find the extended version of .gitignore useful. A most comprehensive .gitignore can be found on gitextensions website. (Thanks to Vasiliy Aksyonov for the comment):

#ignore thumbnails created by windows
Thumbs.db
#Ignore files build by Visual Studio
\*.obj
\*.exe
\*.pdb
\*.user
\*.aps
\*.pch
\*.vspscc
\*\_i.c
\*\_p.c
\*.ncb
\*.suo
\*.tlb
\*.tlh
\*.bak
\*.cache
\*.ilk
\*.log
\[Bb\]in
\[Dd\]ebug\*/
\*.lib
\*.sbr
obj/
\[Rr\]elease\*/
\_ReSharper\*/
\[Tt\]est\[Rr\]esult\*
```If git tracks some files you don't want it to track, [just remove these files from the git repo](http://stackoverflow.com/questions/1273108/how-do-i-git-rm-a-file-without-deleting-it-from-disk "See the answer at Stackoverflow"):

git rm –cached file

read more
October 19, 2011

Uninstall custom features in a batch

A funny powershell command I came upon today together with my colleague. Remove all your custom features (which start with something, say contoso):

Get-SPFeature 
       | Where { $\_.DisplayName.StartsWith("Contoso.") } 
       | ForEach { Uninstall-SPFeature $\_.Id -confirm:0 -force }

Have fun!

read more
October 19, 2011

Configure User Profile Service Application

Today I have struggled with User Profile Service Application. I should have followed this awesome tutorial by ShareponitGeorge. And many thanks to my friend David for the great assistance! One important thing to beware about: Forefront Identity Manager Service must be running. Otherwise you don’t see the existing synchronization connections and you can’t add new connections. thanks to johan You can ensure that this service is running by running services.msc (just press Windows button and write services). Or you can do in powershell:

read more
October 18, 2011

Sense of case

Sometimes one must have much sense of humour. Take a look at this:

<Field ID="{0F0BC0C4-2478-4CB5-85B0-A01B79956061}"
	Name="TargetUrl"
	DisplayName="MyUrl"
	StaticName="TargetUrl"
	Type="URL"
	Sealed="TRUE"/>
```How many erros can arise in this custom field? Hmpf, everything is clear. But when I tried this (with Type="Url") many unexpected errors occured. Sometimes it is a tumbleweed with case-sensitive stuff in the case-insensitive Windows environment.
read more
October 18, 2011

Auto-resize the main container in master page

If you have a master page with fixed size (perhaps in a centered layout). Here is a simplistic js-script to auto-resize:

$(window).load(function(){
	$wider = false;
	$pagecontainer = $("#pagecontainer");
	$elementsToCareAbout = $("#ctl00\_MSO\_ContentDiv > \*, #ctl00\_MSO\_ContentDiv table")
	$elementsToCareAbout.each(function(){
		if($(this).width() > $pagecontainer.width())
		{
			$wider = true;
		}
	});
	if ($wider) $pagecontainer.width(1200);
});

Any improvement ideas and suggestions are more than welcome.
read more
October 18, 2011

Check if an html element is hidden using jQuery

Well, sometimes we need to calculate width and so on. In my next post I will write about how to fix auto-resize on fixed sized master pages. But now: a very nice stuff: how to check if an element is hidden or not:

$("#s4-leftpanel").is(":visible")
```It is a pure poetry. It reminds me of the beauty of [symbols in Ruby](http://rubylearning.com/satishtalim/ruby_symbols.html).
read more
October 18, 2011

Add article content and editing to your Page Layout

If you work with Sharepoint Designer, use your own page layouts and want to have them for a page in a publishing site, you have to put in some controls in order to see th page content in you custom page layout. Put in a appropriate place in you page layout ( taken from ArticleLeft.aspx):

<div>
	<PublishingWebControls:EditModePanel runat="server" CssClass="edit-mode-panel">
		<SharePoint:TextField runat="server" FieldName="Title"/>
	</PublishingWebControls:EditModePanel>
	<div class="captioned-image">
		<div class="image">
			<PublishingWebControls:RichImageField FieldName="PublishingPageImage" runat="server"/>
		</div>
		<div class="caption">
			<PublishingWebControls:RichHtmlField FieldName="PublishingImageCaption"  
				AllowTextMarkup="false" AllowTables="false" AllowLists="false" 
				AllowHeadings="false" AllowStyles="false" AllowFontColorsMenu="false" 
				AllowParagraphFormatting="false" AllowFonts="false" PreviewValueSize="Small" 
				AllowInsert="false" runat="server"/>
		</div>
	</div>
	<div class="article-header">
		<div class="date-line">
			<SharePoint:DateTimeField FieldName="ArticleStartDate" runat="server"/>
		</div>
		<div class="by-line">
			<SharePoint:TextField FieldName="ArticleByLine" runat="server"/>
		</div>
	</div>
	<div class="article-content">
		<PublishingWebControls:RichHtmlField FieldName="PublishingPageContent" 
			HasInitialFocus="True" MinimumEditHeight="400px" runat="server"/>
	</div>
	<PublishingWebControls:EditModePanel runat="server" CssClass="edit-mode-panel roll-up">
		<PublishingWebControls:RichImageField FieldName="PublishingRollupImage" 
			AllowHyperLinks="false" runat="server" />
		<asp:Label text="<%$Resources:cms,Article\_rollup\_image\_text%>" runat="server" />
	</PublishingWebControls:EditModePanel>
</div>

Comments from Wordpress.com

Renate - May 1, 2014

read more
October 18, 2011

Add TreeView to Site

For all of who use Randy Drisgill’s starter masters, it won’t help if you go to Site Actions TreView and just enable it, because the DelegateControl is in a hidden panel. To really restore the original treeview you have to copy this xml from v4.master:

<Sharepoint:UIVersionedContent runat="server" UIVersion="4">
	<ContentTemplate>
		<Sharepoint:SPNavigationManager
		id="TreeViewNavigationManagerV4"
		runat="server"
		ContainedControl="TreeView"
		CssClass="s4-treeView"
		>
		  <SharePoint:SPLinkButton runat="server" 
			NavigateUrl="~site/\_layouts/viewlsts.aspx" 
			id="idNavLinkSiteHierarchyV4" 
			Text="<%$Resources:wss,treeview\_header%>" 
			accesskey="<%$Resources:wss,quiklnch\_allcontent\_AK%>" 
			CssClass="s4-qlheader" />
			  <div class="ms-treeviewouter">
				<SharePoint:DelegateControl runat="server" ControlId="TreeViewAndDataSource">
				  <Template\_Controls>
					<SharePoint:SPHierarchyDataSourceControl
					 runat="server"
					 id="TreeViewDataSourceV4"
					 RootContextObject="Web"
					 IncludeDiscussionFolders="true"
					/>
					<SharePoint:SPRememberScroll runat="server" 
						id="TreeViewRememberScrollV4" 
						onscroll="javascript:_spRecordScrollPositions(this);" 
						style="overflow: auto;height: 400px;width: 155px; ">
					  <Sharepoint:SPTreeView
						id="WebTreeViewV4"
						runat="server"
						ShowLines="false"
						DataSourceId="TreeViewDataSourceV4"
						ExpandDepth="0"
						SelectedNodeStyle-CssClass="ms-tvselected"
						NodeStyle-CssClass="ms-navitem"
						SkipLinkText=""
						NodeIndent="12"
						ExpandImageUrl="/_layouts/images/tvclosed.png"
						ExpandImageUrlRtl="/_layouts/images/tvclosedrtl.png"
						CollapseImageUrl="/_layouts/images/tvopen.png"
						CollapseImageUrlRtl="/_layouts/images/tvopenrtl.png"
						NoExpandImageUrl="/_layouts/images/tvblank.gif"
					  >
					  </Sharepoint:SPTreeView>
					</Sharepoint:SPRememberScroll>
				  </Template_Controls>
				</SharePoint:DelegateControl>
			  </div>
		</Sharepoint:SPNavigationManager>
	</ContentTemplate>
</SharePoint:UIVersionedContent>

and paste it before:

read more
  • ««
  • «
  • 33
  • 34
  • 35
  • 36
  • 37
  • »
  • »»
© CHUVASH.eu 2026