Skip Navigation

[Closed] scroll down to element ID when displaying results on another page

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 5 replies, has 2 voices.

Last updated by Minesh 5 months ago.

Assisted by: Minesh.

Author
Posts
#2704415

Tell us what you are trying to do? I have the search form on one page and am showing the results on another page. When being directed to the results page, I would like it to scroll down the page to the area on the page that shows the results, designated by a unique ID. Right now the search results just open at the top of the page and so the end user needs to manually scroll down to find the information they require. I am using the following shortcode: [wpv-form-view name="agency-details" target_id="310"] and I tried adding the id to the target_id, turning it into: target_id=310#results but that didn't work.

Is there any documentation that you are following? I couldn't find any documentation to help me

Is there a similar example that we can see? I couldn't find this

What is the link to your site? This is a local site under development

#2704608

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

What if you try to add the following code to your view's "Custom JS" section and save your view:

jQuery( document ).ready(function() {
    jQuery('html, body').animate({ scrollTop: jQuery(".wpv-view-output").offset().top }, 'fast');
});

More info:
- https://toolset.com/course-lesson/adding-custom-javascript-to-views-templates-and-archives/#steps-for-adding-javascript-to-a-view

#2704687

Hi and thanks for the response.

Unfortunately, that doesn't appear to work and had no effect. I should also mention one other thing. On all the pages of the site, other than the one where the results are displayed, there is the search form. But there is also the search form on the page where the results are shown. Not sure if that makes any difference at all but thought I would mention it.

#2704820

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please share problem URL of your results page as well as admin access details and tell me where you added the code I shared.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2704884

Thanks for the reply. I discovered why the javascript you sent me didn't work. You had used a css class that doesn't exist. Once I changed that it did work. However, it still isn't working quite right and I might need to rethink this. When I submit the filter/search form from another page, it does scroll down to the results. However, when I land on the linked page that shows the results, plus intro text, banner image, etc. it immediately scrolls down to the results as well, which isn't what it wanted. I would only want it to scroll down to the results if the search/filter comes from another page.

#2704981

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Ok - can you please share admin access details and tell me from where I can perform search and let me review it.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

The topic ‘[Closed] scroll down to element ID when displaying results on another page’ is closed to new replies.