1
rosytoes
how to i change what's in a smarty tag?
  • 2005/10/15 18:21

  • rosytoes

  • Just popping in

  • Posts: 24

  • Since: 2005/10/9


for example, in my news index page, the tag <{$story.title}> gives me Antivirus : Norton Antivirus. How do I separate out the name of the category so that I can use it on it's own and <{$story.title}> only gives me Norton Antivirus?

2
smdcom
Re: how to i change whats in a smarty tag?

In news module, you've to edit index.php. Search for:

$story['title'] = $sarray[$i]->textlink().' : '.".XOOPS_URL."/modules/news/article.php?storyid=".$sarray[$i]->storyid()."'>".$sarray[$i]->title()."";


And change to:

$story['title'] = ".XOOPS_URL."/modules/news/article.php?storyid=".$sarray[$i]->storyid()."'>".$sarray[$i]->title()."";



Good Luck!

SMD

3
rosytoes
Re: how to i change whats in a smarty tag?
  • 2005/10/15 20:31

  • rosytoes

  • Just popping in

  • Posts: 24

  • Since: 2005/10/9


i commented out this line to display story title without the topic title.
$story['title'] = $thisstory->textlink().' : '.$story['title'];

now i want to display the topic title above the topic description in news_index.html
<div style="text-align: center;"><{$topic_description}>div>

is there a smarty tag for the topic title?

4
smdcom
Re: how to i change whats in a smarty tag?

you can create it:

$story['categorytitle'] = $thisstory->textlink();
$story['topictitle'] = ".XOOPS_URL."/modules/news/article.php?storyid=".$sarray[$i]->storyid()."'>".$sarray[$i]->title()."";


then use <{$story.categorytitle}> & <{$story.topictitle}> in your db:news_index.html

SMD

5
rosytoes
Re: how to i change whats in a smarty tag?
  • 2005/10/15 20:44

  • rosytoes

  • Just popping in

  • Posts: 24

  • Since: 2005/10/9


thank you very much for your reply, I really appreciate it. without these answers i would have given up long time ago:)

6
rosytoes
Re: how to i change whats in a smarty tag?
  • 2005/10/15 20:56

  • rosytoes

  • Just popping in

  • Posts: 24

  • Since: 2005/10/9


i have added the code and there are no errors but the changes are not reflected. I went into templates news_index.html and added the category smarty tag but it is not showing up when i refresh the page. Do I need to do something else?

7
smdcom
Re: how to i change whats in a smarty tag?

Yes. Make sure your template is updated. Go to system -> preferences -> general settings -> Update module template .html files from themes/your theme/templates directory? = Yes.

Change back to No after finish.

SMD

8
rosytoes
Re: how to i change whats in a smarty tag?
  • 2005/10/15 21:12

  • rosytoes

  • Just popping in

  • Posts: 24

  • Since: 2005/10/9


hm, I've been editing the css files for the past few days and had it turned on all along. Just had a look at the setting, apparently it only affects templates under the theme directory, is that right? I am editing the news module/templates directory, is that why it is not updating?

9
JMorris
Re: how to i change whats in a smarty tag?
  • 2005/10/16 0:36

  • JMorris

  • XOOPS is my life!

  • Posts: 2722

  • Since: 2004/4/11


You should not edit module templates directly. There is a Template Set Manager built into XOOPS that allows you to clone and edit every template for every module on your site. There are numerous posts and FAQ entries regarding the differences between Templates and Themes and how to work with them. The following link should clarify the differences.

Link: What is a theme and what is a template?


Best Regards,

James
Insanity can be defined as "doing the same thing over and over and expecting different results."

Stupidity is not a crime. Therefore, you are free to go.

10
rosytoes
Re: how to i change whats in a smarty tag?
  • 2005/10/16 13:16

  • rosytoes

  • Just popping in

  • Posts: 24

  • Since: 2005/10/9


after I edited the template directly with my text editor, I found out that the changes were not saved. Then I edited it again using the template manager in XOOPS but the changes are still not reflected. I think I need to update the news module in order to insert the new template into the database. I have done that but I still can't get the category title to show up above the topic description. Here's what I have done:
I added this to /modules/news/index.php
$story['categorytitle'] = $thisstory->textlink();

and changes the template using the template manager
<{if $topic_description != ''}>
    <
div style="text-align: center;"><{$story.categorytitle}><{$topic_description}>div>
<{/if}>

I then updated the module but the output seems to ignore the smartytag.
Can anyone see what I am doing wrong?

Login

Who's Online

294 user(s) are online (146 user(s) are browsing Support Forums)


Members: 0


Guests: 294


more...

Donat-O-Meter

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

Latest GitHub Commits