Search Breaks Album Themes

I recently realized that if you conduct a search and view one of the results it will make the theme for that album default from then on.

Any idea as to why?

I have say 5 variants of a theme and depending on the album, I use any one of them for the album. However if you view the album from a search result it will put the album theme back to default for the site.

Hpoe I have explained that well enough...

Thanks

Comments

  • acrylian Administrator, Developer
    Searches do not belong to an album, otherwise layouts would jump around with any album displayed.

    Please provide basic infos like what theme and what Zenphoto release.
  • There is a new feature in the nightly builds which would allow you to "theme" your search pages based on some criteria. It is called "multiple_layout".

    But I guess I really do not know what criteria you would make. A search can return items from multiple albums. Which theme would you select?
  • acrylian Administrator, Developer
    Actually the new multiple_layout plugin will not help as it does not cover normal custom pages like the search page is one directly. Only for the the real items like images, albums, Zenpage pages and categories.
  • acrylian Administrator, Developer
    My collegue sbillard accidentally posted his answer on another thread. I copied it over:
    acrlian is right, of course. But the technique used by this plugin could be applied to other pages. Basically it uses a filter to redirect the page load to something else.

    So you could register a filter for load_theme_script which would by some means determine what script to load for that instance of the search.

    The good news is that doing this does not require the development release as that filter exists already. Your filter would just make an algorithm of what script to load based on the search criteria and return the path to that script.
  • Basically what is happening is this....

    Every album of images can have a specific theme... Lets call it theme2 and lets say the core theme for the rest of the site is theme1.

    Lets say you do a search for bumblebees, all the resulting albums that match that search will have its predefined theme2 show up as theme1 from then on.

    The only way to fix it is to "edit the album" and resave the theme2 selection.
  • First of all, I am pretty sure your descripton is not correct. Or at least you are usign terminology different from what we are acustomed to.

    Album themes apply at only the root level, so every album of images cannot have a specific theme, only root albums can have a specific theme.

    Second, nothing in a theme changes Options. Since album themes are stored as options, doing a search cannot change the theme.

    So perhpas you would like to try again with your explaination.
  • ok.. first off yes root albums... I do not use subalbums...

    Doing a search most deffinately does change the selected theme for a resulting album from the seleted theme to to the zp core theme...

    It does not change the selected theme for the album in the options, however it does display the album from that point forward as the zp core theme instead of the predefined selected theme.

    It's like when you do a search the search results are displayed using the core theme, when you click an album to view from that search the album is also displayed in the core theme instead of being displayed as its selected theme, and will continue to be that way from then on unless I manually go in and resave the albums selected theme.

    I could absolutely show you on the site but it is an adult site.
  • acrylian Administrator, Developer
    Doing a search most deffinately does change the selected theme for a resulting album from the seleted theme to to the zp core theme...
    Of course it uses the core theme since you are not in any specific album but within search results.
  • Yes but if you click on the results you would be in a specific album and thats where the problem is. The specific albums selected theme is never shown again for that album.
  • acrylian Administrator, Developer
    If you click on a search result you are normally still in search result context.
  • Does that get cached for that album? Perhaps that is what is going on...

    If you view that album again not via search but through the typical way say via index or something it still displays the album with the core theme.

    Perhaps after being shown via a search it caches that album with the core theme for "x" amount of time?
  • Search context is stored in browser cookies. Unfortunately there is no way to tell if you link to an item from within the search or some other link that is somehow accessable to you while you are in the search context.
  • Search context is stored in browser cookies. Unfortunately there is no way to tell if you link to an item from within the search or some other link that is somehow accessable to you while you are in the search context.
  • Yup, I tested it all out, that is exactly what is happening.

    So there is nothing that can be added that would force it to check if albums have predefined themes?

    A php snipit perhaps?
  • You can clear the cookie. But of course knowing when to clear it is the problem since you would have to clear the cookie before any output is sent and before someone clicks on your link.

    The only other option I can think of is for the link you present to go to a script that clears the cookie then redirects to the album you want to link to.
Sign In or Register to comment.