Thread Rating:
  • 6 Vote(s) - 4.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
News Manager (updated)
(2019-03-12, 00:49:05)Carlos Wrote: (replying to http://get-simple.info/forums/showthread...5#pid63895 )
(2019-03-11, 22:47:15)acenda Wrote: News Manager updated (Great plugin, but little problems with post pictures and social media. Made it work, but picture should be invisible in posts and post list. Only visible in social media og:image)

Enable NM Custom Settings and enter:
Code:
showImages 0

Nice! Thanks mate Smile
Reply
Hi Carlos. How can I use the post picture in og:image? Is there a way to print picture's url?
Thanks! Smile
Reply
(2019-03-15, 23:28:23)acenda Wrote: Hi Carlos. How can I use the post picture in og:image? Is there a way to print picture's url?
Thanks! Smile

You can use nm_post_image_url() with optional parameters width, height, crop (see NM template tags (since 3.0))

Example (insert in your template's <head> section):
Code:
<?php if (nm_post_has_image()) { ?>
<meta property="og:image" content="<?php nm_post_image_url(640,480,1); ?>">
<?php } ?>
Reply
How about, or is there, funktion that one can select in post options which page to show each news?.
Like if i have news about football i can select from post options to show that football news in football page etc Big Grin.
Reply
(2019-03-16, 00:47:24)Carlos Wrote:
(2019-03-15, 23:28:23)acenda Wrote: Hi Carlos. How can I use the post picture in og:image? Is there a way to print picture's url?
Thanks! Smile

You can use nm_post_image_url() with optional parameters width, height, crop (see NM template tags (since 3.0))

Example (insert in your template's <head> section):
Code:
<?php if (nm_post_has_image()) { ?>
<meta property="og:image" content="<?php nm_post_image_url(640,480,1); ?>">
<?php } ?>

Ok, many thanks mate! Smile
Reply
How to hide specifig news and specifig tag?.
Like if i have news "Salmon fishing" tagget with "fishing", and i dont want to that "Salmon fishing" news appear in in news listing page and i dont want tag "fishing" appear in tag cloud,tag listing etc.
Reply
(2019-03-18, 18:36:07)Riianna Wrote: How about, or is there, funktion that one can select in post options which page to show each news?.
Like if i have news about football i can select from post options to show that football news in football page etc Big Grin.

That's not currently possible, sorry.
Reply
(2019-04-01, 18:23:51)Riianna Wrote: How to hide specifig news and specifig tag?.
Like if i have news "Salmon fishing" tagget with "fishing", and i dont want to that "Salmon fishing" news appear in in news listing page and i dont want tag "fishing" appear in tag cloud,tag listing etc.

You can:

- use "invisible tags" (prefix tags with an underscore, like _mytag)

and/or

- Exclude posts by tag:
Code:
define('NMDEFAULTEXCLUDETAGGED', 'mytag1,mytag2,mytag3');
(insert in gsconfig)
more info here
Reply
(2019-02-26, 05:51:41)Carlos Wrote: Insert this in your template, before <?php get_header(); ?>

Code:
<?php
$arr =array(
    "tag1" => "This is the meta description for tag1",
    "tag2" => "This is the meta description for tag2",
    "tag3" => "This is the meta description for tag3",
    // etc...
);
if (nm_is_tag()) foreach ($arr as $t=>$m) if (nm_is_tag($t)) {$metad=$m; break;}
?>

(If you prefer to have it in a component or a function, a small change would be required.)

Hello, Carlos!

When this code is inserted directly in template everything works just fine. But when I'm trying to use this as a component there is no meta description in the page source code...

The component code:

Code:
<?php
$arr = array(
"сравнение" => "Метаописание для тега сравнение",
"вывески" => "Метаописание для тега вывески",
);
if (nm_is_tag()) foreach ($arr as $t=>$m) if (nm_is_tag($t)) {$metad=$m; break;}
?>


The component in template:

Code:
<head>
    //some code here

    <?php get_component('tagsmeta'); ?>
        
    <?php nm_get_header(); ?>

    //some code here

</head>

What am I doing wrong? Smile
Reply
To make it work in a component, insert this:

Code:
global $metad;

just after the <?php tag.
Reply
(2019-04-23, 02:16:21)Carlos Wrote: To make it work in a component, insert this:

Code:
global $metad;

just after the <?php tag.

Thank you very much! It works Smile
Reply
Hello!

The NM setting is set Enable post image -> Yes.

If I do not select an image when creating new news - is there a way to set the default image, but only in the sidebar. I use the following code:

PHP Code:
<?php nm_custom_display_recent(
'<div class="my_recent_{{ post_number }}" style="padding:15px 0; border-bottom:solid #ddd 1px;">
    <h2><a href="{{ post_link }}">{{ post_title }}</a></h2>
        <p><a href="{{ post_link }}">{{ post_image }}</a></p>
        <span class="my_excerpt">{{ post_excerpt }}</span>
</div>'
);?>

Thank you,
Reply
See here: http://get-simple.info/forums/showthread...7#pid64237
Reply
(2019-05-10, 05:10:29)Carlos Wrote: See here: http://get-simple.info/forums/showthread...7#pid64237

Thanks, that's it.
Reply
I'd love to be able to customize News Manager (updated) to use it for a What's-on, or Coming Events page. So I'm wondering if it is possible to customise the published date field so that it would be my event date. That would mean I'd have to have NM display future dated posts.

All advice welcome please, or has anything similar been done before?
Reply
(2019-07-27, 20:50:30)davetest Wrote: I'd love to be able to customize News Manager (updated) to use it for a What's-on, or Coming Events page. So I'm wondering if it is possible to customise the published date field so that it would be my event date. That would mean I'd have to have NM display future dated posts.

All advice welcome please, or has anything similar been done before?

You can do it with the NM Addons plugin. An example here:
http://get-simple.info/forums/showthread...1#pid63451
Reply
Thank you Carlos. Absolutely brilliant, just what I needed. Please can you let me have code to use for your 'past events' example? Thanks again.
Reply
Just insert a link to the 'events' (or whatever) tag page:
example.com/newspage/tag/events
or
example.com/newspage/?tag=events
or... (others, depending on your GS and NM permalink setup)
Reply
Thanks Carlos. Got it.
Back to the original question of creating a future events list ( I'm putting mine inside another page via DynPages), I've just noticed that any events dated today don't appear with the future events. Is it possible to get then to show, or any other way to just show toda's seperately?
Reply
You can set their time to 23:59, so that they are future posts (until 00:00 is reached).
Reply
I'll add an option to display today's posts.
Reply
Thanks Carlos, you're a star. your 23:59 trick worked a treat, but this will be even better.
Reply
Is there a way to display the meta description of posts with nm_custom_display_recent like


PHP Code:
nm_custom_display_recent("Title: {{ post_title }}<br>Description: {{ post_metad }}");   

Alex
Reply
Not currently, but I'll add support for that.
Reply
Hi Carlos. One of my clients has a problem with set and News Manager. For some reason, sitemap doesn't show posts. There is only sites. Is there an easy solution? Big Grin GS version 3.15 and NMu version 3.6.
Reply




Users browsing this thread: 19 Guest(s)