Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

Unable to apply custom css to search results page

$
0
0

In my Sharepoint 2010 public site I need a page that will display search results.  I need to be able to customize the layout/look of this page.  Here are my issues:

Attempt 1: using a custom page layout

if I create a publishing page with Search Results webpart on it and select my custom page layout, then when I click Search on some html page that redirects to this custom publishing page, then I get prompted to log in even though this is a public site with anonymous access enabled.  I figured out that when I use an out-of-the-box page layout for this publishing page then I don't get prompted to log in.

Attempt 2:

I created a publishing page using of of the out-of-the-box page layouts.  Then, I clicked "disconnect from page layout".  So far everything works fine.  I am not prompted to log in when accessing this page via the browser.  Now I want to make some changes to this search results page (e.g. I don't want to see "recently modified" on the left).  I open this publishing page in Sharepoint Designer and try to add a link to my custom css file where I would have "display:none" for the "recently modified" section.  The problem is that the minute I save this file, Sharepoint inserts the following into this file:

<head>
<meta name="ProgId" content="SharePoint.WebPartPage.Document">
<meta name="WebPartPageExpansion" content="full">
</head>

And then when I try to access the page via the browser, I get:

"Only Content controls are allowed directly in a content page that contains Content controls"

One of the solutions I found online is to export this file, edit the file outside of Sharepoint by removing these extra lines Sharepoint added, and then import the file back to Sharepoint.  I tried that and it did not work.  I mean, the section at the top that got inserted is gone but that error

"Only Content controls are allowed directly in a content page that contains Content controls"

is still there.  It's just that it's complaining about some line further below:

Line 88: </SharePointWebControls:UIVersionedContent> Line 89: </asp:Content>Line 90: <ZoneTemplate></ZoneTemplate>

Does anybody have a solution to my problem: either suggestions for how to fix what I'm doing or how to achieve my goal of having a custom search results page where I have the Search Results webpart on a page but I can modify its look with custom css.  Thanks.


Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>