Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How do I customize the search result page?

Matthew J. Horn
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 17, 2012

I've added custom headers and footers and just about everything else to our Confluence site, but I can't find where I would do this for the SERP (Search Engine Result Page). It picks up global styles just fine, but I want to add the header and footer at the very least. Any ideas? Thanks!

2 answers

0 votes
Matthew J. Horn
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 21, 2012

Well, to edit the layouts, I edited the Main Layout and Page Layout site layouts in the Administration's Layouts section. One big thing was that if you comment out too much stuff, and replace it with custom HTML/Velocity code, you might unintentionally hide important aspects of the rendered pages such as the login form on the login/logout page and the contents of the SERP.

One thing that I ran into multiple times is that no matter how careful I was with opening and closing DIV and #if/#else/#end blocks, there appear to be others that are added either higher up or lower down "the chain" of rendering pages. As a result, you have to be very careful when removing or replacing these sorts of enclosures otherwise you can "break" the engine and get runtime errors.

Because our site doesn't use sidebars, I was able to remove a large swath of the global layout (the entire section inside the "sidebar-container" div.

Also of note is that I removed the "assistive-skip-links" section, even though I'm not entirely sure what they do.

One word of caution. I made a change that prevented the login pages from rendering. Then I went to lunch. When I got back, of course, I could not edit the page again until I logged in again, which caused some problems (obviously). To fix this, I had to edit the DECORATOR table in the database and restore the value of the correct decorator's BODY field to a rolled-back version. The SPACEKEY in this table refers to the space, and when the value is "NULL", it refers to the global space (which I figured out by trial and error).

Anyway, these are just a couple of gotchas. Eventually got it working, but it would be so nice to have layout access to the SERPs and other pages, IMHO.

matt

0 votes
Azwandi Mohd Aris
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 18, 2012

Would it be sufficient to just do it in the Custom HTML configuration at http://YOURCONFLUENCE/admin/viewcustomhtml.action? You can insert custom HTML code at 'the end of the HEAD' or 'At end of the BODY'.

Matthew J. Horn
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 21, 2012

Turns out the easiest way to modify the SERP is to muck with the global layouts. Also turns out to be a little dangerous... :)

Joerg Bencke
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 21, 2012

So Matthew - what did you learn in Detail ?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events