Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
News Manager (3.6) - Newslist Frontend Output
#1
Dear GS-Community,

I have a maybe simple question but couldn't figure it out of the "News manager" threads.

What I need is a customized output of the news-list, to wrap a surrounding div with custom CSS class, adding a "flex"-row etc.


Something like the
<?php nm_list_recent(); ?>
loop, but with  the excerpt and image.



The original loop:

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;
}

?>


At the Moment I got this (works so far, is used as a component with "Dynpages"):

Code:
<?php

global $NMPAGEURL, $NMRECENTPOSTS;
if ($NMPAGEURL == '') return;
$posts = nm_get_posts();
if (!empty($posts)) {
         echo '<div class="posts">',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);
       $image = stripslashes($post->image);


    echo '  <article>
       <a href="',$url,'">',$title,'</a>  
      <span class="image object"><img src=" ',$image,' "> </span>
      <br> <br>
      <a href="',$url,'"><span class="more-link-style">weiterlesen ...</span></a>
             
   </article>',PHP_EOL;
  }

  echo '</div class="posts">',PHP_EOL;

}

?>


But I can't find out how to display the excerpt. I tried different lines of the "site.php" but all tests produced just blank fields.


It would be very helpful, if someone could add one (or more) example line(s).

Or does this need an extra function defined?


(I'm more into graphic-design, frontend-layout, CSS3 etc. and not so experienced in php)


Sorry for my rough english,

Best regards and many thanks!



(And many thanks for all the effort by the author to build the plugin)
Reply
#2
See here the custom settings for Bootstrap http://getsimple.business-website.ru/
Reply
#3
Check the News Manager Addons plugin.

If you have any questions or need help, please ask in the support thread.
Reply
#4
I've seen the "News manager Addon" but commonly I try to get at least a rough understanding of the extensions I use or plan to use.


Therefore I thought it would be possible with an

"echo nm_create_excerpt($content);" construct.


----

I will look at the examples on Olegs page too, thanks.
Reply




Users browsing this thread: 1 Guest(s)