X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   news posting (https://forum.x-cart.com/showthread.php?t=24033)

cascadegps 08-11-2006 11:19 AM

news posting
 
I am learning to use the news management and want the news to post on that right hand column box, but only show the first couple of sentences and give customers the option of clicking on it to read more. Instead the whole article post with a very long narrow scroll to read it all. Is it possible to make it only show the first paragraph or less with a link or is News Man reallly just for email subscriptions?

balinor 08-11-2006 11:41 AM

Here's what I use:

open up today_news.tpl and replace this:

{$news_message.body}

with this:

{$news_message.body|truncate:114:"...":true}...read more

change the truncate value to shrink or expand as you like.

cascadegps 08-11-2006 12:31 PM

news management
 
:) THanks. that worked just fine.

jdedba 08-11-2006 08:39 PM

This is also what I want to know.

It is strange that I search for keyword "news" in this forum and get nothing back. It seems phpBB does not store news as the searchable word. :(

Thanks a lot.

Vacman 08-12-2006 06:48 AM

Nice! I like that...

Josaram 11-08-2006 09:31 AM

Re: news posting
 
thank you as well, I needed help with this and it worked perfect

virtualstar 11-25-2006 08:57 PM

Re: news posting
 
As balinor explained above you can truncate the news. Now does anyone know if it is possible to display multiple news items? When I add a message it just displays the newest message, I would like to show the latest 5 messages.
Thanks

carpeperdiem 11-25-2006 09:32 PM

Re: news posting
 
my solution is neither elegant nor automated... I made a new .tpl and called it mm_news.tpl

I simply hardcoded my news items...

Code:

<strong>21-Nov-2006</strong><br />
<strong>  NEWS ITEM 1</strong>
<a href="http://www.link.com/link" target="_blank">link name</a> NEWS ITEM 1... NEWS ITEM 1... NEWS ITEM 1... NEWS ITEM 1... <br /><br />
<strong>08-Nov-2006</strong><br />
<strong>NEWS ITEM 2</strong>
<a href="http://www.link.org/link" target="_blank">NEWS ITEM 2 NEWS ITEM 2 NEWS ITEM 2 NEWS ITEM 2 NEWS ITEM 2 <br /><br />
{if $usertype eq "C"}
<a href="news.php" class="SmallNote">{$lng.lbl_previous_news}</a>
{/if}


and then in news.tpl, replaced {include file="today_news.tpl"} with the new file.

This is brute force, but my news items are EXACTLY what I want. Links exactly what I require.

mrkenzie 11-26-2006 04:50 AM

Re: news posting
 
Here is what I did, you can check out the final product at:
www.techcentrichomes.com

I changed the news list so that it shows 5 news articles in the news box. It truncates the news article, it shows the news article title, and then it links to the full news story with an anchor so it goes directly to the news article the user clicked on. It works really nice and it is easy to do.

in /modules/news_management/func.php:
Find this:
Code:

        if ($only_first) {
                $query .= " LIMIT 1";
        }


and change the 1 to how ever many you want to show on the main page (I used 5)

Then change skin1/today_news.tpl. I have included the entire page here. I also have an image before each news item. Also, I put in an anchor in news archive so when you click on the news article, it goes directly to the news article they clicked on.
Code:

{* $Id: today_news.tpl,v 1.13 2006/03/28 08:21:07 max Exp $ *}
{if $news_message eq ""}
{$lng.txt_no_news_available}
{else}
<table width="100%" cellspacing="2">
{section loop=$news_message name=curr_message}
<tr>
<td><img src="/skin1/images/news_icon.gif" alt="News" /></td>
<td><a href="news.php#{$news_message[curr_message].newsid}">{$news_message[curr_message].send_date|date_format:$config.Appearance.date_format}<br />
{$news_message[curr_message].subject|truncate:100:""}</a></td>
</tr>
{/section}
</table>
<br />
{if $usertype eq "C"}
<a href="news.php" class="SmallNote">{$lng.lbl_previous_news}</a>
{/if}
{/if}
<hr class="VertMenuHr" size="1" />


Here is my skin1/modules/news_management/news_archive.tpl to show how to add the anchor on that page:
Code:

{* $Id: news_archive.tpl,v 1.5 2005/11/17 06:55:51 max Exp $ *}
{if $news_messages eq ""}
{$lng.txt_no_news_available}
{else}
{section name=idx loop=$news_messages}
<a name="{$news_messages[idx].newsid}" id="{$news_messages[idx].newsid}" />
{capture name=dialog}
<b>{$news_messages[idx].subject}</b>
<br /><br />
{if $news_messages[idx].allow_html eq "N"}
{$news_messages[idx].body|replace:"\n":"<br />"}
{else}
{$news_messages[idx].body}
{/if}
{/capture}
{include file="dialog.tpl" title=$news_messages[idx].send_date|date_format:$config.Appearance.date_format content=$smarty.capture.dialog extra='width="100%"'}
<br />
{/section}
{/if}


Let me know if you have any questions or problems.

Good luck!

virtualstar 11-26-2006 06:37 PM

Re: news posting
 
Thanks for the replies I like your approach Mike looks like I will have to wait till I upgrade to 4.1. the files you reference either dont exsist on the 4.0 branch or are quite different.

Thanks Again

almenzies 12-17-2006 12:35 PM

Re: news posting
 
yeah is there any way of doing this in version 4.0 - I really want to do what mrkenzie describes, but can't find the relevant files.

thanks

Jon 12-17-2006 07:42 PM

Re: news posting
 
If you use your news section frequently, and also want to use the news to increase your search engine ranking, you may want to evaluate our XNews - News Management modification for x-cart:
http://www.websitecm.com/x-cart-mods/xnews-and-seo-links.html

craichead 04-20-2007 11:30 AM

Re: news posting
 
Edit: Forgot to mention that my store is in the /store subdirectory... not in the root. I imagine that this might have something to do with my issue. As i'm only moderately geeky, can someone help.. might be useful to others with their stores in subdirectories.. cheers...



I just changed the func.php to 5 and changed my today_news.tpl to your code and this is what I get:

http://www.whistleanddrum.com/today_news.png

Andy ideas?

Best,

groovedis 04-25-2007 10:12 AM

Re: news posting
 
Quote:

Originally Posted by almenzies
yeah is there any way of doing this in version 4.0 - I really want to do what mrkenzie describes, but can't find the relevant files.

thanks


I too would like to know how to do this in 4.0. Hope someone can help.

Cheers.

adivr 04-27-2007 02:49 PM

Re: news posting
 
I tried to make it work but when i have change

{$news_message.body}

with this:

{$news_message.body|truncate:114:"...":true}...read more

It's seems to be ok but there is no link to the full message

can someone help me?

Cris.g 05-22-2007 08:32 PM

Re: news posting
 
Hi everyone. I am so sorry but I am extremely confused. :oops:
I read this whole thread and I still do not understand how to post newsletters. Is there anywhere I can read step by step instructions?

Thanks

ozchris 06-13-2007 12:21 AM

Re: news posting
 
I've just started experimenting with news and agree it didnt work the way I thought it would at first.

First read the manual, to see how its supposed to work.

Turn on the News Management Module.
Configure it, and add a news listing.
Then create a message.

Unless you have people in your subscription list, you won't get much further, so add a sample email address to your list.
Then you'll see an extra section saying that it's queued, and would you like to send it to your list.

By default it appears in the menu section.
For me, it displayed the body of the message, which is wierd for a menu, so I changed it to display the subject line, and turned it into a link.

<a href="news.php" class="SmallNotes">{$news_message.subject}</a>
instead of the old
{$news_message.body}

I'll probably also get rid of the archive link. It doesn't make me want to click it. And it just goes to the news page anyway.

Wow. my first xcart code change!

MMANOR 07-28-2007 06:30 PM

Re: news posting
 
Quote:

Originally Posted by mrkenzie
Here is what I did, you can check out the final product at:
www.techcentrichomes.com

I changed the news list so that it shows 5 news articles in the news box. It truncates the news article, it shows the news article title, and then it links to the full news story with an anchor so it goes directly to the news article the user clicked on. It works really nice and it is easy to do.

in /modules/news_management/func.php:
Find this:
Code:

    if ($only_first) {
        $query .= " LIMIT 1";
    }


and change the 1 to how ever many you want to show on the main page (I used 5)

Then change skin1/today_news.tpl. I have included the entire page here. I also have an image before each news item. Also, I put in an anchor in news archive so when you click on the news article, it goes directly to the news article they clicked on.
Code:

{* $Id: today_news.tpl,v 1.13 2006/03/28 08:21:07 max Exp $ *}
{if $news_message eq ""}
{$lng.txt_no_news_available}
{else}
<table width="100%" cellspacing="2">
{section loop=$news_message name=curr_message}
<tr>
<td><img src="/skin1/images/news_icon.gif" alt="News" /></td>
<td><a href="news.php#{$news_message[curr_message].newsid}">{$news_message[curr_message].send_date|date_format:$config.Appearance.date_format}<br />
{$news_message[curr_message].subject|truncate:100:""}</a></td>
</tr>
{/section}
</table>
<br />
{if $usertype eq "C"}
<a href="news.php" class="SmallNote">{$lng.lbl_previous_news}</a>
{/if}
{/if}
<hr class="VertMenuHr" size="1" />


Here is my skin1/modules/news_management/news_archive.tpl to show how to add the anchor on that page:
Code:

{* $Id: news_archive.tpl,v 1.5 2005/11/17 06:55:51 max Exp $ *}
{if $news_messages eq ""}
{$lng.txt_no_news_available}
{else}
{section name=idx loop=$news_messages}
<a name="{$news_messages[idx].newsid}" id="{$news_messages[idx].newsid}" />
{capture name=dialog}
<b>{$news_messages[idx].subject}</b>
<br /><br />
{if $news_messages[idx].allow_html eq "N"}
{$news_messages[idx].body|replace:"\n":"<br />"}
{else}
{$news_messages[idx].body}
{/if}
{/capture}
{include file="dialog.tpl" title=$news_messages[idx].send_date|date_format:$config.Appearance.date_format content=$smarty.capture.dialog extra='width="100%"'}
<br />
{/section}
{/if}


Let me know if you have any questions or problems.

Good luck!


I used this code and it worked great except for one thing. If you can look at the link http://www.mourningnightmares.com/news.php unfortunately it created a huge white space before displaying the previous news. I did take out the line regarding an image for the links because I did not create one. What could I do differently to display the links for the news?

Thank you all in advance for your help.

baconbits 10-01-2007 01:47 PM

New letters and Xnews
 
Quote:

Originally Posted by Jon
If you use your news section frequently, and also want to use the news to increase your search engine ranking, you may want to evaluate our XNews - News Management modification for x-cart:
http://www.websitecm.com/x-cart-mods/xnews-and-seo-links.html


Jon, I just installed this mod and it is perfect.

QUESTION: How does this integrate with the News Management? Will members receive a new news article when it's posted?

QUESTION: Can a Member have the capacity when signing up for the email newsletter to select from which categories that they would like to receive info on?

Jon 10-01-2007 01:51 PM

Re: news posting
 
XNews is completely seperate from the built in x-cart news and does not integrate with the mailing list.

smv 10-12-2007 09:52 AM

Re: news posting
 
Hey is there a way to just show the subject as a link, and have like 5 news articles shown at a time by subject so people can click on them and be taken the the news article?

almenzies 11-04-2007 03:23 PM

Re: news posting
 
Yeah that's really what I'm looking for too.

I tried changing

HTML Code:

    if ($only_first) {
        $query .= " LIMIT 1";
    }


to

HTML Code:


    if ($only_first) {
        $query .= " LIMIT 5";
    }



in modules/news_management/func.php as suggested in a previous post, but it had no effect!

smv 11-05-2007 05:36 AM

Re: news posting
 
yeah, cause i mean if you have a huge news update it looks really bad in the little box. It'd be nice to just have headlines.

code4access 11-05-2007 04:02 PM

Re: news posting
 
Quote:

Originally Posted by mrkenzie
Here is what I did, you can check out the final product at:
www.techcentrichomes.com
.................
Good luck!


Hi mrkenzie, I like your solution and I had followed exactly your script, unfortunate i was not successful

I had total 3 news to display..

Problem 1. : when follow 100% the script, it display the text "news" only (or show only news_icon.gif without news subject which it shoud display as in your site)

Problem 2 : It did not shows all the 3 news i have, it shows only the last one, and it display repeately 12 times

I tried to change the script, if i quote out all "curr_message" in the scrpt, it solved problem1, but problem 2 remains same.

Kindly advise and help, thank you very much in advance and appreciated.

samz724 02-04-2008 07:10 AM

Re: news posting
 
I 2nd this problem.. I would love to implement this, but i'm coming up w/ the same issue.

Any ideas? thanks


Quote:

Originally Posted by code4access
Hi mrkenzie, I like your solution and I had followed exactly your script, unfortunate i was not successful

I had total 3 news to display..

Problem 1. : when follow 100% the script, it display the text "news" only (or show only news_icon.gif without news subject which it shoud display as in your site)

Problem 2 : It did not shows all the 3 news i have, it shows only the last one, and it display repeately 12 times

I tried to change the script, if i quote out all "curr_message" in the scrpt, it solved problem1, but problem 2 remains same.

Kindly advise and help, thank you very much in advance and appreciated.


MythNReality 04-18-2008 12:32 AM

Re: news posting
 
Quote:

Originally Posted by code4access
Hi mrkenzie, I like your solution and I had followed exactly your script, unfortunate i was not successful



Follow the message #17 then you'll get what you want. That's how I did it, and works like magic. No need for BIG codes!

find: /today_news.tpl (from your admin panel)

Quote:

Originally Posted by ozchris

<a href="news.php" class="SmallNotes">{$news_message.subject}</a>
instead of the old
{$news_message.body}

Wow. my first xcart code change!


Paul H 10-25-2008 07:52 AM

Re: news posting
 
I did the #17 mod and it works fine and cleans up the box nicely for long news messages.Just need to figure how to list several messages

I was a little confused with the news system but I think it works like this.
Create a news letter in the lists section to mail out to anyone who subscribes
and then create a message that displays on the site.
There is a tick box in the news list "show messages in site news" and another tick box
in "messages" "show as news"
but things don't seem to work quite like they should.

I'd of thought that just create a news item and then tick a box whether to display on the site would of been fine with no need for a separate message section but maybe I'm missing something ??

espresso 11-10-2008 02:55 PM

Re: news posting
 
Quote:

Originally Posted by balinor
Here's what I use:

open up today_news.tpl and replace this:

{$news_message.body}

with this:

{$news_message.body|truncate:114:"...":true}...read more

change the truncate value to shrink or expand as you like.


Just a side note that this will not work if you have HTML code in your news message body. Use plain text instead !

conradp24 05-18-2009 02:51 AM

Re: news posting
 
Has anybody managed to resolve the issues of not being able to add multiple subject headings or even multiple news items to the main today_news.tpl?

I tried doing a [section loop] .... [/section] but this didn't work. I've been looking through the php files but can't seem to find what I need to resolve this ( although not a php coder as such :oops: )

Also my news doesn't display the send_date in this code: {$news_message.date|date_format:$config.Appearance .date_format}

If I change it to date it displays the current date??!

I would like to be able to display the news the same as mrkenzie but after working on it for two days I have to put up my hand and ask for help

aurimasdulskis 05-20-2009 12:10 AM

Re: news posting
 
Anyone can tell in which file i can manage news box? My template is home made and when i done to show news in main site page - it was not shown. I need to insert tags, but where? Thanks!

conradp24 05-20-2009 12:22 PM

Re: news posting
 
/skin1/news.tpl for the main file otherwise look under modules /skin1/news_management/today_news.tpl for the other main file....if I understood your question correctly.

But if you've customised your skin and it doesn't show up you've probably removed it under the home.tpl file or haven't enabled it correctly in Admin/modules

Hope this helps.

Conrad

conradp24 05-20-2009 12:26 PM

Re: news posting
 
I figured out the problem of the date not displaying, it was due to the mail in the queue not being send and remaining in the queue. This was using the php mailer, I've since upgraded to v. 1.12 and after the mail send, it displayed the date using the send_date variable.

Still trying to get this multiple subject issue resolved though.
Once again any help appreciated.


All times are GMT -8. The time now is 06:59 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.