[CLOSED, not solved] Search & News - error 404

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
User avatar
frankmanl
Power Poster
Power Poster
Posts: 425
Joined: Sat Jul 12, 2008 3:50 am

[CLOSED, not solved] Search & News - error 404

Post by frankmanl »

Default result template of Search module says

Code: Select all

  {* 
     You can also instantiate custom behaviour on a module by module basis by looking at
     the $entry->module and $entry->modulerecord fields in $entry 
      ie: {if $entry->module == 'News'}{News action='detail' article_id=$entry->modulerecord detailpage='News'} 
  *}
Using this gives a 404 error.
My result template:

Code: Select all

<h3>{$searchresultsfor} "{$phrase}"</h3>
{if $itemcount > 0}
<ul>
  {foreach from=$results item=entry}
  <li>
{if $entry->module == 'News'}
NEWS - {News action='detail' article_id=$entry->modulerecord detailpage='zoek'}  ({$entry->weight}%)
{else}
<a href="{$entry->url}">{$entry->urltxt}</a> ({$entry->weight}%)
{/if}
</li>
  {/foreach}
</ul>

<p>{$timetaken}: {$timetook}</p>
{else}
  <p><strong>{$noresultsfound}</strong></p>
{/if}


  {* 
     You can also instantiate custom behaviour on a module by module basis by looking at
     the $entry->module and $entry->modulerecord fields in $entry 
      ie: {if $entry->module == 'News'}{News action='detail' article_id=$entry->modulerecord detailpage='News'} 
  *}
What have I done wrong?

Frank

system info:


----------------------------------------------

Cms Version: 1.11.9

Installed Modules:

CMSMailer: 5.2.2
CMSPrinting: 1.0.5
FileManager: 1.4.3
MenuManager: 1.8.6
ModuleManager: 1.5.5
News: 2.13
Search: 1.7.11
ThemeManager: 1.1.8
TinyMCE: 2.9.12
Gallery: 1.6.1
GBFilePicker: 1.3.3
CGExtensions: 1.37.2
CGSmartImage: 1.13
MicroTiny: 1.2.5
AdvancedContent: 0.9.4.3


Config Information:

php_memory_limit:
process_whole_template:
max_upload_size: 50000000
url_rewriting: none
page_extension:
query_var: page
image_manipulation_prog: GD
auto_alias_content: true
locale:
default_encoding: utf-8
admin_encoding: utf-8
set_names: true


Php Information:

phpversion: 5.3.3
md5_function: Aan (Waar)
gd_version: 2
tempnam_function: Aan (Waar)
magic_quotes_runtime: Uit (Onwaar)
E_STRICT: 0
E_DEPRECATED: 8192
memory_limit: 128M
max_execution_time: 30
output_buffering: Aan
safe_mode: Uit (Onwaar)
file_uploads: Aan (Waar)
post_max_size: 32M
upload_max_filesize: 50M
session_save_path: /tmp (0777)
session_use_cookies: Aan (Waar)
xml_function: Aan (Waar)
xmlreader_class: Aan (Waar)

Aan (Waar) = True
Uit (Onwaar) = False



Server Information:

Server Api: cgi-fcgi
Server Db Type: MySQL (mysqli)
Server Db Version: 5.1.41
Server Db Grants: Er is een "GRAND ALL" permissie gevonden, alles lijkt in orde.
Server Time Diff: Geen tijdverschil aangetroffen


----------------------------------------------
Last edited by frankmanl on Sun Nov 10, 2013 3:38 am, edited 1 time in total.
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: Search & News - error 404

Post by Rolf »

- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
User avatar
frankmanl
Power Poster
Power Poster
Posts: 425
Joined: Sat Jul 12, 2008 3:50 am

Re: Search & News - error 404

Post by frankmanl »

Troubleshooting - news module - error 404
Error message
Opening a News detail or categorypage ends up with an error 404: page doesn't exist.

Solution
When using a detailpage for your detail view, it could be the detailpage is set to inactive in the listcontent, or perhaps it was renamed or removed.
1. Check the detailpage parameter in the News tag(s) {News detailpage='foo'}. Page alias "foo" must be present.
2. Also check the page setting in the News module adminpanel under the Options tab: "Default page to use for detail views"
• detailpage='zoek' does exist and is active (although not shown in menu)
• default detailpage for News is some other page, but changing it to 'zoek' does not resolve the problem; besides - News detailpage='foo' should override that, shouldn't it?

Search works alright when no news item is returned (try searching BBQ), but the error appears as soon as a news item is returned (try Vloeimans).

When I leave out the if-statement from search template:

Code: Select all

<ul>
  {foreach from=$results item=entry}
  <li>
<a href="{$entry->url}">{$entry->urltxt}</a> ({$entry->weight}%)
</li>
  {/foreach}
</ul>
all results are shown, but then I can't control the detail template for found News items (I use different templates for different News categories) - the default News detail template is always used.
Last edited by frankmanl on Thu Mar 13, 2014 1:59 pm, edited 1 time in total.
User avatar
frankmanl
Power Poster
Power Poster
Posts: 425
Joined: Sat Jul 12, 2008 3:50 am

Re: [CLOSED, not solved] Search & News - error 404

Post by frankmanl »

It's not the search module, it's the news module. I'll try to find out where exactly it goes wrong and then maybe open another topic.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3483
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: [CLOSED, not solved] Search & News - error 404

Post by velden »

It's a long shot but you could try to use

Code: Select all

...
{if $entry->module == 'News'}
NEWS - {cms_module module='News' action='detail' article_id=$entry->modulerecord detailpage='zoek'}  ({$entry->weight}%)
{else}
...
BTW: wouldn't this show the complete News details inside the search results? Or is that exactly what you're looking for?
Post Reply

Return to “Modules/Add-Ons”