How to customize snippet box to include timestamp (date) and url at top?

1 view
Skip to first unread message

Harish Chakravarthy

unread,
May 10, 2013, 12:52:36 PM5/10/13
to Google-Search-...@googlegroups.com

Hello Everyone,

Greetings.

How can the snippet box be modified to include timestamp (date) and url at the top when results are sort by relevance similar to google search results?

Cheers
Harish
@harishvc

Mathias Bierl

unread,
May 10, 2013, 2:39:09 PM5/10/13
to Google-Search-...@googlegroups.com
You just have to move the part for showing timestamp and url from end of snippet to the place where you want it inside the XSLT

John

unread,
May 13, 2013, 10:19:22 AM5/13/13
to Google-Search-...@googlegroups.com
The part you need is in this section of the xml:
  A single result (do not customize)  specifically this part of that template:   <!-- *** Snippet Box *** -->

Each of the parts of an individual result are in there.  Just grab the bit you want and place it where you need it.  Note that you are on your own when you do this.  Google does not support changes like this.
John

John

unread,
May 13, 2013, 10:27:28 AM5/13/13
to Google-Search-...@googlegroups.com
Rereading your post you may just be asking "how do I display the timestamp and url."
Here is how to turn on each of those, Just find these in the xml and set each to a 1 to get them to show.  If you are working with the Page Layout template instead,  there are check boxes to turn these on under the search results section

<xsl:variable name="show_res_snippet">1</xsl:variable>
<xsl:variable name="show_res_url">1</xsl:variable>
<xsl:variable name="show_res_size">1</xsl:variable>
<xsl:variable name="show_res_date">1</xsl:variable>
<xsl:variable name="show_res_cache">1</xsl:variable>

Harish Chakravarthy

unread,
May 14, 2013, 5:45:04 PM5/14/13
to Google-Search-...@googlegroups.com

Thanks Mathias & John. Much appreciated.
Reply all
Reply to author
Forward
0 new messages