<?xml version="1.0"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Forum posts to 'Archive'</title>
		<link>http://www.silverstripe.org/archive/rss</link>
		<atom:link href="http://www.silverstripe.org/archive/rss" rel="self" type="application/rss+xml" />
		<description></description>

		
		<item>
			<title>Re: Search Widget - Cannot Access More Information than $Title and $Link</title>
			<link>http://www.silverstripe.org/archive/show/156102?start=0#post160441</link>
			<description>&lt;p&gt;Hmm thats strange.. is the $Date a field of type 'Date'?&lt;/p&gt;&lt;br&gt;&lt;br&gt;Posted to: Search Widget - Cannot Access More Information than $Title and $Link &lt;a href=&quot;http://www.silverstripe.org/archive/show/156102?start=0#post160441&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/archive/reply/156102?start=0#post160441&quot;&gt;Post Reply&lt;/a&gt;</description>
			<pubDate>Thu, 04 Sep 2008 10:40:35 +1200</pubDate>
			<dc:creator>willr</dc:creator>
			<guid>http://www.silverstripe.org/archive/show/156102?start=0#post160441</guid>
		</item>
		
		<item>
			<title>Re: Search Widget - Cannot Access More Information than $Title and $Link</title>
			<link>http://www.silverstripe.org/archive/show/156102?start=0#post160396</link>
			<description>&lt;p&gt;Hi,&lt;/p&gt;&lt;p&gt;I got this all sorted out and am getting the fieelds I need from the BlogEntry table.  Thanks a lot for your help.&lt;/p&gt;&lt;p&gt;One more thing, though-- how come I can't perform a Long() on the Date??  When I say, &quot;$Date.Long&quot; or &quot;.Nice&quot; in the template, the Date disappears.&lt;/p&gt;&lt;p&gt;//Garrett&lt;/p&gt;&lt;br&gt;&lt;br&gt;Posted to: Search Widget - Cannot Access More Information than $Title and $Link &lt;a href=&quot;http://www.silverstripe.org/archive/show/156102?start=0#post160396&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/archive/reply/156102?start=0#post160396&quot;&gt;Post Reply&lt;/a&gt;</description>
			<pubDate>Thu, 04 Sep 2008 08:39:11 +1200</pubDate>
			<dc:creator>Garrett</dc:creator>
			<guid>http://www.silverstripe.org/archive/show/156102?start=0#post160396</guid>
		</item>
		
		<item>
			<title>Re: Search Widget - Cannot Access More Information than $Title and $Link</title>
			<link>http://www.silverstripe.org/archive/show/156102?start=0#post159513</link>
			<description>&lt;p&gt;I have an update to this issue.  I am now accessing the BlogInfo variable from within the template; however the $result-&amp;gt;ID is returning the ID of the BlogHOLDER instead of the Blog Entries themselves, so the ID's never match up.  This is a weird one, as my query works fine in the Query Browser.&lt;/p&gt;&lt;p&gt;Here is the results() function, modified:&lt;/p&gt;&lt;p&gt;function results($data, $form) {&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$data = array(&lt;br /&gt;        &amp;nbsp;&amp;nbsp;&amp;nbsp;'Results' =&amp;gt; $form-&amp;gt;getResults(),&lt;br /&gt;         &amp;nbsp;&amp;nbsp;&amp;nbsp;'Query' =&amp;gt; $form-&amp;gt;getSearchQuery(),&lt;br /&gt;         &amp;nbsp;&amp;nbsp;&amp;nbsp;'Title' =&amp;gt; 'Search Results'&lt;br /&gt;      &amp;nbsp;&amp;nbsp;&amp;nbsp;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$results = $this-&amp;gt;customise($data);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;foreach($results as $result) { &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$result-&amp;gt;BlogInfo = $this-&amp;gt;BlogPostInfo($result-&amp;gt;ID);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$results = $results-&amp;gt;renderWith(array('Page_results', 'Page'));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return $results;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/p&gt;&lt;br&gt;&lt;br&gt;Posted to: Search Widget - Cannot Access More Information than $Title and $Link &lt;a href=&quot;http://www.silverstripe.org/archive/show/156102?start=0#post159513&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/archive/reply/156102?start=0#post159513&quot;&gt;Post Reply&lt;/a&gt;</description>
			<pubDate>Wed, 03 Sep 2008 03:26:20 +1200</pubDate>
			<dc:creator>Garrett</dc:creator>
			<guid>http://www.silverstripe.org/archive/show/156102?start=0#post159513</guid>
		</item>
		
		<item>
			<title>Re: Search Widget - Cannot Access More Information than $Title and $Link</title>
			<link>http://www.silverstripe.org/archive/show/156102?start=0#post159490</link>
			<description>&lt;p&gt;Can't thank you enough for your help, willr.  Tremendous.  This makes good sense.  However, I am confused by your use of &quot;BlogInfo&quot;, as this appears nowhere in my code.  My function is called BlogPostInfo().  Is this some other variable you are inventing?  Also, where should the BlogPostInfo() function actually LIVE?  The same place that GenericDataAdmin.php (that's where Results() is) or in Page.php, or...?&lt;/p&gt;&lt;p&gt;Thanks again,&lt;br /&gt;Garrett&lt;/p&gt;&lt;br&gt;&lt;br&gt;Posted to: Search Widget - Cannot Access More Information than $Title and $Link &lt;a href=&quot;http://www.silverstripe.org/archive/show/156102?start=0#post159490&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/archive/reply/156102?start=0#post159490&quot;&gt;Post Reply&lt;/a&gt;</description>
			<pubDate>Wed, 03 Sep 2008 02:38:53 +1200</pubDate>
			<dc:creator>Garrett</dc:creator>
			<guid>http://www.silverstripe.org/archive/show/156102?start=0#post159490</guid>
		</item>
		
		<item>
			<title>Re: Search Widget - Cannot Access More Information than $Title and $Link</title>
			<link>http://www.silverstripe.org/archive/show/156102?start=0#post157067</link>
			<description>&lt;p&gt;SSViewer cannot handle passing Variables such as $ID, $Title to a function. It just doesnt work  &lt;img src='http://www.silverstripe.org/sapphire/images/smilies/sad.gif'&gt; . What you have to do is find the Results() method on your search and in that (I dont know what it looks like) but you would need to do something like this (add this at the end of the method, before it gets returned)&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;function Results()&lt;br /&gt;...&lt;br /&gt;..&lt;br /&gt;// before you return the list of results attach the blog info&lt;br /&gt;foreach($results as $result) {&lt;br /&gt;$result-&amp;gt;BlogInfo = $this-&amp;gt;BlogPostInfo($result-&amp;gt;ID);&lt;br /&gt;}&lt;br /&gt;return $results.&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;Then in the template you just need to do &amp;lt;% if BlogInfo %&amp;gt;&amp;lt;% control BlogInfo %&amp;gt;.....&lt;/p&gt;&lt;br&gt;&lt;br&gt;Posted to: Search Widget - Cannot Access More Information than $Title and $Link &lt;a href=&quot;http://www.silverstripe.org/archive/show/156102?start=0#post157067&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/archive/reply/156102?start=0#post157067&quot;&gt;Post Reply&lt;/a&gt;</description>
			<pubDate>Sat, 30 Aug 2008 11:13:19 +1200</pubDate>
			<dc:creator>willr</dc:creator>
			<guid>http://www.silverstripe.org/archive/show/156102?start=0#post157067</guid>
		</item>
		
		<item>
			<title>Re: Search Results - Get Data from Other Tables Using ID</title>
			<link>http://www.silverstripe.org/archive/show/156102?start=0#post156962</link>
			<description>&lt;p&gt;Hello again,&lt;/p&gt;&lt;p&gt;I have not received any response to my previous post so I thought I'd be more specific as to my issue.  In Page_results.ss, the template used to display the search results, I would like to be able to display more information on the pages found than just the title.&lt;/p&gt;&lt;p&gt;I want to pass the SiteTree ID from inside the &amp;lt;% control Results %&amp;gt; loop to a function which takes that ID and gets the other fields from the BlogEntry table:&lt;/p&gt;&lt;p&gt;function BlogPostInfo($identifier) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$results = new DataObjectSet();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$blog_posts = DB::query(&quot;SELECT * FROM BlogEntry, SiteTree WHERE BlogEntry.ID = SiteTree.ID AND BlogEntry.ID = '&quot;. $identifier .&quot;'&quot;); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;foreach($blog_posts as $sqlResult) {&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$Author  = $sqlResult['Author'];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$Date    = $sqlResult['Date'];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$Tags    = $sqlResult['Tags'];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$results-&amp;gt;push(new ArrayData(array(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&quot;Author&quot;  =&amp;gt; $Author,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&quot;Date&quot;    =&amp;gt; $Date,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&quot;Tags&quot;    =&amp;gt; $Tags&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return $results;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/p&gt;&lt;p&gt;So, inside my &amp;lt;% control Results %&amp;gt; loop, I have this:&lt;/p&gt;&lt;p&gt;&amp;lt;% control BlogPostInfo(ID) %&amp;gt;&lt;/p&gt;&lt;p&gt;Aaaaaand nothing happens!  What am I doing wrong here? How can this sort of thing be achieved?  Surely I should be able to get the other fields from a Page in the Results list, no?&lt;/p&gt;&lt;p&gt;Thanks again,&lt;br /&gt;Garrett&lt;/p&gt;&lt;br&gt;&lt;br&gt;Posted to: Search Widget - Cannot Access More Information than $Title and $Link &lt;a href=&quot;http://www.silverstripe.org/archive/show/156102?start=0#post156962&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/archive/reply/156102?start=0#post156962&quot;&gt;Post Reply&lt;/a&gt;</description>
			<pubDate>Sat, 30 Aug 2008 07:20:39 +1200</pubDate>
			<dc:creator>Garrett</dc:creator>
			<guid>http://www.silverstripe.org/archive/show/156102?start=0#post156962</guid>
		</item>
		
		<item>
			<title>Search Widget - Cannot Access More Information than $Title and $Link</title>
			<link>http://www.silverstripe.org/archive/show/156102#post156102</link>
			<description>&lt;p&gt;Hi,&lt;/p&gt;&lt;p&gt;I am trying to use the built-in Silverstripe Search widget to search my Blog only.  So I have turned off the &quot;Show in Search&quot; checkbox on all objects in my CMS except for Blog Entries, and that works fine.&lt;/p&gt;&lt;p&gt;However, I cannot refer to variables which are specific to Blog Entries when displaying my Search Results.  I can only access $Title and $Link.  I would also like to include other information such as $ParagraphSummary, $Author, $Date, etc. etc. much like on the Blog landing page.&lt;/p&gt;&lt;p&gt;How can I achieve this?  Is this because my SearchForm() is defined in Page.php instead of BlogHolder.php?  &lt;/p&gt;&lt;p&gt;Any help offered would be greatly appreciated.&lt;/p&gt;&lt;p&gt;Thanks,&lt;br /&gt;Garrett&lt;/p&gt;&lt;br&gt;&lt;br&gt;Posted to: Search Widget - Cannot Access More Information than $Title and $Link &lt;a href=&quot;http://www.silverstripe.org/archive/show/156102#post156102&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/archive/show/156102#post156102&quot;&gt;Post Reply&lt;/a&gt;</description>
			<pubDate>Fri, 29 Aug 2008 06:07:07 +1200</pubDate>
			<dc:creator>Garrett</dc:creator>
			<guid>http://www.silverstripe.org/archive/show/156102#post156102</guid>
		</item>
		

	</channel>
</rss>