Warning: Declaration of WarpMenuWalker::start_lvl(&$output, $depth) should be compatible with Walker_Nav_Menu::start_lvl(&$output, $depth = 0, $args = Array) in /home4/x15denis/public_html/wp-content/themes/yoo_nano2_wp/warp/systems/wordpress/helpers/system.php on line 678

Warning: Declaration of WarpMenuWalker::end_lvl(&$output, $depth) should be compatible with Walker_Nav_Menu::end_lvl(&$output, $depth = 0, $args = Array) in /home4/x15denis/public_html/wp-content/themes/yoo_nano2_wp/warp/systems/wordpress/helpers/system.php on line 678

Warning: Declaration of WarpMenuWalker::start_el(&$output, $item, $depth, $args) should be compatible with Walker_Nav_Menu::start_el(&$output, $item, $depth = 0, $args = Array, $id = 0) in /home4/x15denis/public_html/wp-content/themes/yoo_nano2_wp/warp/systems/wordpress/helpers/system.php on line 678

Warning: Declaration of WarpMenuWalker::end_el(&$output, $item, $depth) should be compatible with Walker_Nav_Menu::end_el(&$output, $item, $depth = 0, $args = Array) in /home4/x15denis/public_html/wp-content/themes/yoo_nano2_wp/warp/systems/wordpress/helpers/system.php on line 678
Denis Stadler – SharePoint & Dynamics CRM Consultant » div class noindex

Posts Tagged ‘div class noindex’

Hiding SharePoint Page Elements Based on the Currently Logged in User

Written by Denis Stadler on . Posted in Custom Development

You may get this business requirement in the one following scenarios:

– You want to exclude part of a page (for example static links in the Master Page) from being indexed by SharePoint Search
– Just hide page elements for a specific user

For the Search scenario in SharePoint 2010 there is the possibility of using a div with CSS class name equal to noindex for not having the content crawled, but this doesn’t work in MOSS 2007.

<div class=”noindex”>content no to be indexed</div>

SharePoint has a build in feature which filters content based on the security roles of the user: SPSecurityTrimmedControl.

But the is no class for content trimming based on the loged-in user account, and we will create it :). The advantage is that this should work both in SharePoint 2010 and MOSS 2007.

Phase 1: Development

The C# class doesn’t contain more than:

public class SPUserSecurityTrimmedControl : SPSecurityTrimmedControl

public string ExcludeUser
get; set;

protected override void Render(HtmlTextWriter output)
SPWeb site = SPContext.Current.Web;

if (site.CurrentUser.LoginName.ToLower() != ExcludeUser.Trim().ToLower())

Warning: Parameter 1 to W3_Plugin_TotalCache::ob_callback() expected to be a reference, value given in /home4/x15denis/public_html/wp-includes/functions.php on line 3208