1
snow77
Show news topic in news_index.html template
  • 2007/5/15 3:06

  • snow77

  • Just can't stay away

  • Posts: 864

  • Since: 2003/7/23


I want to show the news topic in the news_index.html template, and have it show the topic name as headline when a topic is clicked on and all the articles of that topic are listed.

But I have a problem. It won't show. When I write this:

<{$topic.title}>

It thinks it's a forum topic not the news topic. How can I show the selected news topic as headline?

You can see what's happening here:

http://www.xoopswiki.org/modules/news/index.php?storytopic=5

You see two headlines like below, neither try is working:

_MI_NEWS_NAME
Re: Planning

first headline has this in the code:
<{$topic_title|default:$smarty.const._MI_NEWS_NAME}>

Second one this:
<{$topic.title|default:$smarty.const._MI_NEWS_NAME}>

How come <{$topic.title}> does work in the news_by_topic.html? with this code:


and <{$topic.title}> not recognized in news_index.html

2
snow77
Re: Show news topic in news_index.html template
  • 2007/5/15 3:52

  • snow77

  • Just can't stay away

  • Posts: 864

  • Since: 2003/7/23


well, I just found out one thing.

When your logged in ---->
$smarty.const._MI_NEWS_NAME

actually does display: News

When your logged out it displays ---> _MI_NEWS_NAME

really weird that it depends on being logged in that part.

<{$topic_title}> refuses to work.

3
BlueStocking
Re: Show news topic in news_index.html template

Quote:
Previous post... link

herv>> It's a personnalized template, for example this line
herv>> is not in the original template and it's the cause
herv>> of your troubles:

herv>> <h1><{$topic_title|default:$smarty.const._MI_NEWS_NAME}>h1>

_______________________

Maybe the google result that shows the above quote will help give you a clue.

I changed to default theme and it comes in fine, originally it came in for me as you described. I changed it back and forth a few times and when I refreshed under the default theme I could get it back.

Resized Image

BlueStocking
hhttps://xoops.org/modules/repository .. It is time to get involved - XOOPS.ORG

4
snow77
Re: Show news topic in news_index.html template
  • 2007/5/15 6:23

  • snow77

  • Just can't stay away

  • Posts: 864

  • Since: 2003/7/23


Thank you Bluestocking for testing the theme. Yes the template I've been working on is a personalized template from the theme Zetareticuli.

You can normally change the design of the module templates.

I wasn't so worried about _MI_NEWS_NAME, I ended up harcoding that one inside.

I was left wanting to make <{$topic_title}> work there, to make some sort of headline breadcrumb, but this file doesn't seem to want to recognize it.

5
nachenko
Re: Show news topic in news_index.html template
  • 2007/5/15 7:24

  • nachenko

  • Quite a regular

  • Posts: 356

  • Since: 2005/1/18


I can't understand why <{$topic_title}> doesn't work. I'm using News 1.53 in a new site I'm building and of course it works.

What's in the Smarty debug console? Does it show the <{$topic_title}> item?

Sidenote: Nice design, good job.

Oh, and, BTW, to do breadcrumbs with News perhaps you could use <{$topic_path}>. I think it comes commented in the code by default, but it works, just uncomment it.

Login

Who's Online

305 user(s) are online (166 user(s) are browsing Support Forums)


Members: 0


Guests: 305


more...

Donat-O-Meter

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

Latest GitHub Commits