Detail news view not working

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
Matio
Forum Members
Forum Members
Posts: 17
Joined: Sat Jul 14, 2007 2:54 pm

Detail news view not working

Post by Matio »

Hi, I have problem with showing details of news. When I click on the title of the news it's not showing the details, instead I'm only redirected to the returnid site (so basically where I was before). I can see, that the URL has been generated well - like this: http://www.site.com/news/296/15/News-post-title, but I'm not getting to news details (although address bar in browser shows right URL too). I need the details page, because I have comments there.

I'm using mod_rewrite for pretty URL, and it works for content pages, but not for news items. I used to switch off hierarchy to disable pretty URLs for news, but since CMSMS version 1.8, that is not supported anymore, so now I can't add comments at all.

This is how I call news Smarty tag:

Code: Select all

 {news number="5" detailpage="home"}
My setup:
  • CMSMS 1.8
  • News Module 2.10.6
  • PHP 5.2.6-1+lenny8
  • MySQL 5.0.87
.htaccess file

Code: Select all

# Attempt to override some php settings, these settings may be helpful on some hosts if your
# default configuration does not meet CMS's minimum requirements, and your host
# has given your account appropriate permissions
#php_value upload_max_filesize "10M"
#php_value session_save_path "tmp/cache"

#php_flag magic_quotes_gpc Off
#php_flag register_globals Off
#php_flag session.use_trans_sid Off

# (this is important, so uncomment if your host permit)
#Options -Indexes
#ServerSignature Off
#
#Options +FollowSymLinks
#
<IfModule mod_rewrite.c>
RewriteEngine on
#
#Sub-dir e.g: /cmsms
RewriteBase /

#
# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
# but ignore POST requests.
#RewriteCond %{REQUEST_URI} !/$
#RewriteCond %{REQUEST_URI} !\.
#RewriteCond %{REQUEST_METHOD} !POST$
#RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]

# Rewrites urls in the form of /parent/child/
# but only rewrites if the requested URL is not a file or directory
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
</IfModule>
You can see the behavior live, here on my site: http://www.simpsonovci.com/

Thank you,
Matio
Last edited by Matio on Mon Jul 05, 2010 9:32 pm, edited 1 time in total.
Jos
Support Guru
Support Guru
Posts: 4019
Joined: Wed Sep 05, 2007 8:03 pm
Location: The Netherlands

Re: Detail news view not working

Post by Jos »

Is the {content} tag present in the template that is used for "home"?
Matio
Forum Members
Forum Members
Posts: 17
Joined: Sat Jul 14, 2007 2:54 pm

Re: Detail news view not working

Post by Matio »

Yes, in the template I'm using, I have it like this:

Code: Select all

header
.
.
{content}
.
.
footer
And than I have page called "home", where I'm calling the news tag.
maranc
Forum Members
Forum Members
Posts: 249
Joined: Tue May 04, 2010 5:04 pm

Re: Detail news view not working

Post by maranc »

My friend, I thing it's problem with summary template.... so better will be to show code of this template...

Marek A.
Matio
Forum Members
Forum Members
Posts: 17
Joined: Sat Jul 14, 2007 2:54 pm

Re: Detail news view not working

Post by Matio »

Ok here is my summary template:

Code: Select all

{foreach from=$items item=entry}
<div class="NewsSummary">

<div class="oddelovac">
<h3>{$entry->titlelink}</h3></div>
<div class="news-footer"><strong>Pridal:</strong> {$entry->author}  | {$entry->postdate|cms_date_format:"%d. %m %Y, %H:%M "} | <a href="{$entry->link}">Diskusia ({count_news_comments theid=$entry->id})</a></div>

{if $entry->summary}
	<div>
		{eval var=$entry->summary}
	</div>

{else if $entry->content}

	<div>
		{eval var=$entry->content}
	</div>
{/if}
<div style="float: left; margin-left: 10px;"><__iframe src="http://www.facebook.com/widgets/like.php?href={$entry->link}" scrolling="no" frameborder="0" style="border:none; width:450px; height:30px"></__iframe></div>

</div>
<hr />
{/foreach}
{if $pagecount > 1}
<p align="center"><strong>

{if $pagenumber > 1}
{$firstpage} {$prevpage} 
{/if}
{$pagetext} {$pagenumber} {$oftext} {$pagecount}
{if $pagenumber < $pagecount}
 {$nextpage} {$lastpage}
{/if}
</strong>
</p>
{/if}
I also tried to use the default summary template, but it doesn't work as well.
Jeff
Power Poster
Power Poster
Posts: 961
Joined: Mon Jan 21, 2008 5:51 pm
Location: MI

Re: Detail news view not working

Post by Jeff »

It is more than likely a problem with the main template for the page.

You said have this template with {content} in it, and then I have the page home.

Sounds like for home you are using a different template, or am I reading to much into it.
Matio
Forum Members
Forum Members
Posts: 17
Joined: Sat Jul 14, 2007 2:54 pm

Re: Detail news view not working

Post by Matio »

Dr.CSS: I didn't call detailpage in my news tag initially. It doesn't work with or without the detailpage attribute.

ajprog: I created one template with {content} tag in it, and then I created lot of pages, where I put content (images, text, HTML tags) or at this home page, I'm calling {news} tag. So basically news are showing just like I want them, but I can't access the link provided by {$entry->titlelink}.
maranc
Forum Members
Forum Members
Posts: 249
Joined: Tue May 04, 2010 5:04 pm

Re: Detail news view not working

Post by maranc »

Hi, I created summary template with your code and:
1. I have this notice:
"string(148) "Smarty error: [in module_db_tpl:News;summarytest line 6]: syntax error: unrecognized tag 'count_news_comments' (Smarty_Compiler.class.php, line 590)"

2. Title link works for me... When I click on title I see detail (but I didn't use parameter "detailpage"). So - maybe problem is with detail template?

Did you try use default link in sample summary template:

moreurl}" title="{$entry->title|cms_escape:htmlall}">{$entry->title|cms_escape}

Marek A.
Matio
Forum Members
Forum Members
Posts: 17
Joined: Sat Jul 14, 2007 2:54 pm

Re: Detail news view not working

Post by Matio »

1) This tag 'count_news_comments' is my User defined tag for counting comments.

2) Your suggested link does exactly the same thing, I have just tried it.

Anyway, thanks for help.

I also tried turing off "mod_rewrite" and then I'm able to access the detail page, but I don't get pretty URL then...
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: Detail news view not working

Post by Rolf »

Hi Matio,

This is a known problem, I'm trying to reproduce it for many months now.
At the moment I think it isn't CMSMS related.
It is something in the combination excisting database and the database settings.
But I don't know what yet...  :-\
I think if you install a new cmsms in a subfolder on the same server, and use the same database (with f.e. prefix test_) it will work fine... It did with one of my sites.

a. Excisting files and database >> Fails
b. New install in subfolder on the same server and in the same database (test_) >> Works
c. Excisting files with new database >> Works
d. New files with excisting database >> Fails

Reïnstalling the News module will probably fix the problem, don't know how many articles you have at the moment.

I have nothing more to offer at the moment...

grtz. Rolf  :-\
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
Matio
Forum Members
Forum Members
Posts: 17
Joined: Sat Jul 14, 2007 2:54 pm

Re: Detail news view not working

Post by Matio »

Thank you for this information Rolph!

I guess I could reinstall the module, but I have like 300 news right now. I'm going to try to reinstall it and then use SQL dump for the news_module table.
Matio
Forum Members
Forum Members
Posts: 17
Joined: Sat Jul 14, 2007 2:54 pm

Re: Detail news view not working

Post by Matio »

I tried reinstalling the news (uninstall and install again) and everything was deleted. So I imported SQL dump to get back to where I was. Still no success  :'(
Post Reply

Return to “Modules/Add-Ons”