Search URL

I'm not sure if I've gone crazy or what it is, but when I search for something, lets say "red rocks" on my gallery, the URL stays at: /gallery/page/search/ (but gets the results) rather than something like /gallery/page/search/red-rocks which is what I want so I can copy the URL and distribute it, if need be.

If I type in /gallery/page/search/red-rocks manually into the URL, the results still show.

Not really sure what I'm doing wrong. Is it a mod_rewrite rule? Setting in zenphoto?

Any help much appreciated.

PS: just using the default theme.

Comments

  • When you type a search parameter into the form and press the search button the WEB site is submitting a form with the appropriate data. This data is not shown in the link. Submitting a form is the normal means of handling arbitrary data in WEB code.

    Once the data is known, links can be created to navigate. For instance for multiple page search results. So Zenphoto also knows how to interpret these URLs.

    If your criteria is simple then a link like the one you made will be perfectly acceptable. But understand that if you have constraints on the fields searched, etc. the link will by needs be more complicated.
  • Right, so the search isnt purely keywords, you can search via other means (tags, etc). A complicated link address doesn't really matter, it's more about being able to copy the URL and paste it to someone else to show what you've searched.

    How do I go about doing it?
  • acrylian Administrator, Developer
    If you look at the search options you will find that ZP's search can cover a lot of fields that you even can disable individually (the set fields even a vistor could, see the icon on standard themes's search form).

    There are basically two ways to get a "search by url":
    a) Create a dynamic album from the search
    b) Use consequently tags on the items so you can pass the tag url
  • If your search returns more than one page the pagination links will have the URL version of the search. So you can go to page 2 and copy the link for page 1.

    Otherwise you will simply have to learn how these URLs are created.
  • sbillard,

    I see what you mean. So, the search on page 2 does show the URL. It turns into something like:

    gallery/page/search/xxyyzz/2

    Why doesn't it show on page 1? Is it possible to display it on page one / if the search only finds one page of results?

    Average Joe isn't going to know that that's the way it works.

    Funnily enough, if I go to page 2, click back to page 1, the URL shows then as gallery/page/search/xxyyzz which is what I'm after.
  • Yeah, that is what I was trying to say.
  • Ok, so there is a way? Is it top secret? Not a mod_rewrite rule?
  • acrylian Administrator, Developer
    The search query is sent via POST so the search page doesn't know about what is requested until you arrive there. Therefore it cannot show in the url initially.
Sign In or Register to comment.