Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Template Questions

Highlight search query in the page title


Reply

4 Posts   594 Views

Avatar
bettencourt

24 June 2013 at 9:54am Community Member, 4 Posts

Hello,
I'm new to Silverstripe and i am trying to highlight the search results when the query string appears in the page title.
(I have managed to highlight the content text using ContextSummary and adding CSS for span.highlight)
How can this be done?
Thank you

Avatar
Webdoc

25 June 2013 at 8:49pm Community Member, 332 Posts

You can find your answer [url=http://www.ssbits.com/snippets/2011/pete-bacon-s-new-post-2/]here[/url]

-------------------------------------------------------------------------------------------
Arvixe Web Hosting / SilverStripe Community Liaison | Looking for quality [url=http://www.arvixe.com/preloaded_silverstripe_hosting/]SilverStripe Web Hosting[/url]? Look no further than [url=http://www.arvixe.com/]Arvixe Web Hosting[/url]!

Avatar
bettencourt

27 June 2013 at 7:24pm Community Member, 4 Posts

Thank you Webdoc,
but that page only highlights in the content part i want to also highlight the results in $Title. but ContextSummary doesn't work with title so maybe i have to add php code?

Avatar
bettencourt

30 June 2013 at 3:33am Community Member, 4 Posts

Solved using
$MenuTitle.XML.ContextSummary
$Title.XML.ContextSummary