Hi,
I pass the username as parameter to some views and this works fine, example: hidden link
If somebody deletes the username like this: hidden link
the views returns the NOT FOUND message, and this is correct too.
But if somebody deletes the whole parameter, like this: hidden link
the views return misleading results (the first post found or all posts). Is there a way to control the parameter state, maybe returning the 404 page ? I tried to wrap the views in a conditional but I cannot find a suitable condition, any clue ? thanks
Regards
Nicola
Hello. Thank you for contacting the Toolset support.
What way you would like to go, we will have both solutions.
What if we display now results found message when there is no parameter available with the URL, will that work? if yes, could you please share screenshot of your edit view page?
Hello Minesh,
any solution would do, I can prepare a page that says something like "User not found" or anything. This is a description how it works: there is a classified page, user selects one ad. On the ad single page there is an indication about how many ads the same user has published, with a "See all of them" link. This link takes the user to the all-ads-of-on-user page passing the username in the URL (www.mysite.com/all-ads-of-on-user/?usr=johndoe) where there are three views:
- the first view writes the title: "All ads of user <username>"
- the second view counts the total number of ads and writes the subtitle: "N ads in total"
- the third view lists all N adds of the user <username>
Everything works fine unless the parameter is completely deleted. I tried the conditionals on Search Term you can see in the screenshot, but they don't work.
thanks
Could you please share problem URL and admin access details as well as access details for the frontend user for which the ads should be shows.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) 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.
As you can see with the page, I've added the two conditional blocks. The top (first) conditional block holds the view and it will only display view when there is URL param usr is available.
The second conditional block holds the "Fields and Text" block and will be called when there is no URL param usr available in the URL so we set the message there using the "Fields and Text" block.
Please check the following screenshot: hidden link