Showing more than 1 News story on the Home page
I'm trying to show 5 news message on the home page, but I noticed from the debugging tool that the $news_message only has one story in the array.
In news.php however, there's a new variable called $news_messages which has multiple stories... How can I get access to that $news_messages variable from the home page? I was able to find this thread which talks about exactly what I need, but it doesn't work for 4.4.x http://forum.x-cart.com/showthread.php?t=48437 - looks like it's only valid for 4.3 and 4.2 |
Re: Showing more than 1 News story on the Home page
anybody got solution for this change?
|
Re: Showing more than 1 News story on the Home page
The heart of the display appears to be...
Code:
{insert name="gate" func="news_get_num" assign="all_news" lngcode=$shop_language} Try adding that to news.tpl checking first if any of the variables have changed between versions. |
Re: Showing more than 1 News story on the Home page
it didn't work.
By the way, where are these variables stored? $news_message.date $all_news I mean how do you find the right variable and what do they all mean? Still haven't figured out how this smarty works. Your help is appreciated. Thanks |
Re: Showing more than 1 News story on the Home page
I no longer have a copy of 4.0.x to look at, sorry.
|
Re: Showing more than 1 News story on the Home page
I'm using 4.44 now
|
Re: Showing more than 1 News story on the Home page
Use webmaster mode - it shows you the available variables and their contents.
--- |
Re: Showing more than 1 News story on the Home page
Quote:
Have you tried this? Code:
{* I just added the loop from the "light and lucid 2 column" news_archive.tpl and commented out the original call for the one news message. I don't know if it will work or not but probably worth a try. |
Re: Showing more than 1 News story on the Home page
it still didn't work. You are right. Should be copy pasting the loop from news_archive.tpl, but the doesn't work at all.
Added some dummy text inside the loop, but the dummy text didn't show up. So, I guess it didn't even go inside the loop at all. |
Re: Showing more than 1 News story on the Home page
This may be obvious, but what we are going to need to do is assign the variable $news_messages somewhere other than news.php.
In modules/News_management/news_manage.php you will see the variable assigned to smarty: Code:
$smarty->assign('news_messages', func_news_get($shop_language, false, false, "$first_page, $objects_per_page")); Hope that helps, -Mike |
All times are GMT -8. The time now is 08:28 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.