This question is answered.


Permlink Replies: 11 - Pages: 1 - Last Post: 16-Feb-2020 00:38 Last Post By: jGromit Threads: [ Previous | Next ]
bleraillez

Posts: 33
Registered: 17-May-2009
How to create a link to a search?
Posted: 07-Feb-2020 21:09
 
  Click to reply to this thread Reply
Hi,

I'm working on my family site (soon over 10.000 photos) organized by decade. The only way to find a person is to search first name AND last name but most users won't know how to do this. To be honest, I only typed first_name last_name for a while and only got the OR results.

1. So I decided to try to create somewhere a list of each of the members with their picture and first + last name (that are image keywords) and this image links to a search request like:
http://www.mysite.com/myFamillyHistory/firstname%20and%20lastname

2. Same idea to have links to pages with only the last name.

Since I have pictures of my great-great-great-grand fathers and mothers I have some faraway cousins that may like to see their side only.

Is there a way to do this?

3. Next step if I can do this. Since my folders are organized 1890, 1900, 1910... can I set up searches that are limited to images in those folders?

And when you open a folder you have:
Search family 1
Search family 2
Search family 3
...
followed by all the images in the decade's folder.

4. Then in each family page
firstname1
firstname2
...

This would enable me to allow family members to see, as they want, everyone in a decade, every person when ever, every family whenever... it would offer a progressive filtering. A bit like some shops where you have many pop-up lists to filter the selection.

N.B. I know it's a lot of questions* from me, but I've been using jAlbum since 2009 and never, never, went in this web site type. And I expect that I'm going far away from jAlbum's main goal. I'd like to know how far I've gone, how far I can go, and where? ;)

*Don't worry I have a lot of others that I'm trying to solve myself with reading the manuals and testing, learning, testing...

Thanks a lot for we already have that works, I know it: I use it.

jGromit

Posts: 7,784
Registered: 31-Jan-2006
Re: How to create a link to a search?
Posted: 07-Feb-2020 21:42   in response to: bleraillez in response to: bleraillez
 
  Click to reply to this thread Reply
Just did a little tinkering with this. I'm assuming you're using Tiger. It appears that the Tiger standard for a search result page is in the form: https://username.jalbum.net/albumname/#search=searchterm

So, I built a little test album: (demo album removed)

Then I did a couple of searches on that album, and copied the URL's. The first search was for "milky," which will find the image of the Milky Way Galaxy. The second search was for "sombrero and galaxy," to find the image of the Sombrero Galaxy, but not the other galaxies in the album.

Now for the fun part. I created a new album consisting of just the searches. I added two web locations to the album, plugging in those search URL's. I then gave them readable titles.

Here's the result: (demo album removed)

I just let it grab the folder image as the thumbnail for both - you could use any image you like, of course.

One catch - you can't add the web locations to your basic album. They have to be in a separate album. Why? Because otherwise, the search will find the "search" web locations! Hard to explain, but it ends up being a circular reference problem. The "milky" search result would return both the Milky Way image and the "milky search" web location. You'll know the problem if you see it. ;)
bleraillez

Posts: 33
Registered: 17-May-2009
Re: How to create a link to a search?
Posted: 08-Feb-2020 15:07   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
jGromit wrote:

One catch - you can't add the web locations to your basic album. They have to be in a separate album. Why? Because otherwise, the search will find the "search" web locations! Hard to explain, but it ends up being a circular reference problem. The "milky" search result would return both the Milky Way image and the "milky search" web location. You'll know the problem if you see it. ;)


Ok, thanks a lot,

But I'm lost by one thing: my searches are limited to image keywords I think, if they don't have keywords, why would they appear in their own result list? The images have a name (1234.jpg) and keywords, nothing else. The searches would be names of people searched for example:

  • Picture of FirstName LastName
  • Option 1: Name/text on the web page: FirstName LastName
  • Option 2: The person's name is an image
  • Link: http://www.mysite.com/family/#search=FirstName%20AND%20LastName
  • Keywords empty or, why not, just "search" which would enable me to have a "Search" page containing all the prepared searches.

Otherwise, I really have to have a http://www.mysite.com/search site with just one page containing those links?

N.B. Since there will be close to a hundred of persons, just a list of names in two columns would be great. But I don't know how to do this with jAlbum. I have a few hours or days of reading the manual, jAlbum being able to do so many things but have a AND search by default. ;)

jGromit

Posts: 7,784
Registered: 31-Jan-2006
Re: How to create a link to a search?
Posted: 08-Feb-2020 15:59   in response to: bleraillez in response to: bleraillez
 
  Click to reply to this thread Reply
Yes, if you restrict the search to keywords, then the search wouldn't find the "search results" web location, unless you were foolish enough to add keywords to those web locations!

If, instead of using web locations, you wanted to build a "lookup page" with a list of names, that would, indeed, require some basic HTML and CSS skills. I can't think of any jAlbum skin that would build it for you. But the code would be truly simple, since you're not trying to do anything fancy, like adding images, or making the page responsive.

You would use the routine to add a new page to the album, but since there's no template available to make what you want, you'd have to add it as an empty page, and code it yourself - right-click, New page, Empty page, double-click to edit it.

I'll do some tinkering later, and post back with what I come up with.
bleraillez

Posts: 33
Registered: 17-May-2009
Re: How to create a link to a search?
Posted: 08-Feb-2020 16:34   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
Found how:

1. Create a folder for each search

2. Name the folder with the search criteria (that's called working on user interface

3. Edit folder and give it a link to the search (#search=...). Just the search link, no need to write the complete http://www.mysite.com/myAlbum/#search=...

A folder is not part of a search result.

Now a question : is it possible to display smaller icons in that particular part of the site?

N.B. #search=item1%20AND%2item2 does not work #search=item1%20and%2item2 does
jGromit

Posts: 7,784
Registered: 31-Jan-2006
Re: How to create a link to a search?
Posted: 08-Feb-2020 16:39   in response to: bleraillez in response to: bleraillez
 
  Click to reply to this thread Reply
Sounds somewhat overly-elaborate, and maybe very labor-intensive to maintain.

And watch out using relative URL's. Depending upon how you have things set up, that might throw you some curves. Fine if you're accessing the search from within the same folder level, but otherwise not.

And yes, I stumbled on the AND versus and anomaly, which surprised me. ;)
jGromit

Posts: 7,784
Registered: 31-Jan-2006
Re: How to create a link to a search?
Posted: 08-Feb-2020 17:43   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
A quickly-assembled demo:

https://jgromit.jalbum.net/searchpage/

Click on the Name Search at the top, then choose something like Crater(s), which will grab images from multiple folders. Works from the folder levels, too.
jGromit

Posts: 7,784
Registered: 31-Jan-2006
Re: How to create a link to a search?
Posted: 08-Feb-2020 20:01   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
Here's the quick rundown of that test album. I added a new page and renamed it from New page.htt to Name Search.htt. Double-click it, and here's the coding for the page:
<ja:include page="page-header.inc" />
<div class="searchrow">
	<div class="searchcolumn">
		<h2>Search Terms</h2>
		<p><a href='index.html#search=Storm Storms'>Storm(s)</a>
		<p><a href='index.html#search=Seasons'>Seasons</a>
		<p><a href='index.html#search=Crater Craters'>Crater(s)</a>
		<p><a href='index.html#search=Aurora Auroras'>Aurora(s)</a>
		<p><a href='index.html#search=Red and Spot'>Red Spot</a>
	</div>
	<div class="searchcolumn">
		<h2>Search Terms</h2>
		<p>More searches....
	</div>
</div>
<ja:include page="page-footer.inc" />
Notice that the links don't have to be encoded. In fact, for obscure reasons, they shouldn't be (it louses up the title of the results box, oddly).

Then it needs some styling, so under Tiger > Site > Custom code > CSS, enter this:
.searchrow {
	display: flex;
}
.searchrow p {
	line-height: 1.0;
}
.searchcolumn {
	flex: 50%;
}
.searchcolumn h2 {
	padding-bottom: 10px;
}


Edited by: jGromit on 08-Feb-2020 14:25 - fighting with the forum software's formatting.
bleraillez

Posts: 33
Registered: 17-May-2009
Re: How to create a link to a search?
Posted: 09-Feb-2020 14:26   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
jGromit wrote:
Sounds somewhat overly-elaborate, and maybe very labor-intensive to maintain.
If I understand correctly what you say it's a great + for me see below.
And watch out using relative URL's. Depending upon how you have things set up, that might throw you some curves. Fine if you're accessing the search from within the same folder level, but otherwise not.
The relative url problem, means that if have a folder #search=lastname and I create in it a folder with #search=firstname I would get the results of a #search=lastname%20and%20firstname?

If so it would be great since it means I can copy folders with the same first name, or especially copy year folders (1910, 1920...) in all the folders that need them.

Otherwise, one thing great about what I'm doing is that in the top bar people can do direct searches from a dropdown menu. (I don't yet know what it will look like when I have many root folders)

And yes, I stumbled on the AND versus and anomaly, which surprised me. ;)
It tool me a while to figure it out :) It's a bit unfriendly since it's easier to find spelling mistakes in #search=lastame%20AND%20andré rather than lastame%20and%20andré. Because I do spelling mistakes ;)
jGromit

Posts: 7,784
Registered: 31-Jan-2006
Re: How to create a link to a search?
Posted: 09-Feb-2020 14:36   in response to: bleraillez in response to: bleraillez
 
  Click to reply to this thread Reply
I think my solution is perhaps better for users. They can search for "Joe Blow" anywhere in the album, not just in the current folder.

No drop-down menu, but that's one of those "solutions" that album creators love, but site visitors, not so much. It gets especially nasty if there are more choices than fit on the visitor's screen, and is annoying on a touch device.

And it's easier to maintain. There's just one page that you have to update with search terms. Since the search terms don't have to be encoded, it's easier to read.

BTW, in my scheme, you do need index.html#search=Joe and Blow, rather than just #search=Joe and Blow. Otherwise, it would be searching in Name Search.html. ;)

In any event, you now have at least two different ways of tackling the problem.
bleraillez

Posts: 33
Registered: 17-May-2009
Re: How to create a link to a search?
Posted: 09-Feb-2020 22:56   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
jGromit wrote:
Here's the quick rundown of that test album. I added a new page and renamed it from New page.htt to Name Search.htt. Double-click it, and here's the coding for the page:

You're going way beyond my capacities. Since visitors will only search for family and family members, drop down menus are easier and always present in every page of the site (except images of course).

There is one problem though: clicking on the previous folder arrow brings you back to home.
jGromit

Posts: 7,784
Registered: 31-Jan-2006
Re: How to create a link to a search?
Posted: 09-Feb-2020 23:04   in response to: bleraillez in response to: bleraillez
Correct
  Click to reply to this thread Reply
bleraillez wrote:
You're going way beyond my capacities.

You can just copy and paste. No skills required.

...drop down menus are easier....

If you think so, go ahead and use that approach.

There is one problem though: clicking on the previous folder arrow brings you back to home.

When you're on an added page, that's a "home" arrow. It doesn't have any idea where you just came from.
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums