1
CyberGuin
New Mod - Editing $story.title
  • 2007/7/10 16:30

  • CyberGuin

  • Just popping in

  • Posts: 36

  • Since: 2005/2/16


Hi,

I'm using the News mod and want to change the appearance of the title in the posts. I've tried this via the news_item.html template and via the article.php but with no success.

At the moment it shows <h2 class="title">TOPIC TITLE : News Title</h2>

I just want it to show <h2 class="title">News Title</h2>

The relevant code I can find is in the article.php

$xoopsOption['template_main'] = 'news_article.html';
include_once 
XOOPS_ROOT_PATH.'/header.php';

$story['id'] = $storyid;
$story['posttime'] = formatTimestamp($article->published(),$dateformat);
$story['news_title'] = $article->title();
[
b]$story['title'] = $article->textlink()."&nbsp;:&nbsp;".$article->title();[/b]
$story['topic_title'] = $article->textlink();


The code in the news_item.html is:

<td class="itemHead"><h2 class='title">[b]<{$story.title}>[/b]</h2></td


I've tried changing it to <{$story.news_title}> in the html template but that didn't work.

I've tried changing the article.php to
$story['title'] = $article->title();

but that didn't work either!

Help. You can see the relevant page at TopVA Demo

Thanks, Tracy

2
iHackCode
Re: New Mod - Editing $story.title

here is a link to another post, that could probably help.

don' t display topics in news

colon
CBB / LatestNews / Publisher / XM-Spotlight

(ノ◕ヮ◕)ノ*:・゚✧

3
CyberGuin
Re: New Mod - Editing $story.title
  • 2007/7/31 4:01

  • CyberGuin

  • Just popping in

  • Posts: 36

  • Since: 2005/2/16


Excellent, thank you!! It did the job brilliantly.

I now have a much bigger problem, in that I've transferred the site to another server and now the system module is completely missing from the control panel!! I have posted in the Beginners Forum... 'Starting a new... Missing System Module' - just in case you have any solutions to that one!!

Cheers,

Tracy

4
incama
Re: New Mod - Editing $story.title
  • 2007/7/31 7:52

  • incama

  • Friend of XOOPS

  • Posts: 513

  • Since: 2003/10/24


A better way is editing the news_item.html.
Use :
<{$story.news_title}>

for title only.

<{$story.topic_title}>

for topic.

Herve has put alot of nice smarty variables into the module, that even aren't active by default. Read the comments in the aricle.php file (of the news module) where he explains what variables you can use.
Webdesign
Sitting Ducks?!
I hate politics, give me a stylie instead...

Login

Who's Online

228 user(s) are online (144 user(s) are browsing Support Forums)


Members: 0


Guests: 228


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits