Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
News Manager Addons plugin
#51
So if i use <?php nm_list_recent_by_tag('tagishere'); ?> how to get excerpt and read more also? Big Grin.
Reply
#52
You can use nm_custom_display_recent, e.g. like this:

Code:
<ul>
<?php
nm_custom_display_recent('
  <li><strong><a href="{{post_link}}">{{post_title}}</a></strong><br />
      {{post_excerpt}}
      <a href="{{post_link}}">Read more</a>
  </li>
',
'tagishere');
?>
</ul>



Just a note: I've uploaded this plugin to Extend.
Reply
#53
Ok thanx, works fine now Big Grin.
Reply
#54
Hey Carlos! Hell, GS is changing a lot!
I tested your lastest version 0.9.0.3 and it works great.

Tip: if you can't add my "pull-down menu style WP" to NMUpdated plugin, you could add it to NMAddons. it could fit well.
My website made with GetSimple CMS is

Arte & Società
www.artesocieta.eu

An indipendent website about Italian Contemporary Visual Arts
Reply
#55
News Manager Addons plugin version 0.9.1

- Support for NM authors with new token {{post_author}}
- Supports NM 3.0 custom setting defaultAuthor
- Supports $NMAUTHOR gsconfig array (as in NM Custom Authors)
Reply
#56
Version 0.9.1.1 available: fixes wrong <ul> classes (nm_custom_list_recent, nm_custom_list_future)
Reply
#57
Great. I am going to test it.
My website made with GetSimple CMS is

Arte & Società
www.artesocieta.eu

An indipendent website about Italian Contemporary Visual Arts
Reply
#58
Hi Carlos!
After various "tests" with "NM Addons", I may to suggest you to eliminate the tags <p> and </p> before and after the tag {{post_excerpt}}. I think that It's better to have a clean text to use it directly in a tag <div> or <span>, specially during the adaptation of a free html template. What do you think about it?
My website made with GetSimple CMS is

Arte & Società
www.artesocieta.eu

An indipendent website about Italian Contemporary Visual Arts
Reply
#59
I agree. Thank you!
Reply
#60
News Manager Addons version 0.9.2
  • Post excerpts ({{post_excerpt}} placeholder) are no longer enclosed between <p> and </p> tags. (@D.O.)
Please note that, if you're upgrading from previous versions of the plugin, you may have to edit your template or component (if your styles are affected, you just have to change {{post_excerpt}} to <p>{{post_excerpt}}</p>)
Reply
#61
Hi Carlos, thanks for accepting my TIP, example in this amazing themes by Timbow
(http://get-simple.info/extend/theme/gril...-site/873/) there is this "problem" with NM Addons and the template
(if you list it there are two <p> tags.
OK I am going to download the new version now, thanks again for your quick help bro!


(2014-12-11, 06:11:45)Carlos Wrote: News Manager Addons version 0.9.2
  • Post excerpts ({{post_excerpt}} placeholder) are no longer enclosed between <p> and </p> tags. (@D.O.)
Please note that, if you're upgrading from previous versions of the plugin, you may have to edit your template or component (if your styles are affected, you just have to change {{post_excerpt}} to <p>{{post_excerpt}}</p>)
My website made with GetSimple CMS is

Arte & Società
www.artesocieta.eu

An indipendent website about Italian Contemporary Visual Arts
Reply
#62
Version 0.9.2.1 available (bugfix for 0.9.2)
(Thanks to Gooos for reporting)
Reply
#63
I'm trying to get a list of recent postimages in the sidebar with the title of the post as alt-tag

I've tried with the
PHP Code:
<a href="{{post_link}}">{{ post_image }} alt="{{post_title}}"</a

which off course don't work because of the <a href> tag.

but simple replacing this tag with the <img> tag also doesn't work
PHP Code:
<img src="{{post_link}}">{{ post_image }} alt="{{post_title}}"</img>] 


Is this possible ?
Anyone successful on this road ?




I think i'm getting there myself...

PHP Code:
<?php nm_custom_display_recent('    
<a href="{{ post_image_url }}" alt="{{ post_title }}">
'
); ?>
Reply
#64
To get the image URL only, use the {{ post_image_url }} placeholder. Example:

Code:
<a href="{{ post_link }}"><img src="{{ post_image_url }}" alt="{{ post_title }}" /></a>
Reply
#65
News Manager Addons version 0.9.3
  • added support for NM (3.0+) post image options and custom settings (width, height, crop, default image) when nm_set_custom_image is not used.
Reply
#66
News Manager Addons version 0.9.3.1
  • fixes issue with custom excerpt length, not working since 0.9.2 (with NM 3.0) (@smsHH)
Reply
#67
Hi Carlos, I will to test it soon.
My website made with GetSimple CMS is

Arte & Società
www.artesocieta.eu

An indipendent website about Italian Contemporary Visual Arts
Reply
#68
custom excerpt length works fine now, i have it on the slider caption Big Grin.. at least it works in my firefox 3.6 ;D
Reply
#69
Hi,

any idea how can I implement random posts based on tags ? I'm trying to create a list of 5 random posts, where tags are sorted from 2 occurencies to more (2 because 1st is shown post, 2nd is related post based on tag..). I'm not very successful Big Grin I don't have effective way of counting tags and assigning posts to them :/

so if 5 posts have 1-2 common tags, they would be skipped and only posts with more unique tags will be displayed, if no other posts, then show at least those posts with common tags..
Reply
#70
News Manager's functions nm_get_posts() and nm_get_tags() return an array of posts (with all fields but content) and an array of tags (associated to post ids having the tag), respectively. These functions may be useful to do what you need.
Reply
#71
thanks for pointing me to right direction, if anybody needs similar posts by tag, here's my code

Code:
$num_post = 5;
$slugs = array();
$url = nm_get_url('post');
$posts = nm_get_tags();
foreach($posts as $tag => $post) {
    if(nm_post_has_tag($tag)) {
        foreach ($post as $slug) {
            $slugs[] = (string)$slug;
        }
    }
}
$slugs = array_unique($slugs);
if(($key = array_search(nm_post_slug(false), $slugs)) !== false) {
    unset($slugs[$key]);
}
shuffle($slugs);
$slugs = array_slice($slugs, 0, $num_post);
$all = nm_get_posts();

echo '<ul class="nm_similar_post">';
foreach ($all as $post) {
    if(in_array($post->slug, $slugs)) {
        echo '<li><a href="'.$url.$post->slug.'" title="'.$post->title.'">'.$post->title.'</a></li>', PHP_EOL;
    }
}
echo '</ul>';
Reply
#72
Very interesting, thanks for sharing it.
Reply
#73
(2015-04-24, 05:13:29)Oleg06 Wrote: works well, but what does the number 5?
Code:
$num_post = 5;

Maximum number of posts to be listed.
Reply
#74
News Manager Addons version 0.9.3.2
  • added support for author's Display Name field (GS 3.2+, News Manager 3.2+)
Reply
#75
The custom display thing is fantastic. It means I can do almost anything with recent posts on a homepage. I have found one very small error in the documentation:
  • {{ post_number }} - number of post as displayed (1 = first)
Should read 
  • {{ post_number }} - number of post as displayed (0 = first)
When I have finished what I am working on I will be able to upload it as a theme. 


Thank you Carlos for this fine plugin.
Reply




Users browsing this thread: 4 Guest(s)