How to add an application page to a site in SharePoint? - sharepoint

I am an experienced .NET Developer acting as interim SharePoint Developer, and am new to SharePoint. After determining that I need to go with an application page instead of a site page for a new project due to it's complexity and need of custom code behind. Before developing the entire solution, I wanted to tie up the loose ends of my understanding of application page deployments. I need to add this page as a URL on the left side of a Site Collection page (kind of like what happens when adding a subsite to a site page.) I have read about the modules, which seems extremely hacky to me. There must be a better way to develkop a custom page on top of SharePoint without the page being accessible to anyone on the entire site.
EDIT
The application I am wanting to develop on top of SharePoint exists purely for data entry and reporting purposes.

Have you considered using a Webpart?
With a visual webpart which is essencially a usercontrol wrapped in a webpart you can add as much complexity as you want and you also have code behind to hook to events etc.
The benefit of using a webpart is that you can then drop it on a page, and use all OOB sharepoint access controls.
You mention that you want to develop a data entry reporting app. So something you can do is to create a subsite. Look all access to modify pages except to owners. Create all your screens by adding pages to the subsite and dropping webparts on it with the logic you require for each screen.
Also make sure you deploy the werbparts via a web feature that only is activated in your subsite, this way the webparts are only available in that particular subsite.

Related

I want to implement SharePoint, but I want to design it my way

I am aware of a program called "SharePoint Designer 20xx), and I would like to know if any of you have modified the default master page to make it.. less confusing and more simplistic. Can this be however I want it or is there limitations?
I also found this:
http://www.expertsharepointconsulting.com/images/Blue%20Large.PNG
I would like to implement a design similar to this! If I were to download a "Free sharepoint master page", would this design only work for the main page of SharePoint? as in if I were to go from the newly added masterpage, to a page called "reports", would it be completely different? If so how can I get around this?
You can create customized masterpages whichever way you want. Usually you don't touch the default ones, specially because you can break some system pages with that. Just create new ones from them or from the minimum.master one.
As an example of a Sharepoint Website using a very customized master page I can point you to a publishing website project I was involved for a Portuguese company: http://www.ana.pt/en-US/Pages/Homepage.aspx
It's all Sharepoint 2010...and it is fully customized
You can of course use the same template for all pages, just have to set it on the root site and say that all sub sites inherit from it.
To achieve the level of design changes you see on that web site you have to build new master pages, page layouts, use JS, CSS and user controls (the website uses little to no web parts).
we don't use Sharepoint designer because that would mean the files becoming unghosted, which can be pain sometimes, and sharepoint designer is not a very good tool.
The way we do it is by implementing everything on visual studio and deploying it via WSP packages. This way everything stays ghosted on the file system. You can check an example here:
http://mihirsharepoint.wordpress.com/2012/11/23/creating-custom-master-page-in-visual-studio-and-deploy-it-to-the-sharepoint-site/

How can we change the complete look and feel of Sharepoint Portal?

by Default there are Themes, I don't Like those. How can I modify It completely and make a professional website. I have found same Questions on this blog but all for MOSS2007. I am working on Sharepoint 2010
The way I modify sharepoint, is as I do with almost every other CMS out there combined with the power of asp .Net (Remember that as CMS' go sharepoint is a poor solution if the only thing you want is a portal. Sharepoint is first and foremost a BI Solution).
When you edit your site in sharepoint designer (Site Action -> Edit in sharepoint designer) you can see a whole lot of options.
Here you can change the default masterpage to accomodate the look and feel of your site. You will do most of the hiding stuff here (those you don't want to be seen giving them the visibility=false attribute). Here you can also include a new CSS (place it in site assets) where you can override already existing css files.
From this point on, you will be able to add web pages to the site, that will conform to the masterpage, and thus you can use all the sharepoint power (web parts and even embedded html code) keeping the look and feel you have implemented on your master page.
So what you need to do is:
Modify master page in sharepoint designer
Add css files in site assets and include them in your masterpage
Add any other aspx pages or custom web parts that you will refer to in the sharepoint site
Create web pages with sharepoint assets, web parts or custom code
Enable anonymous access for the people you want to view your portal without authenticating (Bear in mind that there are some sharepoint controls that can only be viewed by logged in users)
There are multiple ways of customizing it.
My perfered way is CSS.
Add reference to a custom css in master page using feature
Modify the look and feel by modifying sharepoint out-of-box CSS
Following resources gives all the details of SharePoint 2010 css classes.
http://sp2010notes.wordpress.com/sharepoint-2010-css-chart/
http://sharepointexperience.com/csschart/csschart.html
I hope it helps.
Cheers.
Rajendra Shekhawat

Creating Dynamic Sitemap in SharePoint

I have developed a publishing portal in sharepoint.I have a requirement wherein I need to create sitemap for the entire web application.
This should be dynamic, in the sense, whenever we update the contents of any given page in our web application, it should be reflected immediately in the sitemap page. What are the possible ways to achieve this and which is the best possible solution considering the scalability and easy configuration?
Thank you.
If you don't want to use a custom webpart, you could use normal navigation list to create your sitemap and it is automatically updated. You only need to style it in a way to resemble some kind of sitemap.
Here are some links to get you started with customizing your navigation:
Custom Navigation in SharePoint - The Full Monty
How to: Customize Navigation
Also there is the portal site map which provides the data source for your custom menu. Just read up on custom navigation and stuff like PublishingNavigation:PortalSiteMapDataSource and SharePoint:AspMenu.
There is a nice PowerShell script to create a sitemap for SHarepoint 2010, if you want to submit your sitemap to Google: Generate A Sitemap For SharePoint 2010 Using PowerShell'.
You can also install and customize the SharePoint Web part ("Table of Contents") to your liking. Read up on it here...
Take a look at our ECS product, it is close to what you need
http://www.infowisesolutions.com/product.aspx?id=ECS
It was built as a system of cross site collection navigation, with security trimming and permissions inheritance between site collection.

SharePoint 2007 Publishing site with deep menu structure

I am a beginner in SharePoint and I need to create publishing site that will have multilevel menu. Requirement is that levels will not be fixed and that client should be able to add pages and customize menu.
If I am not mistaken pages can be created only in the first level under the site. I don't see something like folders concept. For the navigation purposes I can add heading and it will be shown as another level. If I need more levels I need to create sub sites.
Site
Page1
Page2
Heading
Page3
Is this correct?
Site
Page1
Page2
Sublevel_1
Page1_1
Sublevel_2
Page2_1
Sublevel_3
Page3_1
...
Can I do something like this without creating SharePoint sub sites ?
If I don't need I will skip writing some custom menu control or write custom SiteMapProvider. I will than need to write UI for managing navigation also.
EDIT:
I have managed to create Folder in Pages list and create (actually move) pages to that folder and even create sub folder but they are not showing on the menu not even in the navigation settings page. I can't approve folder, it is in pending status what ever I try.
I looks like this is not possible by the Andrew Connell: Subfolders are not Supported in the Pages Library in MOSS Publishing Sites
Out of the box, you can modify the navigation for a Publishing site manually.
I assume that you are after a more automated way to do this. Unfortunately, the way to modify the navigation for a PublishingWeb is through the object model and the PublishingWeb.CurrentNavigationNodes object, which would require a timer job or some other method to update as pages are edited/added/deleted.
This is non-trivial and you will still need to create a solution/feature package.
The other way is to create a custom navigation provider.
The issue with both of these options (aside from the actual coding and release) is caching the navigation structure. We have used the standard web cache for the object holding the navigation structure, but using the standard user browsing (i.e. the menu code itself) to kick of a refresh of the navigation is fraught with threading issues.
You can create multiple document libraries in a site and then put the pages in the various libraries. That way you wouldn't need to create sub-sites

Sharepoint: Web Part vs. ASP.NET User Control

When creating web parts for Sharepoint, is it better to create an actual web part, or is using and ASP.NET User Control (.ascx) just as good?
I already know how to create the user controls that I need, so it seems like the extra effort of creating a web part is just unnecessary leg work.
What are the advantages of using a web part over just creating and ASP.NET user control?
I am a big fan of user controls except for the simplest web parts. I create a webpart that instantiates and loads the user control. There are other tools out there that you can use to expose your user control, like smartpart, but I would suggest you wrap it up yourself, as it is a good learning experience. Once you have done it once, you basically have a template for any other webpart you want to create.
Good Luck!
A bare ASP.NET ascx control would have to be added to a custom layout page. This limits the utility of the control a little as it cannot be added "just anywhere".
Having a webpart gives the flexibility of the control being added to the site multiple times in different locations or even multiple times on the same page with different properties.
As has been mentioned it is good to use CreateChildControls() to create the controls in the webpart and it is not that much of a big deal to code and package a webpart into a solution, making it worth the extra effort.
Webparts are also able to accept connections from "filter" webparts on the same page, giving additional flexibility to webparts compared to hosting ascx controls on the site.
When it comes to editors using the site, it makes a lot of difference for them to be able to add a webpart compared to editing a page layout, publishing it and then creating pages based on that page layout, so from the perspective of a site editor, the difference in usability is really quite large.
I recommend going even further and coding your webpart to use an xslt file to display the contents and making the location of that xslt a configurable property of the webpart. This really adds to the flexibility of your control.
Look at the Dataview webpart to see how much can be done with the addition of custom rendering.

Resources