<SOLVED> Default article title not displayed as link

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
Nik2004
Posts: 132
Joined: Mon 9. Aug 2004, 14:31
Location: Athens,Greece

<SOLVED> Default article title not displayed as link

Post by Nik2004 »

Since I upgraded from 1.1RC4 to 1.3.3, the titles and subtitles of the articles with "default" template (which are displayed with summary) are no more displayed as links. In the past, when a list of such articles was displayed (in a category), the article's title (and subtitle) was always a link. Since I upgraded, the title (and subtitle) is no more displayed as a link.

How can I correct this so that article title and subtitle can be links again??

I tried to edit conf.template_default.inc.php and change:

Code: Select all

$template_default["top_headline_before"]    = '<span class="articleList_tophead">';
$template_default["top_headline_after"]     = '</span>';
$template_default["top_subheadline_before"] = '<span class="articleList_topsubhead">';
$template_default["top_subheadline_after"]  = '</span>';
to:

Code: Select all

$template_default["top_headline_before"]    = '<span class="articleList_tophead"><a href="{ARTICLELINK}">';
$template_default["top_headline_after"]     = '</a></span>';
$template_default["top_subheadline_before"] = '<span class="articleList_topsubhead"><a href="{ARTICLELINK}">';
$template_default["top_subheadline_after"]  = '</a></span>';
But this didn't work either. Any help please?
Last edited by Nik2004 on Tue 29. May 2007, 10:15, edited 1 time in total.
User avatar
DeXXus
Posts: 2168
Joined: Fri 28. Nov 2003, 06:20
Location: USA - Florida

Post by DeXXus »

I'm not sure that I understand your question. It ~seems~ that every reference to {ARTICLELINK} in phpWCMS 1.3.3 ~is~ shown as a link (by default)

Code: Select all

"/include/inc_front/content/cnt8.article.inc.php"(61,84):		$content['alink']['alink_template'] .= '<!--TEASER_ENTRY_START//-->	<li><a href="{ARTICLELINK}">{TITLE}</a></li><!--TEASER_ENTRY_END//-->';

"/include/inc_front/content/cnt8.article.inc.php"(218,51):			$content['alink']['tr'][$key]	= str_replace('{ARTICLELINK}', 'index.php?aid='.$row['article_id'], $content['alink']['tr'][$key]);

"/template/inc_cntpart/articlesummary/list/sample.tmpl"(26,26):	[IMAGE]<div><a href="{ARTICLELINK}">{IMAGE}</a></div>[/IMAGE]

"/template/inc_cntpart/articlesummary/list/sample.tmpl"(34,20):	[MORE]<a href="{ARTICLELINK}">{MORE}</a>[/MORE]

"/template/inc_cntpart/teaser/teaser_block.html"(7,16):		<h3><a href="{ARTICLELINK}">{TITLE} &raquo;</a></h3>

"/template/inc_cntpart/teaser/teaser_block.html"(10,22):		{SUMMARY} <a href="{ARTICLELINK}">&raquo;</a></p>

"/template/inc_cntpart/teaser/teaser_template.html"(6,15):	<li><a href="{ARTICLELINK}">{TITLE}</a> {DATE:d. F Y:DE} 

"/template/inc_default/article_summary_list.tmpl"(4,25):		[ARTICLELINK]<a href="{ARTICLELINK}">[/ARTICLELINK]{IMAGE}[ARTICLELINK]</a>[/ARTICLELINK]

"/template/inc_default/article_summary_list.tmpl"(10,63):		[/SUMMARY][MORE]	<div class="phpwcmsArticleListMore"><a href="{ARTICLELINK}">{MORE}</a></div>[/MORE]

"/template/inc_default/teaser.tmpl"(5,15):				<li><a href="{ARTICLELINK}">{TITLE}</a></li>
If you mean {TITLE} ... you can (for example) edit whichever template you are using in a similar way to how it is done in

"/template/inc_default/teaser.tmpl"

Code: Select all

<!--TEASER_HEAD_START//-->
<ul{LINK_ARTICLE_CLASS}>
<!--TEASER_HEAD_END//-->
<!--TEASER_ENTRY_START//-->
	<li><a href="{ARTICLELINK}">{TITLE}</a></li>
<!--TEASER_ENTRY_END//-->
<!--TEASER_ENTRY_SPACER_START//-->

<!--TEASER_ENTRY_SPACER_END//-->
<!--TEASER_FOOTER_START//-->
</ul>
<!--TEASER_FOOTER_END//-->
http://www.phpwcms.de/forum/viewtopic.php?t=14479
http://www.phpwcms.de/forum/viewtopic.php?t=13928
Nik2004
Posts: 132
Joined: Mon 9. Aug 2004, 14:31
Location: Athens,Greece

Post by Nik2004 »

Hi DeXXus,

You are right in that {ARTICLELINK} is displayed always as a link, but this is not the problem. The problem is with the default article "template" (which is configured in conf.template_default.inc.php) under "// article listing with summary" section. The title and subtitle of the default article "template" SHOULD BE always displayed as links, WITHOUT the need of explicitly defining <a href="{ARTICLELINK}">. As I explained, using <a href="{ARTICLELINK}"> in conf.template_default.inc.php fails (the whole tag is ignored at rendering). It seems that {ARTICLELINK} cannot get parsed from conf.template_default.inc.php.

Before I upgrade, title was a link without me adding {ARTICLELINK}. After I upgraded, the title is never a link, even if I add {ARTICLELINK}. Why the behaviour has changed? And how can I change it back?

I cannot use your suggestion to use a custom article template (I already use some), because a large number of articles (hundreds of them) already use the default template, and I would have to change template settings to all of them (unless you know a good way to do it in batch mode rather than one by one, e.g. by running a query - as far as I know, the article template info is serialized/digitized in a db field and this method cannot be used). If there is some php script that would handle this change, that would be nice - it is beyond my programming abilities. Perhaps, now, that phpwcms is much more mature, such a tool will allow phpwcms users to disengage from the hard-coded built-in default template, so that, some time, sooner or later, Oliver has more freedom to switch to a template-based default article scheme rather than using hard-coded and conf.xxx.inc.php settings for this purpose, a combination that causes various difficulties.
User avatar
DeXXus
Posts: 2168
Joined: Fri 28. Nov 2003, 06:20
Location: USA - Florida

Post by DeXXus »

I think you misunderstood what I was pointing out. I didn't mean to suggest trying that in "conf.template_default.inc.php" but rather... where the article templating takes place, now. It's all in the "changelog.txt" file of your installation. It (article templating) changed and those articles links in my post above mentioned that. ;-)

Version 1.1RC4 was so long ago. Unfortunately, the old way appears to have been too inflexible (hard-coded) and the CMS has evolved many times with new features, such as improved menu structures, article pagination, content teaser functionality, ETC. that all use that article title in their functionality (so I'm ~presuming~ it can't be a LINK, by default).

I don't know what to tell you. If you cannot make the change in the appropriate new template, then perhaps someone else understands your problem better (or differently) and has a suggestion...Anyone?
Nik2004
Posts: 132
Joined: Mon 9. Aug 2004, 14:31
Location: Athens,Greece

Post by Nik2004 »

Thanks DeXXus.

I now see what you mean. So, default article templating has already been done (I hadn't realized)! A big thanks to OG. So, I assumed that it was where you described: "/template/inc_default/article_summary_list.tmpl" and I changed it as follows (to make title and subtitle links):

Code: Select all

[SPACE]<!-- space //-->[/SPACE]
<div class="phpwcmsArticleListEntry">
	[IMAGE]<div class="phpwcmsArticleListImage">
		[ARTICLELINK]<a href="{ARTICLELINK}">[/ARTICLELINK]{IMAGE}[ARTICLELINK]</a>[/ARTICLELINK]
		[CAPTION]<div class="phpwcmsArticleListImageCaption">{CAPTION}</div>[/CAPTION]
	</div>[/IMAGE]
	[TITLE]<span class="articleList_tophead">[ARTICLELINK]<a href="{ARTICLELINK}">[/ARTICLELINK]{TITLE}[ARTICLELINK]</a>[/ARTICLELINK]</span>[/TITLE]<br>
	[SUB]<span class="articleList_topsubhead">[ARTICLELINK]<a href="{ARTICLELINK}">[/ARTICLELINK]{SUB}[ARTICLELINK]</a>[/ARTICLELINK]</span>[/SUB]
	[SUMMARY]	<div>{SUMMARY}</div>[/SUMMARY]
[MORE]	<div align="right" class="phpwcmsArticleListMore"><a href="{ARTICLELINK}">{MORE}</a></div>[/MORE]<br><br>
</div>
It worked. Initially I had some FTP problems and the file changes were not uploaded correctly so I had some hard time to make it work.

Thank you.
User avatar
DeXXus
Posts: 2168
Joined: Fri 28. Nov 2003, 06:20
Location: USA - Florida

Post by DeXXus »

Great :D
Onward and upward !!
Post Reply