The requirement is to make a megamenu show site image for the subsite.
For me who just learn about SharePoint, this task is so confusing and stressful..
While the task is still unfinished, it will keep haunted me I guess.. :P
But..
It finally can be done!!
After researching for so long.. Googling.. Trying lots of things..
It was so simple..
We need to create custom control that override the render for menu in SharePoint.
For those who still confuse how to override the render, the steps are like this:
1. Create a Sharepoint 2010 empty project, add new class
2. inside the class, we need to override the render so add code below:
public override void Render (xxx yyy -> I forgot)
{
// your code here
}
3. when override render, we need to iterate through the web within web application.
In my case, I need to find all the site and subsite within a web application.
So..
use SharePoint API (SPSite and its companion) to get all the site an subsite..
I use this because when I try to use the provider, it won't give me the image site.
the provider just give title and description, with url too.. It makes me stuck!!
When researching the answer, thought the hard one but the answer is so simple..
4. After we get the site and subsite, we need to render the css to apply the style (you have made the css before)
5. After render CSS, the navigation is done!
that's it.. Hopefully :D
Original post : Sharepoint 2010 Top Navigation Modification
No comments:
Post a Comment