Search Result Link for Portfolio Items

Hi there, I was wondering if there was a way to override the search result link for portfolio items only so that it goes to the portfolio page and not the item itself? I’ve tried to add the link myself in my Search Result layout, by adding a link to the Title that has a condition to show for Portfolio results only.

Hello Shelley,

Thanks for writing in! Are you using the Pro theme? It is best that you go to Cornerstone > Layout Builder and create a custom archive layout. This is where you can have a custom and modified search result links that will be linked to the portfolio page.

And if you are using the X theme, perhaps, you will have to install a Child theme and modify some of the templates for the portfolio items.

Be advised that this is beyond the scope of our support under our Support Policy. If you are unfamiliar with code and resolving potential conflicts, you may select our One service for further assistance.

Best Regards.

Hi Ruenel,

I have the Pro theme and I have set up an Archive layout. I have a conditional Title for portfolio items that shows up in the Entry results. But I can’t get the portfolio link attached to that Title to go the portfolio page (https://ethp.ca/about-us/our-partners/) it will just link to the portfolio item - even though I set the link to the portfolio page in the layout (called Title - Partner in the outline view).

I’m happy to share login credentials if you like to see where I’ve went wrong, they are attached below - here is a link to the search results (https://ethp.ca/?s=woodgreen) a partner listing will be at the bottom of the list.

Hello Shelley,

The given password is not working for us. Please double-check.

In the meantime, since you are using the Layout Builder, you can have two separate Column elements. You will have to apply a condition on each Column element.


If the post type is a portfolio item, you will have to modify the link in the title and point it to the portfolio page.


If the post type is NOT a portfolio item, you can have the link to the post or page.

Best Regards.

Hi Ruenel,

So I have updated the secure note and tested it let me know if you have any issues logging in! The Layout I set up is called “Search Results”. So for this search results page it all shows in one column, I’d rather not have the results that are portfolio items appear in a different column (if I understood what you are saying correctly). I am using conditions on the Title, I have tried to modify the link for the Headline element by turning on the Link component under Setup and adding the URL to the portfolio page there but it doesn’t take - it will still pull the permalink of the portfolio item.

Hi Shelley,

What my colleague has suggested is to check if the Post Type of the result is Portfolio or not. If that is Portfolio, you need to change the link. I have investigated the page structure and you need to duplicate the Result element and set the condition for Portfolio as suggested by my colleague. I went ahead and set the same in the duplicate layout named Search Results (v01), you can check and replicate it to your main layout.

Thanks

Appreciate the clarification @tristup - I see how this would work now! But I would rather results be mixed in with the others instead separated out by type. I’ve found a plugin option that works for me for now but thanks for the assistance though!

You are most welcome Shelley.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.