"Tag" option in search doesn't link to content
Hi! I was trying to search for a recent post, and tried to search the "microscope" tag when I was coming up short on a keyword.
When selecting the "tag" option in the search menu, I see a list of hyperlinked research note titles.
When I clicked on the title, I was taken to the wiki creation page and prompted to create a new wiki for the first word in the title.
Clicking on a title DOES lead to a result if the first word or phrase in the title already exists as tag in our index (as with OTK).

Request: Can these results appear as they do with other options, as a gird featuring the header image, title and link to the note in question?
Hey @bronwen9, can we break this issue in two tasks?
- [x] Fix the hyperlinks - #3718
- [ ] Change the style of the search tags results list
The first one was a simple fix, but for the second one we will need @stefannibrasil! Can you help me understand how the gird featuring the header image, title and link is build here (Notes)?

Thanks for re-opening. I think the way to do this would be to use the same grid-based template at /app/views/notes/_notes.html.erb, most likely!
As long as it's passed the correct local variables, as in other views, this could be a good FTO issue!
Is someone working on this? Can I take it?
Sure, @narnt! Just assign the issue to yourself.
I stared working. How I can add more posts on my local machine to test styles?
I saw that results header differently aligns in notes and tags search. It happens because of two divs with container class, wrapping things on the tags search page. Maybe it should be better to remove the second wrapping container if it is not so necessary? Or manually remove paddings. I think it will look better.
Here are those containers
Here are screenshots with two containers and with one:
with two container
with one container

@milaaraujo @jywarren Please tell me what do you think about. And can you help me to understand how I can obtain images like on the notes search page? And how add more posts with images at a local machine to test styles?
aha - so i think you'll have to post on your own local copy, at http://localhost:3000/post (probably!) -- and attach an image. You may need to have imageMagick installed for this to work, but give it a try!
On Thu, Nov 1, 2018 at 9:03 AM narnt [email protected] wrote:
@milaaraujo https://github.com/milaaraujo @jywarren https://github.com/jywarren Please tell me what do you think about. And can you help me to understand how I can obtain images like on the notes search page? And how add more posts with images at a local machine to test styles?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/publiclab/plots2/issues/3707#issuecomment-435034054, or mute the thread https://github.com/notifications/unsubscribe-auth/AABfJ8XKoOtlhFq28Iw90M8J7dDTUbpUks5uqvD_gaJpZM4XtVX2 .
@jywarren when I post something on my local machine, I see approvement page, but I can't approve my post, so it doesn't appear at localhost. Maybe I have to create a superuser, like in Django? I'll search in RoR documentation.
It looks good! I don't now how to obtain the images... :confused:
ah, yes! you can log in as "admin" -- the password should be in /db/seeds.rb i think? the seed data is what your local copy is started up with. Hope this helps!
On Fri, Nov 2, 2018 at 3:29 AM narnt [email protected] wrote:
@jywarren https://github.com/jywarren when I post something on my local machine, I see approvement page, but I can't approve my post, so it doesn't appear at localhost. Maybe I have to create a superuser, like in Django? I'll search in RoR documentation.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/publiclab/plots2/issues/3707#issuecomment-435294372, or mute the thread https://github.com/notifications/unsubscribe-auth/AABfJ5-KADAOBPnWcTA8UxPqYi-sGIzkks5uq_RKgaJpZM4XtVX2 .
@jywarren thank you! Can somebody explain for me 46th liine in tag.rb? How it works? nodes = Node.where(nid: node_tag.collect(&:nid)) When I write tag.nodes I get Node::ActiveRecord. But tag.nodes.main_images raises error. But if I try to find node by tag.title, all goes well. But it doesn't look like nice code.
I obtained images, but I believe there is a better way to do it. Maybe someone can help me to find it.
Hi! @narnt -- I came here from your reference earlier today. I see you are trying to find the best way to obtain images? Can you elaborate so I can better understand what you mean? It would be helpful to see what your solution is vs what you are hoping to achieve.
@quinn-codes-synthesis thank you for waiting and sorry for long answer
First I looked at how it works on the note search page:
https://github.com/publiclab/plots2/blob/7db3b681bffbf4e6bc9abd281c7b62cd764113a9/app/views/notes/_notes.html.erb#L7 https://github.com/publiclab/plots2/blob/7db3b681bffbf4e6bc9abd281c7b62cd764113a9/app/views/notes/_notes.html.erb#L8 https://github.com/publiclab/plots2/blob/7db3b681bffbf4e6bc9abd281c7b62cd764113a9/app/views/notes/_notes.html.erb#L9
Tag hadn't main_image method, so I tried to find related node. Finding node by id didn't work, so I tried to make a method for obtain node for obtain an image: https://github.com/narnt/plots2/blob/8665a3c0d491ef74ba17a13990e740cf86fea429/app/models/tag.rb#L49 https://github.com/narnt/plots2/blob/8665a3c0d491ef74ba17a13990e740cf86fea429/app/models/tag.rb#L50 https://github.com/narnt/plots2/blob/8665a3c0d491ef74ba17a13990e740cf86fea429/app/models/tag.rb#L51
here is what I did in the tags view: https://github.com/narnt/plots2/blob/8665a3c0d491ef74ba17a13990e740cf86fea429/app/views/search/tags.html.erb#L11 https://github.com/narnt/plots2/blob/8665a3c0d491ef74ba17a13990e740cf86fea429/app/views/search/tags.html.erb#L12 https://github.com/narnt/plots2/blob/8665a3c0d491ef74ba17a13990e740cf86fea429/app/views/search/tags.html.erb#L13
I don't understand how tag model get other methods from node model, and how it can get main_image method
Hmm. I see you have used app/views/notes/_notes.html.erb for reference, but have you tried also looking at app/views/search/notes.html.erb and comparing it to app/views/search/tags.html.erb ? I suspect that may be the piece you're missing to solve this.
Hi! Circling around to this with an update. As we consolidate an approach to Search, we have highlighted this issue in: https://github.com/publiclab/plots2/issues/5708#issuecomment-491901862
In the new approach, typing in a search term will show you any exact match tags as well as related tags on all searches, and then clicking on any of those will show you all the content tagged with that tag. I hope this fulfills the original desire, for any more input on tag searches please join us on https://github.com/publiclab/plots2/issues/5708. Thanks!