Is there an easy way to programmatically know if the current page is a site homepage from a webpart code behind?
I think this post might answer your question: https://stackoverflow.com/questions/1649833/replace-the-default-page-in-a-sharepoint-website
I think I've found the answer here: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spcontextpageinfo.iswebwelcomepage.aspx
I would recommend that you permit the homepage to tell your web part that it is a homepage. Add a parameter to the web part and allow it to be set in the Edit dialog.
Related
I am very new in SharePoint. I'm using SharePoint 2013.
As a title of question. I want t create a page layout contain 4 webparts. Now I want to show / hide each of those webpart base on a condition ?
How can I do that ?
Thank for any help.
Could you use audience targeting for this? I'm not sure if this feature was removed from web parts but I know you could do it In so 2007.
The other option is to edit your web parts code. Perform a check onload, if it's true let it run through the it's normal rendering process otherwise hide. I'm not aware of a way you can do it via the page unless you use Js which I'm not sure is possible. Would be a good idea to make this a configurable web part property in case the web part needs to be available to all at a later date.
Hope this helps
Cheers
Truez
I was wondering if someone has had a similar requirement before. What they want is a link that on the main site that would point to a different document contained within a document library every week. So week one it would be "document1.pdf" and week two it would be "document2.pdf" and so on. Is this possible for the navigation that is contained in the left hand side of a sharepoint site? Can a link be tied to a lookup? Any help would be appreciated!
You can create some redirect javascript within the Content Editor webpart. host it on a page and add a link to the page on the navigation.
This is by far the fastest way to get what you want.
Make sure to follow the advice here to be able to edit the page once you set the redirect.
I am using Orchard cms but set to home page check box is not visibe please anybody tell how to set my content page as home page.whether i want to add content types in page.please do this helpfull
Maybe you don't have the permission to set the home page.
As a side note, please try not to cross-post, and ask your questions either on Codeplex or here. You will get an answer either way.
You might need to add the common part or the routable part to your contentType.
When I create pages in a publishing site the pages are automatically added to the navigation.
What if I dont want certain pages to show on the navigation, how can I do that automatically/conditionally?
This blog post from Ton Stegeman should tell you everything you need to know. Look at PublishingWeb.ExcludeFromNavigation().
Remove them from the navigation using site settings?
For example, I have a MOSS publishing page where a user added a web part and I'm unable to remove that web part due to how the layout is rendered. I cant access the small drop down menu to "delete" the web part.
I know there is a ton of unpublished list views that exist and was wondering if we could get a comprehensive list of them here, and maybe find the one that will also solve my problem.
Hey for removing a webpart, you can just append the query string Contents=1 to the webpart page url.
i.e. "http://localhost/sites/SiteCollection/default.aspx?Contents=1" will show you the webpart maintenence page for the webpart page "http://localhost/sites/SiteCollection/default.aspx". Here you can remove the webparts.
From Heather Solomon's blog:
http://www.heathersolomon.com/blog/articles/sp07urls.aspx
Is there some way to make a wiki here?