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.

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.

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Display results based on a custom field


Go to End


1677 Views

Avatar
neogin

Community Member, 13 Posts

11 August 2009 at 9:57pm

Edited: 11/08/2009 10:01pm

Hi guys,

first of all I'm new to SS and english is not my mother-tongue so please excuse my mistakes.

So, I'm making a website with different scientific articles by different authors. So far here's my structure for the article part (photo8). As you can see the article have a classic structure but I added the custom field "theme".

I used that structure because I wanted to be able to display for each author an "Author page" wich display all his publications. Then I used the <%Control Children%> to display the publications. It works great.

But now I would like to create a page for each theme displaying the relevant publications. As the author can enter more than one theme in the $theme, my idea was to use a sort of custom search based on the content of the $theme, and display the result.

For example, Author 1 writes a publication and in the theme part he writes " Biology Lasers " 'cause the subject is about about biology and lasers. Author 2 writes a publication about biology so he write in the theme part " Biology ".
To be able to display in one page the list of publications about biology, I though that the simpliest solution was to display on the theme:biology page the result of a search that searches all the articles which $theme contains "Biology" so it would display the publication from Author 1 and 2 .

But so far I havent been able to set the code for that kind of search, that searches only in one designated field.

Do you have any idea ?

Best,
gautier

Attached Files