Yup.. This is literally the next feature I'm going to add to ImageGallery. Thanks for the reminder.
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
Hi Uncle Cheese,
I've been trying to add the search functionality mentioned here:
http://silverstripe.org/all-other-modules/show/259512
I'm having trouble... the link function is not working.
This is what I am using on ImageGalleryAlbum.php & ImageGalleryItem.php:
public function Link()
{
return DataObject::get_one("ImageGalleryPage")->Link();
}
I would REALLY appreciate help. Thank You!
Felicia
What do you mean not working?
It is returning the wrong page. It is not unique for each result.
The title and content show up perfectly, but the link does not return correctly.
Here is an example:
http://66.147.242.166/~pascetti/workstations/SearchForm?Search=finishes&action_results=Search
I think you're misunderstanding how it works. In my example, as I remember, I had a DataObject that was a component of a page, so there was this lingering question of what would happen when a user clicked on it as a search result. The answer I came up with was to take you to its parent page, and skip down the page to it using a # in the url, e.g. /my-data-object-holder/#dataobject-123, where 123 was the ID of the dataobject.
In the case of an ImageGallery search, the ImageGalleryAlbum class already has a Link() method built in due to the way it is integrated in the ImageGallery as a faux "page." You're not getting unique results because every time that function runs it's doing the same thing. That function might as well be static the way you have it now.
I would just skip the Link() function all together. It's already built into the album class.
Okay, I still can't get it to work.
I know that there is a Link() function included in the ImageGalleryAlbum class, but it does not return the correct link.
Do I need to change the Page_results.ss page?
Right now $Link returns "mydomain.com//album/"
<% if Results %>
<ul id="SearchResults">
<% control Results %>
<li>
<% if MenuTitle %>
<h3><a class="searchResultHeader" href="$Link">$MenuTitle</a></h3>
<% else %>
<h3><a class="searchResultHeader" href="$Link">$Title</a></h3>
<% end_if %>
<% if Content %>
$Content.FirstParagraph(html)
<% end_if %>
<a class="readMoreLink" href="$Link" title="Read more about "{$Title}"">Read more about "{$Title}"...</a>
</li>
<% end_control %>
</ul>
<% else %>
<p>Sorry, your search query did not return any results.</p>
<% end_if %>
Thank you for your help. I really appreciate it.
I've tried to download the Image-Gallery several times, but I always get an Error. Then i've tried at the unstable trunk and after painfully downloading every single file, I get this Error by making a DB Rebuild:
<br >
<br >Fatal error: Class 'SortableDataObject' not found in /data/www70/wwwroot/image_gallery/_config.php on line 2
<br >
<br >I hope you can help me or tell when i will be able to download the full package. Thanks!<br >
<br >
Sorry, i solved the problem with the installation! Now it work really well. Sorry for asking before thinking :)
Do you have DataObjectManager and SWFUpload installed?