Thread Rating:
  • 6 Vote(s) - 4.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
News Manager (updated)
Essentially I just want to be able to set all my news posts to have a permalink that conforms to the example.com/news/yyyymmdd format. And it needs to be something that I configure once and never have to worry about again. It shouldn't be an additional per-post option that I have to click-click-click to set up for every news post I publish.

(1) Editing the post publish date.

I suppose there will be people who made mistakes and want to adjust that, in which case I think the permalink should change as well. I look at editing a "news" post date as equivalent to deleting the old post and creating a new one, because the date of a "news" post is a core aspect of the post itself.

(2) Pre-populating.

It was just my bad attempt at achieving the same thing as your option to just have all posts use the defined slug structure. What you have in mind is much better.
Reply
I'll add support for some gsconfig settings that allow customizing the post id format, autoupdate, etc.

A comment about the permalink structure you want: example.com/news/slug is not currently possible with News Manager. You can do example.com/news/post/slug or example.com/post/slug (if you define index as your news page), unless you patch the plugin of course.

Finally, a question. In 2.5 beta I changed the way excerpts are generated from 2.4.x (and older) - words are no longer truncated, the cut is done based on spaces. I don't know if this is not convenient for CJK. Do you think there should be an option to disable this and cut just by number of characters as before? (some time ago I asked about this but no one objected, as it's fine for Latin, Cyrillic script)
Reply
(2014-02-22, 04:41:26)Carlos Wrote: Finally, a question. In 2.5 beta I changed the way excerpts are generated from 2.4.x (and older) - words are no longer truncated, the cut is done based on spaces. I don't know if this is not convenient for CJK. Do you think there should be an option to disable this and cut just by number of characters as before? (some time ago I asked about this but no one objected, as it's fine for Latin, Cyrillic script)

I think it is better the way it is in beta, a cut in the middle of a world is not cool.

I have a request about it, I think I have already mentioned it before, but it may have been forgotten. I don't like when my words are cut in half, so current situation with beta is better. But I don't like my sentences being cut in the middle as well, so I would like an option to divide posts into two parts - an intro text (excerpt) and a full text (body). You could set a tag like <hr> (<hr /> for XHTML), maybe with a specific class, for NM to indicate the end of the excerpt. It's been working like this in K2 (a Joomla content component) great for years.

What do you think about it?

PS: Latest beta works great as well Smile

Edit:// As zfz proposed, if you could not cut excerpts by a tag, cutting it at the nearest dot would be also good, though still not perfect.
Tomáš Janeček - Multilingual personal website powered by GetSimple
» The little I did for GetSimple
Reply
Ah yes, I did notice the /post/ part of the URL. That's fine, really. It's the slug part that matters.

In a purely CJK post, there are no spaces. All the punctuation are double-byte, too. Although many people are used to putting spaces in front and after numbers and English, like so: "這是一個內含 ABC 的中文句子。" Cutting excerpts by spaces will cause a huge problem on CJK sites, as the next space may only happen after another 40 words, if at all.

Just as an example, I'll write out the previous paragraph in Chinese for you here:

在一篇純漢字的文章裡不會有空格。所有標點也都會是全形,不過很多人習慣在數字和英文字前後加入空格,像這樣:「這是一個內含 ABC 的中文句子。」等到有空格才切摘要的話,在漢字網站會造成很嚴重的問題,因為下一個空格可能要等四十個字後才會出現,甚至可能不會出現。

If you search for spaces in that paragraph, you'll only find two: before and after the "ABC". (Note that your system/browser fonts need to have the CJK code ranges to even display that paragraph properly.)

If you cut excerpts by number of characters, you want to cut in the middle of sentences to avoid hanging punctuation. Cutting after a full-stop is fine, but cutting after a comma or an opening quote is bad.

However, most (if not all) CJK users are no longer surprised about bad handling of CJK on the internet. So as long as it's not broken (as in content not showing, words show up as garbled random codes etc), we take it rather well.

In my opinion, the best way to handle excerpts is always to use a special tag for it. You cannot go wrong when the author is the one doing the cutting.
Reply
@TeeJay
- I'll keep it this way: words (anything separated by spaces) not truncated in excerpts (at least by default - I may add some custom setting to re-enable previous behaviour.)

- As for cutting by a tag like <hr>, you and others have suggested this previously. I hadn't forgotten about it, I just had left that for later, for a future release. But I'll look into it.

- Thanks for the feedback about beta 16. Nice to know nothing seems to be broken :-) However there are still some issues with excerpts length that I hope will be (mostly) fixed in beta 17.

@zfz
Thanks a lot for the detailed info, very interesting to know.
Reply
I'm new to GetSimple CMS but i like it very much!
I think this plugin is one of the most useful for the project!

The only think I miss is a newsletter that send the news added with this plugins.
There is a way to enable the email send?

Thank you
Reply
(2014-03-07, 09:32:49)CyberPK Wrote: The only think I miss is a newsletter that send the news added with this plugins.
There is a way to enable the email send?

Thank you

I haven't tried, but I suppose you could use FeedBurner's email subscriptions with the News Manager RSS plugin.
Reply
or mailchimp
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
a practical usage?
My website made with GetSimple CMS is

Arte & Società
www.artesocieta.eu

An indipendent website about Italian Contemporary Visual Arts
Reply
Hello

I wrote a plugin that allows indexing / search posts by I18N Search plugin.
http://get-simple.info/extend/plugin/i18...posts/776/
Now the question is: how to call a re-index after adding, deleting or editing a post? I18N Search uses changedata-save and page-delete.

There is a chance that the News Manager also generate these events?
Plugin itself is not able to do this Sad

Greets,
Sebastian
Reply
(2014-03-08, 06:08:35)sbatko Wrote: I wrote a plugin that allows indexing / search posts by I18N Search plugin.
http://get-simple.info/extend/plugin/i18...posts/776/

Great! I never found the time to look into this, I'm glad someone finally made this ;-)

(2014-03-08, 06:08:35)sbatko Wrote: Now the question is: how to call a re-index after adding, deleting or editing a post? I18N Search uses changedata-save and page-delete.

I think it could be done by checking (perhaps at the header hook) if file data/other/i18n_word_index.txt is older than data/other/news_manager/posts.xml

(2014-03-08, 06:08:35)sbatko Wrote: There is a chance that the News Manager also generate these events?
Plugin itself is not able to do this Sad

I suppose could add a hook for this, like nm-cache-updated
Reply
(2014-03-08, 18:04:10)Carlos Wrote: I think it could be done by checking (perhaps at the header hook) if file data/other/i18n_word_index.txt is older than data/other/news_manager/posts.xml
This code will be called 99.9% times unnecessarily.
(2014-03-08, 06:08:35)sbatko Wrote: There is a chance that the News Manager also generate these events?
Plugin itself is not able to do this Sad
I suppose could add a hook for this, like nm-cache-updated
Search plugin now updated to version 0.2 and some testing done.
The only way to reindex is calling function:
PHP Code:
delete_i18n_search_index(); 
from I18N Search plugin. There is no option to update/refresh only News Manager index data - full reindexing must be made in context.
So, we must decide what's better:

a. News Manager calls delete_i18n_search_index itself (after testing existence of my search plugin) _OR_
b. News Manager publish hook nm-cache-updated and my plugin uses this to do job.

Any suggestions ?
Reply
(2014-03-09, 02:51:39)sbatko Wrote: I think it could be done by checking (perhaps at the header hook) if file data/other/i18n_word_index.txt is older than data/other/news_manager/posts.xml
This code will be called 99.9% times unnecessarily.

It would be called only in the backend. It would not require loading files, just checking their mod-dates. Additionally you could do the check only if in NM's backend (load.php and id=news_manager)

PS I suggest you start a support thread for your plugin and link it in its Extend page (and we can continue there if you wish)
Reply
News Manager 2.5 beta 17 attached to this post.

- New optional NMNOSITEMAP setting, to be used in gsconfig.php. If you don't want posts to be included in sitemap.xml (by default they are, since beta 16),
Code:
define('NMNOSITEMAP', true);


- New more custom setting (0 or 1) (@TeeJay and others)
-- If more enabled (and it's not a single post page), post content will be cut at <hr (<hr>, <hr />, ...)
-- If the string "<hr" is not present, the usual stripped excerpt or full content is shown (depending on FullText/Excerpt selection or excerpt custom setting)
To enable, enter this in Custom settings:
Code:
more 1


- Changed excerpt custom setting (now can only be 0 or 1; if you were using "readmore" or "forcereadmore" values, see below)


- New readmore custom setting (0, 1 or a[lways])


- New experimental feature: custom URL parameters/prefixes (suggested by @emanwebdev)
You can redefine the post, page, tag and archive parameters used in NM URLs, via gsconfig settings NMPARAMPOST, NMPARAMPAGE, NMPARAMTAG and NMPARAMARCHIVE.
Example:
Code:
define('NMPARAMPOST', 'article');
A single post URL will then be ?article=this-is-a-title instead of ?post=this-is-a-title (or /article/this-is-a-title with NM fancy URLs enabled)
To make it work with NM fancy URLs you must edit your .htaccess accordingly, for example:
Code:
RewriteRule ^newspage/article/([^/.]+)/?$ index.php?id=newspage&article=$1 [L]


- Fixed newspage dropdown selector (settings): now slugs are sorted alphabetically, and private pages can also be selected


- Fixed excerpt length issues with unicode characters


- Updated/completed French translation (@emanwebdev)


Please report any issues you find.

[for previous beta versions: http://get-simple.info/forums/showthread...4#pid43174 ]

[attachment removed: news_manager-2.5-beta17.zip (Size: 72.47 KB / Downloads: 25) ]
Reply
(2014-03-08, 06:08:35)sbatko Wrote: I wrote a plugin that allows indexing / search posts by I18N Search plugin.
http://get-simple.info/extend/plugin/i18...posts/776/
Now the question is: how to call a re-index after adding, deleting or editing a post? I18N Search uses changedata-save and page-delete.

There is a chance that the News Manager also generate these events?
Plugin itself is not able to do this Sad

You could do the following either directly in the plugin or better in the hook admin-pre-header:
Code:
if (basename($_SERVER['PHP_SELF']) == 'load.php' && @$_GET['id'] == 'nm_admin' && /* additional conditions to check for save or delete parameters */) {
  delete_i18n_search_index();
}
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
Carlos and Mvlcek, thanks for suggestions.
Now i'm working on this.
Reply
@sbatko

Not tested, but might work:
Code:
if (basename($_SERVER['PHP_SELF']) == 'load.php' && @$_GET['id'] == 'news_manager' && (isset($_POST['post']) || isset($_POST['settings']) || isset($_GET['delete']) || isset($_GET['restore']))) {
  delete_i18n_search_index();
}
(in admin-pre-header as mvlcek suggests)
Reply
(2014-03-10, 07:27:49)Carlos Wrote: @sbatko

Not tested, but might work:
Code:
if (basename($_SERVER['PHP_SELF']) == 'load.php' && @$_GET['id'] == 'news_manager' && (isset($_POST['post']) || isset($_POST['settings']) || isset($_GET['delete']) || isset($_GET['restore']))) {
  delete_i18n_search_index();
}
(in admin-pre-header as mvlcek suggests)
@Carlos
Works perfectly, there is no need to stat on file dates Smile
Thanks for suggestions
Edit:
New version 0.3 in Extend, also Support Forum Thread started: http://get-simple.info/forums/showthread.php?tid=5766
Reply
I'm not decided about the way to implement custom authors in NM beta - leaving this for later.

In the meantime, if you want to display post authors without exposing their GetSimple usernames, you can use this small plugin, NM Custom Authors (attached)

Usage:
- Unzip, upload to plugins folder and activate.
- Edit your gsconfig.php file and insert lines like this:
Code:
$NMAUTHOR['admin'] = "Webmaster";
$NMAUTHOR['jsmith'] = "John Smith";
// etc...


Attached Files
.zip   nm_custom_authors-0.1.zip (Size: 569 bytes / Downloads: 30)
Reply
Hi,
I'm running GS 3.3.1 and NM 2.4.4. Many thanks to all the contributors for a fine CMS and News Plugin. Just what I was looking for and I love it.

I'm still trying to find my way round PHP so the questions I ask may seem easy for you but not for me...yet. I am reading through all the posts (not read them all yet) to find if some of these questions have been answered. I know they have been asked several times and I may have missed the answer, so..

Q 1. Is it possible to add an image to posts. I tried the syntax
Code:
<p><a href="&lt;?php get_site_url(); ?&gt;"><img alt="picture of domestic pets" src="&lt;?php get_theme_url(); ?&gt;/group-of-pets.png" /> </a></p>
which is what I am actually using in the header but it failed to work in a post.

Q 2. Is it possible to link the ellipsis [...] in the excerpt to the full page? I know many asked for this but not sure of the outcome.

Q 3. Fumbling my way through code and reading posts, I see a lot of reference to I18N. Is it necessary to have this plugin installed. There is no mention of it being a requirement.

Thanks and, again, apologies if all these have been answered previously.
I'm no Einstein, nor do I profess to be. Just saying what I would try in the circumstances.
Reply
1. Featured images or post thumbnails are not supported in the stable version (currently 2.4.4). You have to use the beta version for that.
(I assume you want to associate images to posts so that they're shown e.g. in the main news page - of course you can just insert images in the post content just like with normal pages)

2. Not in the stable version, but NM beta supports "read more" links. The ellipsis doesn't have a link but you can have a "read more" text after it that is linked to the post.
If you really need it the way you say, you can remove the ellipsis and redefine the "read more" text to "[...]" by enabling Custom settings and inserting this:
Code:
ELLIPSIS ""
READ_MORE [...]
(Any string that is used in the frontend is redefinable.)

3. The I18N plugin is not required at all. (I even had to do some changes to NM because there were incompatibilities in certain setups.)
Reply
Thanks Carlos,
1.
Quote:(I assume you want to associate images to posts so that they're shown e.g. in the main news page - of course you can just insert images in the post content just like with normal pages)
Yes, sort of :-) What I was trying for, was to have the images show in the the excerpt so they would be dominant in a handheld (RWD). It seems that is not possible so my other option would be added to the content, which I thought I was doing in the source of Edit Post. I am assuming the PHP syntax is
Code:
<img src="<?php get_site_url(); ?><?php get_theme_url(); ?>/group-of-pets.png" alt="picture of domestic pets" />
but when I added it, the content disappeared from the excerpt and there was no image in the full page. So my syntax must be wrong. What should it be?

2. I had actually changed
Code:
ELLIPSIS =>"[...]" to "ELLIPSIS"            =>  " ... read more"
, in plugins/news_manager/en_US
I changed the code to
Code:
ELLIPSIS ""
READ_MORE [...]
but lost everything. Obviously I'm doing it in the wrong place. Where should it be?


3.Ok, that's fine.

You probably noticed, PHP is not a strong point yet so your response and help is appreciated.

thanks
I'm no Einstein, nor do I profess to be. Just saying what I would try in the circumstances.
Reply
(2014-03-11, 09:56:16)Lucianp Wrote: Thanks Carlos,
1.
Quote:(I assume you want to associate images to posts so that they're shown e.g. in the main news page - of course you can just insert images in the post content just like with normal pages)
Yes, sort of :-) What I was trying for, was to have the images show in the the excerpt so they would be dominant in a handheld (RWD). It seems that is not possible so my other option would be added to the content, which I thought I was doing in the source of Edit Post. I am assuming the PHP syntax is
Code:
<img src="<?php get_site_url(); ?><?php get_theme_url(); ?>/group-of-pets.png" alt="picture of domestic pets" />
but when I added it, the content disappeared from the excerpt and there was no image in the full page. So my syntax must be wrong. What should it be?

2. I had actually changed
Code:
ELLIPSIS =>"[...]" to "ELLIPSIS"            =>  " ... read more"
, in plugins/news_manager/en_US
I changed the code to
Code:
ELLIPSIS ""
READ_MORE [...]
but lost everything. Obviously I'm doing it in the wrong place. Where should it be?


3.Ok, that's fine.

You probably noticed, PHP is not a strong point yet so your response and help is appreciated.

thanks


Hi,

1) The only way how to put an image next to the excerpt is via the administration. But as Carlos said, you have to use News Manager Beta, current version is 2.5.17. Here is an example how does it look like with the beta on my website.

2) You have to write it in the textarea in the News Manager setting (in the GS administration). But this feature is available only in the beta, too, and the textarea for those special settings is also only in the beta.

Beta 17 is the latest News Manager and though it's not officially stable, I'm using it on all production sites I do including my blog without any problems, there aren't any bugs I would say. And it gives so much more features Smile

Give a chance to the beta, you'll love it.


And thank you Carlos for the last release, especially the feature I asked for, I'm gonna try it tomorrow... ehh, it's morning already, so in the afternoon Smile
Tomáš Janeček - Multilingual personal website powered by GetSimple
» The little I did for GetSimple
Reply
Works like a dream: image in Full Text and 'read more' link in excerpt.

Thank you Carlos, for your excellent code
and thank you TJ for your help too.
I'm no Einstein, nor do I profess to be. Just saying what I would try in the circumstances.
Reply
So as I promised, I have tested the latest beta and again, it's just another long step further.

I was expecting <hr> to only solve the issue with the truncating intro text in the middle of a sentence, but it also (maybe accidentally) disables escaping HTML tags like <strong> in the excerpts. It looks much better, doesn't it? Wink

Now I'm thinking how could we solve the same issue in the sidebar list of post which requires much shorter excerpts, I have no idea so far... never mind.

Thank you Carlos


PS: Could interest D.O. :
I have discovered an obvious issue with using nm_show_tag('foo') for to replace "categories" of articles in your main menu. As all those articles under specified "categories" actually belong to "news" menu item (or any other, but it's always only 1 of the categories), whenever you click onto any of articles from anywhere, you'll always loose the current class on the "category" you were looking at. Instead, "news" category gets chosen. It's logical and obvious, I just didn't think of it before, so I wanted to point it out.
Carlos, would you guess what I'd like you to introduce? :-P Just kidding, when real categories become your #1, I'm sure you'll let us know. You're doing a great job.
Tomáš Janeček - Multilingual personal website powered by GetSimple
» The little I did for GetSimple
Reply




Users browsing this thread: 24 Guest(s)