Page 1 of 1

After Search Links In News Results Are Broken

Posted: Wed Apr 13, 2016 9:29 am
by govicinity
CMS Made Simple™ 1.11.13 “Baquerizo Moreno”

Yes I know this is a slightly out of date version of the CMS, and is not currently supported, but I have a slightly odd query that shouldn't matter regarding the version itself.

On this website:http://www.met.uk.com
If I visit this page for instance which is a news page: http://www.met.uk.com/New-Equipment-for ... esting.php

The PDF links work perfectly as you'd expect (with this link http://www.met.uk.com/uploads/images/pd ... ckages.pdf), but... If I search in the top search box with the title of the news article "New Equipment for Vacuum Decay Testing", I get an issue once I navigate through the search results to effectively the same page.

This is the result I get after the search: http://www.met.uk.com/news/263 which would be fine, except you'll notice the PDFs now produce a 404 error, this is because of /news/ being added into the URL i.e. http://www.met.uk.com/news/uploads/imag ... ckages.pdf

If anyone can shed any light on this for me I'd be grateful, I'm sure it's a really simple fix.

Re: After Search Links In News Results Are Broken

Posted: Wed Apr 13, 2016 11:31 am
by paulbaker
Try: Content > News > Options tab. Check if "Default page to use for detail views" has been set to a page, if not then set one. That might sort it.

Re: After Search Links In News Results Are Broken

Posted: Wed Apr 13, 2016 11:39 am
by govicinity
Hi Paul, yes that's all been setup for quite a while that way on this site, really odd, it only happens when you search for the page (using the page title in the search box etc) and then visit it through the search results, suddenly it seems to use hierarchy for the news article i.e. /news/ wheras getting to the news article the normal way does not, so it's looking for the PDF in:
/news/uploads/

not
/uploads/

where it should be thus breaking the file path.

Re: After Search Links In News Results Are Broken

Posted: Wed Apr 13, 2016 4:38 pm
by velden
You might be able to solve the problem by including a

Code: Select all

<base href="{root_url}/" />
in the <head> section of your PAGE template(s).

When using the {metadata} tag this base tag comes by default (unless explicitly disabled by an extra parameter)

Re: After Search Links In News Results Are Broken

Posted: Mon Apr 18, 2016 2:04 pm
by govicinity
Hi Velden, thanks for taking the time to reply, I popped that in, but to no avail, it for some reason still puts the /news/ in which still breaks the path to the uploads with the PDFs in it when you navigate to the news story through the search facility, the URLs stay the same as in the original post. Stumped me this one.

Re: After Search Links In News Results Are Broken

Posted: Mon Apr 18, 2016 8:53 pm
by velden
govicinity wrote:Hi Velden, thanks for taking the time to reply, I popped that in, but to no avail, it for some reason still puts the /news/ in which still breaks the path to the uploads with the PDFs in it when you navigate to the news story through the search facility, the URLs stay the same as in the original post. Stumped me this one.
There seems to be no '/news/ ' in the href of the specific links.

Code: Select all

<p>Details of a variety of seal testing methods are given in our '<a title="Test Sealed Packages" href="uploads/images/pdfs/Test-Sealed-Packages.pdf">How to leak test sealed packages</a>'   guide and our ‘<a title="Medical Device Leak Test Guide" href="uploads/images/pdfs/medical-device-leak-test-guide.pdf">Medical device leak test guide</a>’
I do NOT see the proper base tag in your example: http://www.met.uk.com/news/263

I'm pretty sure the base tech will solve this issue.

[SOLVED] Re: After Search Links In News Results Are Broken

Posted: Tue Apr 19, 2016 9:22 am
by govicinity
Velden you are a star, you are of course correct, The news and search used a different template I needed to add the base url to, I forgot I had two other templates seperate to the ones that used the meta tags in the global settings, bob on thanks, much appreciated.