I have a custom list named CompanyNews which contain these fields:
Title --> Free Text
Topic ---> choice which allow multiple selections
Where inside the custom list, we will be adding the pages titles such as "Home","CEO Message", etc.. and the related Topics.
Then we will add the web part to a page >> so the web part should get the current page title >> then query the custom list by matching the Page title with the list's Title field and get the Topics, then show the Topics inside the web part. if nothing matches to show nothing inside the web part.
Here is my code:
But currently when I add the web part to any page it will show all the topics regardless of the page title.
Any advice?