Hi Kruna. :) Thanks for answering. Not quite what I was looking for, but a nice work around. I like it. :) I think I will borrow it. Thanks again. :) Have a great day.
And PS if anyone can still answer the original ? Feel free. :) *waves*
Kate
Printable View
Hi Kruna. :) Thanks for answering. Not quite what I was looking for, but a nice work around. I like it. :) I think I will borrow it. Thanks again. :) Have a great day.
And PS if anyone can still answer the original ? Feel free. :) *waves*
Kate
I got it to work on the Main page. :) YAY! Just so that anyone reading this wont run into the same thing:
The install directions tell you to put this line of code:
somewhere in this file:PHP Code:
<?php include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_NEWS_SUMMARY_MODULE)); ?>
The file you need to put it in is actually tpl_index_categories.php. :) I am still playing around with placement but everything works great for now. :)Quote:
includes/templates/template_default/templates/tpl_index_default.php
http://www.libragear.com/zencart/
Have a wonderful and codey day!
Kate
My luck is in ! I was just checking the forum to see if there was a way of placing the news page within my main page and here it is already !
I intend to have my main page content divided into 2 or even 3 columns with the news in one of those columns and your little line of code is just what i was looking for.
Fantastic and cheers !!
Dylan
Hi,
I'm trying to concentrate on personalising the display on the news_summary and also on the news default...
I'm having trouble to add a div around the image as I would like to personnalise just the image style on both these places. I'm not very familiar with php so unable to add the code that will display my div around the image.
Not looking for someone to hold my hand from A to Z... but could you point me out in the right direction...
I have tried modifying :
IMG.articleImage { border: 3px double #9a9a9a; padding: 0; margin: 10px 10px 10px 10px;}
in the css but this doesn't have any effect on my image display
I can't give a direct link to a specific news, because I will be playing around with these... But basicaly you can see the news and access it on my home page here : www.NetJuggler.net
Any advice would be greatly appreciated. Thanks in advance.
One more question - is there a quick way of me putting the main news page into my front page in a similar way ?
ie - is there a main news page equivalent to FILENAME_NEWS_SUMMARY_MODULE that I can substitute ?
Or does it gt more complex if I was to put teh news page into it ?
Dylan
does anyone know of a quick way of getting more than one "main" story showing on the homepage.
by main story i mean showning image, headline and intro text.
I looked through the thread and couldn't find the answer, although its a long thread and I could have missed it.
almost forgot... this is a brilliant contribution thanks Joshua
Hey Steve. :) I spent the morning searching for an answer, On one of the beginning pages of this post Joshua states that you cannot do this without reprogramming the mod. *sigh* I was hoping the answer was yes also. The only workaround I see is to make several posts a day, then at least the links show up there. lol. not very practical. There is an archive link though so people can see what came in the past. LA!
Of course I am a fledgling in PHP, so there may be a way..
:) Kate
Thanks for the info Kate, I was hoping someone had done this and might save me the work, but as they haven't I guess I'll have a crack at it myself.
If I do find a way I will post my solution for others.
OK so I've had a go at changing the news summary on the homepage and I've got something working, but before you look please bear in mind my enthusiasm far out weighs my skill so the coding is probably not the best ever seen.
Please bear in mind the following
The amount of news items is set in the query (limit 5).
It gets the last few articles added(5 in code) not sorted by date.
I haven't done anything with the languages, so if you need translations, you'll need to code them in.
There isn't any links to the news archive as the original, but you could add a simple href link if needed.
There is no styling on it so you would need to add divs and class as required.
It works for me, but that doesn't mean it will for you, please test extensively before using on live shop.
That said I hope this helps somebody, and maybe give someone more talented than me a starting point to improve and tweak the code.
This code replaced the code in the includes/modules/news_summary.php file
<?php
// this query uses part of the original news query, just simplified, if you need different languages that coding needs adding, to alter the amount of stories shown change the limit 5 to number required
$comments = $db->Execute("select n.article_id, nt.news_article_name, nt.news_article_shorttext, n.news_image, nt.news_image_text from " . TABLE_NEWS_ARTICLES . " n left join " . TABLE_NEWS_ARTICLES_TEXT . " nt on n.article_id = nt.article_id where n.news_status = '1' order by n.article_id desc limit 5 ");
while (!$comments->EOF)
{
// article_id is used for testing comment out when you ready to send this live
echo $comments->fields['article_id'];?><br /><?
echo $comments->fields['news_article_name'];?><br /><?
echo $comments->fields['news_article_shorttext'];?><br /><?
// get image for story
if ((zen_not_null($comments->fields['news_image'])) && file_exists(DIR_FS_CATALOG . DIR_WS_IMAGES . $comments->fields['news_image'])) {
$articleImage = zen_image(DIR_WS_IMAGES . $comments->fields['news_image'], $comments->fields['news_image_text'], '', '', ' ');
echo $articleImage;
}
// get the url for the article and attach to a simple read more link
$articleLink = zen_href_link(FILENAME_NEWS_ARTICLE, 'article_id=' . $comments->fields['article_id']);
?>
<a href="<? echo $articleLink;?> ">Read more</a>
<?
// bit of space between articles, if you do this properly with css you can style this better
?><br /><br /><?
$comments->MoveNext();
}
// need to add link to rest of news here if required
?>