Alloy Search – URL

Hi Adam

I’ve run into a problem with the Alloy Blog Search stack.
I really enjoy working with Alloy 3.

Here’s my problem:

I have this webpage created with the Alloy Blog Stacks:
URL: https://dogshit.dk/blog

Steps:

  1. Searching in the Alloy Search Stack (it’s in the banner bottom right)

  2. Alloy shows a list of post with the search term.

  3. I click one of the links (let’s say I click the link ‘Kort om DogsHit’.

  4. I get the url: URL/kort-om-dogshit

  5. Then I make another search.

  6. I find a link to a new post on the search list – and click on it

  7. I get: URL/kort-om-dogshitforhandlere

The post doesn’t show when I click on the headline og read more button, because the url is wrong.

It’s: URL/kort-om-dogshitforhandlere
when it should be
URL/blog/forhandlere

It happens because Alloy adds (in this case) ‘forhandlere’ at the end of the last search.

Have I made a mistake somewhere in the setup somewhere?

Best,
DeFliGra

My guess is you’re showing the search bar on individual blog post pages, correct? If so that is why you’re getting compounding URLs. This is because you’re initiating a search from the original blog post instead of the main Posts List view. If you take a look at the Foundry Blog you’ll notice I use a conditional to have the search show only on the main Posts List view.

Hi Adam

That’s right – the Alloy Search stack is positioned in the header-banner image at the top of DogsHit Tips 🐾 Tricks 🐾 Regler – didn’t know it was a limitation of the Alloy Search stack. But it makes sense.

A ‘universal’ Alloy Search stack is on my wishlist for Alloy 4 :slightly_smiling_face:.

Thanx,
DeFliGra

1 Like

I’ve added this to my feature requests for Alloy. I believe the reason it works this way, if I can remember back to when I originally coded it, was because of the page scope and I didn’t want the user having to “link” the search stack to the blog page. I’ll have a re-think though on it when I am able. though.

1 Like