Solved

How to include shared html in a sharepoint 2010 page

Posted on 2011-02-11
8
871 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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
 

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft SharePoint Foundation 2010 and Microsoft SharePoint Server 2010 do not offer the option to configure the location of the SharePoint diagnostic trace log files during installation.  This can, however, be configured through Central Administr…
Pimping Sharepoint 2007 without Server-Side Code Part 1 One of my biggest frustrations with Sharepoint 2007 in the corporate world is that while good-intentioned managers lock down the more interesting capabilities of Sharepoint programming in…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

820 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