xoops forums

wammes

Not too shy to talk
Posted on: 2010/7/14 19:27
wammes
wammes (Show more)
Not too shy to talk
Posts: 101
Since: 2002/1/3 1
#1

smarty variable <{$story.topic_title}> is not giving what I want

Hi all,


In template news_item.html of the news module I'd like to have a smarty variable with just the name of the category in it.
<{$story.topic_title}> now gives the category name with a hyperlink in it. I just want the category name with no "<a href..." html in it.

Can this be done without modifying the modules php files? Maybe with some smarty in the template?


Thanks

red_Slider

Quite a regular
Posted on: 2010/7/15 9:30
red_Slider
red_Slider (Show more)
Quite a regular
Posts: 248
Since: 2006/1/4 1
#2

Re: smarty variable <{$story.topic_title}> is not giving what I want

Yes ... as I remember:
U got this:
<td class="itemHead">
<
span class="itemTitle">
<
a href="<{$xoops_url}>/modules/news/index.php?storytopic=<{$story.topicid}>">                     
<{
$story.topic_title}> : <{$story.news_title}>                 </a>
</
span>
</
td>


and shoul be:
<td class="itemHead">                 
<
span class="itemTitle">                     <{$story.news_title}>                 
</
span>
</
td>


here U get all variables:
Quote:
* Template's variables : * @template_var string pagenav some links to navigate thru pages
* @template_var array story Contains all the information about the story
* Structure :
* @template_var int id Story's ID
* @template_var string posttime Story's date of publication
* @template_var string title A link to go and see all the articles in the same topic and the story's title
* @template_var string news_title Just the news title
* @template_var string topic_title Just the topic's title
* @template_var string text Defined as "The scoop"
* @template_var string poster A link to see the author's profil and his name or "Anonymous"
* @template_var int posterid Author's uid (or 0 if it's an anonymous or a user wich does not exist any more)
* @template_var string morelink Never used ???? May be it could be deleted
* @template_var string adminlink A link to Edit or Delete the story or a blank string if you are not the module's admin
* @template_var string topicid News topic's Id
* @template_var string topic_color Topic's color
* @template_var string imglink A link to go and see the topic of the story with the topic's picture (if it exists)
* @template_var string align Topic's image alignement
* @template_var int hits Story's counter of visits
* @template_var string mail_link A link (with a mailto) to email the story's URL to someone

wammes

Not too shy to talk
Posted on: 2010/9/6 20:44
wammes
wammes (Show more)
Not too shy to talk
Posts: 101
Since: 2002/1/3 1
#3

Re: smarty variable <{$story.topic_title}> is not giving what I want

Hi red_Slider!

Thank you for your detailed reply.

I guess we are using a different version of the news module.
<{$story.topic_title}>

gives
<a href='http://www.blah.com/modules/news/index.php?storytopic=1'>xoops</a>


It should just give "xoops" but I get the a href as extra :).

ghia

Community Support Member
Posted on: 2010/9/7 6:57
ghia
ghia (Show more)
Community Support Member
Posts: 4954
Since: 2008/7/3 1
#4

Re: smarty variable <{$story.topic_title}> is not giving what I want

And what is your version?

wammes

Not too shy to talk
Posted on: 2010/9/7 18:57
wammes
wammes (Show more)
Not too shy to talk
Posts: 101
Since: 2002/1/3 1
#5

Re: smarty variable <{$story.topic_title}> is not giving what I want

Hi,

I use the v1.63 news module.

ghia

Community Support Member
Posted on: 2010/9/8 3:09
ghia
ghia (Show more)
Community Support Member
Posts: 4954
Since: 2008/7/3 1
#6

Re: smarty variable <{$story.topic_title}> is not giving what I want

Use
<{$story.news_title}>

wammes

Not too shy to talk
Posted on: 2010/9/8 13:23
wammes
wammes (Show more)
Not too shy to talk
Posts: 101
Since: 2002/1/3 1
#7

Re: smarty variable <{$story.topic_title}> is not giving what I want

I just had a idea, and it worked. Smarty also has a option to strip the <a href:
<{$story.topic_title|strip_tags:false}>