Solved

How to include shared html in a sharepoint 2010 page

Posted on 2011-02-11
8
836 Views
Last Modified: 2012-05-11
I know we should be doing this another way... IE, using Sharepoint's built-in navigation, but the powers that be want custom nav.  I'm so ignorant about Sharepoint that I don't even know what search terms to google!  So...

I am working on side navigation that's separate from top nav (that does use built-in sp nav). Top Nav has 6 sections. For each section above, there are 10 or so pages that all share the same side nav code.

The page layouts for each of the content pages have a RichHtmlField that we dump static html into for building the navigation. Instead of pasting a chunk of html into every page for every section (60ish pages) and the future hassle of editing each page when the menu changes, I'd like to populate this nav area with html from a single source for each section. Each chunk of code could come from a list or file. So there's be 6 files or 6 list items. Each holds the nav for the 10 pages of a section.

IE, All of section 1's pages would populate their nav section with section 1 nav html. All of section 2's pages would get section 2 nav html, etc.

I tried adding an iFrame pointing to a file for each section, but when the page loads, IE tries to download the html file instead of displaying it.

In the end, I want users to be able to edit each page, set the source file name or list record to grab the html nav code from and be done. Later, if the nav for a section changes, I modify the pertinent list item or file and boom, the nav for 10 pages is updated and we're done.

In other web publishing engines it's easy. In ColdFusion, just do a cfinclude.
0
Comment
Question by:grayforge
  • 5
  • 3
8 Comments
 

Author Comment

by:grayforge
ID: 34876845
BTW, this is using the Publishing Site, if that makes a difference.

Thanks!
Russ
0
 
LVL 17

Expert Comment

by:Andres Perales
ID: 34879603
You have the option to use Custom navigation with built in SharePoint.

When you go to a site collections site setting > Navigation  you will see the menus options.  The Top Nav bar is Global and the left side navigation is called Quick Launch.

You can add heading and links to both of them and then move them up or down as you need.

If you create a heading and leave out a url then you can create a link beneath it!  To create a sub item.

You can do the same with pages, create a page, and the move it under a heading.
0
 

Author Comment

by:grayforge
ID: 34879761
Thanks for the input... One of the requirements is that the left nav hilites the currently selected page in the nav list. Does the built-in navigation do this?

IE, if the left nav looks like this:
Page 1
Page 2
Page 3
Page 4

and the user selected page 3, the Page 3 item in the nav would be colored Orange instead of black.

Thanks!
Russ
0
 
LVL 17

Expert Comment

by:Andres Perales
ID: 34884384
Does not do it by default, but you can edit the tag for css style as well to make it do that!
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:grayforge
ID: 34892556
How would CSS know which page is loaded and so which menu item to hilite?
0
 
LVL 17

Expert Comment

by:Andres Perales
ID: 34893271
0
 

Accepted Solution

by:
grayforge earned 0 total points
ID: 34897984
I've researched how to hilite a particular menu item using just css and one way is to give the enclosing container of the menu structure a unique ID or class for every page. Then build the css to hilite based on specific enclosing container/list item combinations.

Alas, each page (it's a publishing site) has regions to add content to, but the body tag is set up in the master page. Will Sharepoint do something like this for an out of the box left nav? IE, give me enclosing region/list item combinations I can reference in CSS?

Again, what I'm really looking for is a way to simply include html from a file or list into each page by setting a filename or list ID in the web part/zone or whatever on a page by page level.

Thanks!
Russ
0
 

Author Closing Comment

by:grayforge
ID: 34959182
No solution for including html into a web part/zone added.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Summary In SharePoint 2010 it is easy to create custom color themes to jazz up a site. Theme colors can also be created in PowerPoint 2010 with a few clicks. But how do the chosen colors actually look in the SharePoint site? The attached PowerPoint…
The vision: A MegaMenu for a SharePoint portal home page The mission: Make it easy to maintain. Allow rich content and sub headers as well as standard links. Factor in frequent changes without involving developers or a lengthy Dev/Test/Prod rel…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now