Thread Rating:
  • 6 Vote(s) - 4.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
News Manager (updated)
Hi Carlos,

Thanks for the help, that's perfect.
Also, great plugin ... just what I need.

Thanks again,
Dev.
Reply
I just have to add ... after setting up and looking around News Manager:

It does EVERYTHING I could want.

Brilliant stuff.
Reply
Hi Carlos,

Thanks for all the hard work on this plugin, this saved me on my latest project!

Is there a way to list the posts in reverse order, meaning the latest "last". I am using this as an events announcement manager for shows. When we view the posts or articles as show dates it shows the latest first. This is a great plugin.
Reply
You mean just in the sidebar/template (nm_list_recent), or in the main news page (and tag pages, archives, etc)?
Reply
(2015-02-13, 02:59:17)Carlos Wrote: Here's a patch for NM 3.0. Edit news_manager/inc/site.php, find this:




Code:
   echo '  <',$nmoption['markuppost'],' class="nm_post';
   if ($single) echo ' nm_post_single';
   echo '">',PHP_EOL;

and replace it by:




Code:
   echo '  <',$nmoption['markuppost'],' class="nm_post';
   if ($single) echo ' nm_post_single';
   // patch - tag classes
   foreach ($tags as $tag)
     if (substr($tag, 0, 1) != '_')
       echo ' nm_tag_'.htmlspecialchars($tag);
   // end patch
   echo '">',PHP_EOL;

This should generate additional classes nm_tag_foo, nm_tag_bar, ... in the post container.

Of course you will have to re-do the patch when you upgrade.
This part of the code will be changed in NM 3.1, so the patch would be a bit different.

In some future version this will be possible without patches, when some kind of post templating is implemented.

It's me again, I just updated to 3.1 and can't figure out which part to change in the file to get the "tag as class output" working again. I'd really appreciate if you could give me a hand!

== EDIT ==
Seems like a found a solution by myself.
I changed the following lines of code in "inc/site.php". Seems to work as before.
What do you think?

PHP Code:
   // echo '  <',$nmoption['markuppost'],' class="',$nmoption['classpost'],'">',PHP_EOL;

 
   echo '  <',$nmoption['markuppost'],' class="',$nmoption['classpost'];
 
     foreach ($tags as $tag) {
 
       if (substr($tag01) != '_') {
 
         echo ' nm_tag_'.(htmlspecialchars($tag));
 
       }
 
     }
 
   echo '">',PHP_EOL
Reply
(2015-05-30, 21:36:43)revotron Wrote: Seems like a found a solution by myself.
I changed the following lines of code in "inc/site.php". Seems to work as before.
What do you think?

It's perfectly fine. Good work!
Reply
(2015-05-31, 00:52:52)Carlos Wrote:
(2015-05-30, 21:36:43)revotron Wrote: Seems like a found a solution by myself.
I changed the following lines of code in "inc/site.php". Seems to work as before.
What do you think?

It's perfectly fine. Good work!

Hah! Thanks. I'm more the frontend guy you know.. html, css, less, scss, js and so on. I'm not that good with PHP unfortunately Sad

So thanks for your plugin, works like a charm!
Reply
(2015-05-30, 00:43:15)Carlos Wrote: You mean just in the sidebar/template (nm_list_recent), or in the main news page (and tag pages, archives, etc)?

Hi Carlos,

I am using this in template, front page in a block area probably the same as sidebar.  (<?php nm_list_recent(); ?>) just as you noted.  I am trying to get the results to just show oldest first or leading. 

Is there a way to do this?

Thanks
Reply
Ok, only for sidebar and older first. One more question: do you need to list the most recent, or the oldest posts?
Reply
(2015-06-01, 05:02:07)Carlos Wrote: Ok, only for sidebar and older first. One more question: do you need to list the most recent, or the oldest posts?

Hi Carlos,

It just needs to be the reverse order so the older posts would be listed first, then followed be the newer posts.   I am using this to list performances by a singer and where he will be appearing.   For example his performances in June need to be show in order they are posted.  june 7th, then june 20th, etc.   I hope that makes sense.

Thanks,
Reply
Then you can use this code in your component or template:

Code:
<?php
 global $NMPAGEURL, $NMRECENTPOSTS;
 if ($NMPAGEURL == '') return;
 $posts = nm_get_posts();
 if (!empty($posts)) {
   echo '<ul class="nm_recent">',PHP_EOL;
   $posts = array_slice($posts, 0, $NMRECENTPOSTS, true);
   $posts = array_reverse($posts); // ascending date order
   foreach ($posts as $post) {
     $url = nm_get_url('post') . $post->slug;
     $title = stripslashes($post->title);
     echo '  <li><a href="',$url,'">',$title,'</a></li>',PHP_EOL;
   }
   echo '</ul>',PHP_EOL;
 }
?>

It's a patched version of nm_list_recent(), for News Manager 2.2.x to 3.1

(I may add some option or function for this... In the meantime you can use that.)
Reply
(2015-06-04, 00:54:20)Carlos Wrote: Then you can use this code in your component or template:


Code:
<?php
 global $NMPAGEURL, $NMRECENTPOSTS;
 if ($NMPAGEURL == '') return;
 $posts = nm_get_posts();
 if (!empty($posts)) {
   echo '<ul class="nm_recent">',PHP_EOL;
   $posts = array_slice($posts, 0, $NMRECENTPOSTS, true);
   $posts = array_reverse($posts); // ascending date order
   foreach ($posts as $post) {
     $url = nm_get_url('post') . $post->slug;
     $title = stripslashes($post->title);
     echo '  <li><a href="',$url,'">',$title,'</a></li>',PHP_EOL;
   }
   echo '</ul>',PHP_EOL;
 }
?>

It's a patched version of nm_list_recent(), for News Manager 2.2.x to 3.1

(I may add some option or function for this... In the meantime you can use that.)

Hi Carlos,

Absolutely Perfect!

Thanks so much for this fix.  I worked great!!!
Reply
I've started a separate thread for NM beta versions.

A beta for NM 3.2 is available:
http://get-simple.info/forums/showthread...1#pid51671
Reply
Hey Guys, is it possible to make the excerpts look like this: thumbnail on the left, excerpt on the right (instead of thumbnails being located on top of the excerpts)? If yes, how can I do this?
Reply
I've edited the function responsible for output Smile result is here: http://revotechnik.sk/blog
Reply
(2015-06-10, 01:09:04)stwneu Wrote: Hey Guys, is it possible to make the excerpts look like this: thumbnail on the left, excerpt on the right (instead of thumbnails being located on top of the excerpts)? If yes, how can I do this?

Post elements have classes (.nm_post_title, .nm_post_image, etc.) that you can style (and position) with CSS.
Like here: http://webs.org.es/newsmanagerdemo/news/
where I added these to the CSS stylesheet:
Code:
.nm_post_image a { float:left; margin-right:14px; margin-top:12px } /* styling "a", so that it isn't applied to single post view */
.nm_post_date { margin:4px 0; }
.nm_post_title { margin:16px 0 4px 0; color:black; }
.nm_post { clear:both; padding:10px 0; }
(it's a quick hack, not responsive. Also, depending on your image sizes, etc., it would be different)

Another way to do this, if your template is built on Bootstrap or other CSS framework, is defining custom markup and class selectors for layout in NM Custom Settings.
http://www.cyberiada.org/cnb/news-manager-c/

For example, Oleg06 used something like this in one of his test sites based on Bootstrap:
Code:
classPost row margin-bottom-20
classPostTitle col-md-12
classposttitlelink text-danger
classPostDate  col-md-6
classPostAuthor col-md-6 text-right
classPostImage col-md-3
classPostContent col-md-9 clearfix
classReadmore center-block text-right
classReadmoreLink btn btn-primary
classPostTags col-md-12
Reply
Thank you both a lot! I added the code for the CSS, modified it slightly and also added an @media-query to make sure the content goes below the image at some point, where it doesn't look good anymore! Smile
Reply
is it possible to attach to the archives of the counter news?
Reply
(2015-06-11, 18:05:42)Oleg06 Wrote: is it possible to attach to the archives of the counter news?

Added to the to-do list (#214)
Reply
News Manager version 3.2 released  - Download (Extend)

- author's Display Name (GS 3.2+) supported
- new custom setting markupPostAuthorName
- optionally show disabled items in older/newer-type navigation
- language fallback
- posts cache optimization
- basic detection of changes in post files
- thumbnail generation now only allowed for (automatically) registered image sizes
- fixes in excerpts, search (cyrillic, etc.), UI (private post checkbox)
More information here

There should be no problem in upgrading from 3.1 (If upgrading from older versions, see upgrade notes for 3.0 or 3.1)

Thanks to Oleg06 for testing.
Reply
I intend to make News Manager have its own "News" tab in the top GS admin menu, with its own sidebar links.

Is anyone interested in keeping it the way it is now? (under the "Pages" tab, accesible via the sidebar link)
Reply
(2015-06-23, 00:29:10)Carlos Wrote: I intend to make News Manager have its own "News" tab in the top GS admin menu, with its own sidebar links.

Is anyone interested in keeping it the way it is now? (under the "Pages" tab, accesible via the sidebar link)

I find it convenient like that, but would find it convenient as top-level tab as well. The only consideration I have is: how many top tabs can one add without breaking the UI? Eg, suppose I wanted ItemManager, GS Custom Settings, WJ Notepad & Newsmanager (4 top-level tabs, & Itemmanager tab is <= the full word), is that ok for the UI?
Reply
Kinda got used to it being where it is now. Also, as Tyblitz said, how many tabs can you have as top level before it self destructs?
Reply
Thank you both for your opinions.

However I think that if multiple top-tabs are an issue, it's something to do with GS, not this plugin, and would better be discussed in another thread (or in GitHub).

As for being used to the current sidebar link... I think you would quickly get used to the top-tab. :-) I believe that people that are used to WordPress or other CMSes (that have separate tabs for posts and static pages) would find this more intuitive, or convenient.

Anyway, if there's enough interest in NOT having an additional "News" top-tab, I could add an option to disable it. But I think I would move the "Add new post" and "Settings" links in the main "News Manager" page to the right sidebar anyway...
Reply
Well, in my opinion, a separate top menu tab is a great idea.
Pages and News Manager posts are two separate things that work on the same level so it would be logical that NM would have a separate tab. So I'm up for it.

I don't use any other plugin that would take space in the top menu and even if I did, there still would be a lot of space. I believe that many plugins that have their own top menu tab don't deserve it it, but News Manager is not the case.

And if turning this feature off is not a trouble, making it on by default with optional turning off is the option that will suit everyone.
Tomáš Janeček - Multilingual personal website powered by GetSimple
» The little I did for GetSimple
Reply




Users browsing this thread: 8 Guest(s)