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   680 Views

Avatar
bettencourt

Community Member, 4 Posts

24 June 2013 at 9:54am

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

Community Member, 334 Posts

25 June 2013 at 8:49pm

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

Community Member, 4 Posts

27 June 2013 at 7:24pm

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

Community Member, 4 Posts

30 June 2013 at 3:33am

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