Post link in news summary page not working as expected
Posted: Thu Aug 04, 2011 2:26 am
This is not a duplicate post, I was asked to provide most information, so here it is.
cmsms version: 1.9.4.2
url in question: http://thriplow.org.uk/cms/news.pc
I am trying to fix a problem where I click on the post title in news summary and it takes me back to the news summary page but shows the url of the clicked post link in the address bar.
I have been wrestling with this for 2 days and have been through most of the code to see if theres anything amiss, but still have this problem.
Here is the code:
Template:
Page:
News Summary Template:
News Detail Template:
Browse Summary Template:
Config.php (url section):
.htaccess:
---------------------------
I hope someone will be kind enough to check these out and hopefully figure out a solution to this problem.
If you require further information, please let me know.
cmsms version: 1.9.4.2
url in question: http://thriplow.org.uk/cms/news.pc
I am trying to fix a problem where I click on the post title in news summary and it takes me back to the news summary page but shows the url of the clicked post link in the address bar.
I have been wrestling with this for 2 days and have been through most of the code to see if theres anything amiss, but still have this problem.
Here is the code:
Template:
Code: Select all
{process_pagedata}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<__html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
{metadata}
{SEOTools}
{cms_stylesheet name='thriplowcss1'}
</head>
</__body>
<div id="fntresize">
{global_content name='fntresizer'}
</div>
<div id="main_container">
<div id="header">
</div>
</div>
<div id="lcol_container">
{global_content name='leftcolnews'}</div>
<div id="content_container">
<div id="rcol_container">
{global_content name='dwadnews'}</div>
<div id="content_frame" style="left: -2px; top: 5px">
<div id="navigation">
{global_content name='navigation'}</div>
<br />
<br />
<table cellpadding="0" cellspacing="0" class="centered_table" style="width: 98%">
<tr>
<td class="table_top_left"> </td>
<td class="table_top_middle"> </td>
<td class="table_top_right"> </td>
</tr>
<tr>
<td class="table_left_middle"> </td>
<td><div id="content">{content}</div></td>
<td class="table_right_middle"> </td>
</tr>
<tr>
<td class="table_bottom_left"> </td>
<td class="table_bottom_middle"> </td>
<td class="table_bottom_right"> </td>
</tr>
</table>
<br />
{global_content name='footer'}
</div>
</div>
<br />
<br />
<br />
<__body>
{capture}{content block="Thriplow Village Website" oneline="true"}{/capture}
</__html>
Code: Select all
{cms_module module="TruetypeText" style="Welcome" text="News"}<span class="text">{news browsecat="0" moretext="[ more ]" number="5"}</span>
Code: Select all
<!-- Start News Display Template -->
{if $pagecount > 1}
<p>
{if $pagenumber > 1}
{$firstpage} {$prevpage}
{/if}
{$pagetext} {$pagenumber} {$oftext} {$pagecount}
{if $pagenumber < $pagecount}
{$nextpage} {$lastpage}
{/if}
</p>
<br />
{/if}
{foreach from=$items item=entry}
<div id="bloginfo2">
<table cellpadding="2" style="width: 100%">
<tr>
<td colspan="4" class="posttitle2"><table><tr><td valign="top"><img src="/cms/images/newsicons/page_green.png" border=0></td><td><span class="text"><strong><a class="links3" href="{$entry->moreurl}" title="{$node.url}">{$entry->title|cms_escape}</a></strong></span></td></tr></table></td>
</tr>
<tr>
<td><span class="postby"><img src="/cms/images/newsicons/calendar_view_day.png" border=0> {$entry->postdate|cms_date_format:"%d"}-{$entry->postdate|cms_date_format:"%b"}-{$entry->postdate|cms_date_format:"%Y"}</span></td>
<td><img src="/cms/images/newsicons/tag_green.png" border=0> <span class="postby">{$entry->category}</span></td>
<td>{if $entry->author}<img src="/cms/images/newsicons/vcard.png" border=0> <span class="postby">{$entry->author}</span>
{/if}</td>
<td> </td>
</tr>
</table>
</div>
{if $entry->summary}
<div class="NewsSummarySummary"><br />
<table cellpadding="0" style="width: 95%;margin: 0 auto;">
<tr>
<td class="lbq" style="width: 1px" valign="bottom"> </td>
<td class="cbq" style="width: 100%">
<table cellpadding="10" style="width: 100%">
<tr>
<td class="summerycontent">{eval var=$entry->summary}<br /></td>
<td class="rbq" valign="top" style="width: 30px;height: 100%">{cms_module module="TruetypeText" style="quote" text="”"}</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div class="NewsSummaryMorelink">
<spam class="text">{$entry->morelink}</spam>
<br />
</div>
{else if $entry->content}
<div class="NewsSummaryContent">
<spam class="text">{eval var=$entry->content}</spam>
</div>
{/if}
{if isset($entry->extra)}
<div class="NewsSummaryExtra">
{eval var=$entry->extra}
{* {cms_module module='Uploads' mode='simpleurl' upload_id=$entry->extravalue} *}
</div>
{/if}
{if isset($entry->fields)}
{foreach from=$entry->fields item='field'}
<div class="NewsSummaryField">
{if $field->type == 'file'}
<img src="{$entry->file_location}/{$field->value}"/>
{else}
{$field->name}: {eval var=$field->value}
{/if}
</div>
{/foreach}
{/if}
<div id="hrline" style="align:center"> </div><br />
</div>
{/foreach}
{if $pagecount > 1}
<p>
{if $pagenumber > 1}
{$firstpage} {$prevpage}
{/if}
{$pagetext} {$pagenumber} {$oftext} {$pagecount}
{if $pagenumber < $pagecount}
{$nextpage} {$lastpage}
{/if}
</p>
{/if}
<!-- End News Display Template -->
Code: Select all
{* set a canonical variable that can be used in the head section if process_whole_template is false in the config.php *}
{if isset($entry->canonical)}
{assign var='canonical' value=$entry->canonical}
{/if}
<div id="bloginfo2">
<table cellpadding="2" style="width: 100%">
<tr>
<td colspan="4" class="posttitle2"><table><tr><td valign="top"><img src="/cms/images/newsicons/page_green.png" border=0></td><td><span class="text"><strong>{$entry->title|cms_escape}</strong></span></td></tr></table></td>
</tr>
<tr>
<td><span class="postby"><img src="/cms/images/newsicons/calendar_view_day.png" border=0> {$entry->postdate|cms_date_format:"%d"}-{$entry->postdate|cms_date_format:"%b"}-{$entry->postdate|cms_date_format:"%Y"}</span></td>
<td><img src="/cms/images/newsicons/tag_green.png" border=0> <span class="postby">{$entry->category}</span></td>
<td>{if $entry->author}<img src="/cms/images/newsicons/vcard.png" border=0> <span class="postby">{$entry->author}</span>
{/if}</td>
<td style="text-align: right">{cms_module module='PDFGenerator' src_img=" /cms/images/newsicons/page_white_acrobat.png" includetemplate="false" subsystem="mpdf"} {cms_module module='printing' showbutton="true"} <a href="email.pc" alt="Tell a friend" title="Tell a friend"><img src="/cms/images/newsicons/email.png" border=0 alt="Tell a friend"></a></td>
</tr>
</table>
</div>
{eval var=$entry->content}
<br />
<div id="hrline"></div>
<span class="text">{if $return_url != ""}
<img src="/cms/images/newsicons/page_go.png" border=0> {$return_url}{if $category_name != ''} - {$category_link}{/if}
{/if}</span><br />
<table><tr><td><img src="/cms/images/newsicons/comments_add.png" border=0> </td><td><span class="text">{cms_module module="Comments" modulename="News" pageid=$entry->id emailfield=1 websitefield=1}</span></td></tr></table>
<hr id="NewsPostDetailHorizRule" />
{if $entry->extra}
<div id="NewsPostDetailExtra">
{$extra_label} {$entry->extra}
</div>
{/if}
{if isset($entry->fields)}
{foreach from=$entry->fields item='field'}
<div class="NewsDetailField">
{if $field->type == 'file'}
{* this template assumes that every file uploaded is an image of some sort, because News doesn't distindguish *}
<img src="{$entry->file_location}/{$field->value}"/>
{else}
{$field->name}: {eval var=$field->value}
{/if}
</div>
{/foreach}
{/if}
Code: Select all
{if $count > 0}
<ul class="list1">
{foreach from=$cats item=node}
{if $node.depth > $node.prevdepth}
{repeat string="<ul>" times=$node.depth-$node.prevdepth}
{elseif $node.depth < $node.prevdepth}
{repeat string="</li></ul>" times=$node.prevdepth-$node.depth}
</li>
{elseif $node.index > 0}</li>
{/if}
<li class="newscategory">
{if $node.count > 0}
<a href="{$node.url}">{$node.news_category_name}</a> ({$node.count}){else}<span>{$node.news_category_name} (0)</span>{/if}
{/foreach}
{repeat string="</li></ul>" times=$node.depth-1}</li>
</ul>
{/if}
Code: Select all
#What type of URL rewriting should we be using for pretty URLs? Valid options are:
#'none', 'internal', and 'mod_rewrite'. 'internal' will not work with IIS some CGI
#configurations. 'mod_rewrite' requires proper apache configuration, a valid
#.htaccess file and most likely {metadata} in your page templates. For more
#information, see:
#http://wiki.cmsmadesimple.org/index.php/FAQ/Installation/Pretty_URLs#Pretty_URL.27s
$config['url_rewriting'] = 'mod_rewrite';
#Extension to use if you're using mod_rewrite for pretty URLs.
$config['page_extension'] = '.pc';
#If you're using the internal pretty url mechanism or mod_rewrite, would you like to
#show urls in their hierarchy? (ex. http://www.mysite.com/parent/parent/childpage)
$config['use_hierarchy'] = true;
#If using none of the above options, what should we be using for the query string
#variable? (ex. http://www.mysite.com/index.php?page=somecontent)
$config['query_var'] = 'page';
Code: Select all
ErrorDocument 404 /cms/index.php?page=error404
RemoveHandler .php
AddType application/php5-fcgi php
Action application/php5-fcgi /cgi-bin/php5fcgi.fcgi
<IfModule php5_module>
php_value include_path /ZendGdata
</IfModule>
# ------------------------
# BEGIN Optional settings
Options -Indexes
Options +FollowSymLinks
DirectoryIndex /cms/index.php
RewriteBase /cms
RewriteEngine on
# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
# except for form POSTS
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 ^(.+).pc$ index.php?page=$1 [QSA]
#RewriteRule ^cms/(.+)$ http://thriplow.org.uk/cms/$1 [R=301,L]
#RewriteCond %{HTTP_HOST} ^thriplow.org.uk$ [OR]
#RewriteCond %{HTTP_HOST} ^www.thriplow.org.uk$
# News Pretty URL Fix
#RewriteRule ^news/([^/][0-9]+)/([^/][0-9]+)/(.+)$ #index.php?mact=News,cntnt01,detail,0&cntnt01articleid=$1&cntnt01returnid=$2 [NC,L]
RewriteCond %{HTTP_HOST} ^thriplow.org.uk/cms$ [OR]
RewriteCond %{HTTP_HOST} ^www.thriplow.org.uk/cms$
RewriteRule ^news/category/([0-9]+)/(.+).htm index.php?mact=News,cntnt01,default,0&cntnt01detailpage=59&cntnt01category_id=$1&cntnt01ret#urnid=59 [NC,L]
I hope someone will be kind enough to check these out and hopefully figure out a solution to this problem.
If you require further information, please let me know.