Thread Rating:
  • 6 Vote(s) - 4.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
News Manager (updated)
(2016-04-22, 04:48:12)Carlos Wrote: (To: All)

What custom settings do you mostly use in News Manager?
or
Which ones would you like to (or do you think that should) be directly available in NM settings?

Hi Carlos

...not so much an existing feature... but I'd like a checkbox in post options to make a post not appear in the standard news page NM creates. That way when the option is selected, the post would only appear in search results but not the default page.
Reply
(2016-04-22, 05:12:38)davetest Wrote: ...not so much an existing feature... but I'd like a checkbox in post options to make a post not appear in the standard news page NM creates. That way when the option is selected, the post would only appear in search results but not the default page.

Would it be fine for you if posts having ANY tag were excluded from the main news page?
Reply
(2016-04-24, 01:20:22)Carlos Wrote:
(2016-04-22, 05:12:38)davetest Wrote: ...not so much an existing feature... but I'd like a checkbox in post options to make a post not appear in the standard news page NM creates. That way when the option is selected, the post would only appear in search results but not the default page.

Would it be fine for you if posts having ANY tag were excluded from the main news page?

Hi Carlos. The way I currently use it (on a sports club site) is with the main news page as index.php and I use tags for each team so that some of the posts relating to an individual team will also show on their team page. What I want to do is sometimes exclude a team specific post from the front page (if it really isn't of much interest to others). So I guess if there was some 'magic' tag that excluded posts from the main page that would sort it for me.

So I don't think what you are asking would work for me, but I guess I could do my site differently and not use the main news page and use some tag like "All" to set posts to my home page.
Reply
Can I center the "date tag" ("Published on ...") using the Custom settings? And can I make it smaller (font-size) somehow?
-----------------------------------------------------
Premium HTML5 Ad Banners, Google Ads
and Campaigns

https://netrocket.ch
https://www.kontiko.ch
-----------------------------------------------------
Reply
You can style the post date in your template's css, e.g.:
Code:
.nm_post_date {
  text-align:center;
  font-size: 9px;
}

Or if you use Bootstrap, you can change nm_post_date by the the classes you need, e.g. you could enter this in NM Custom Settings:
Code:
classPostDate "text-center small"
Reply
(2016-05-04, 15:52:57)Carlos Wrote: You can style the post date in your template's css, e.g.:

Code:
.nm_post_date {
 text-align:center;
 font-size: 9px;
}

Or if you use Bootstrap, you can change nm_post_date by the the classes you need, e.g. you could enter this in NM Custom Settings:

Code:
classPostDate "text-center small"

Thank you Carlos, works as expected. One more question: I tried to center the bottom page navigation changing the css properties of the .nm_page_nav class but it doesn't work ...
-----------------------------------------------------
Premium HTML5 Ad Banners, Google Ads
and Campaigns

https://netrocket.ch
https://www.kontiko.ch
-----------------------------------------------------
Reply
Update: It does work! I found the bug myself. Sorry!
-----------------------------------------------------
Premium HTML5 Ad Banners, Google Ads
and Campaigns

https://netrocket.ch
https://www.kontiko.ch
-----------------------------------------------------
Reply
(2016-04-24, 03:49:00)davetest Wrote: Hi Carlos. The way I currently use it (on a sports club site) is with the main news page as index.php and I use tags for each team so that some of the posts relating to an individual team will also show on their team page. What I want to do is sometimes exclude a team specific post from the front page (if it really isn't of much interest to others). So I guess if there was some 'magic' tag that excluded posts from the main page that would sort it for me.
[...]

I've prepared a (temporary) workaround, please check
http://get-simple.info/forums/showthread...7#pid56257
Reply
In NM 3.4 I'm going to remove the NM2COMPAT gsconfig setting.
(It was included in NM 3.0 to make it easy to upgrade from 2.x without changes)
Reply
Hiperlinks inserted on "Create new post" where not showed on the frontend. Then i removed the following:

$content = strip_tags($content);

On line 411 of the file functions.php, i don't find any errors yet, but suppose that this line has a reason to be there.

Could be another workaround?
Reply
(2016-05-12, 16:15:25)Glaucius Wrote: Hiperlinks inserted on "Create new post" where not showed on the frontend. Then i removed the following:

$content = strip_tags($content);

On line 411 of the file functions.php, i don't find any errors yet, but suppose that this line has a reason to be there.

Could be another workaround?

Oops, catched it, this line prevents nm_show_post() to show images inside the post in the list of posts. 

When showing a single post the hiperlinks works fine.
Reply
All HTML tags are removed from excerpts - if not, some of them could be broken or unclosed depending on where the content is cut.

If you need rich excerpts, you can enable NM Custom Settings and enter more 1. Then insert (in source code mode) an <hr> (or <hr />, or <hr class="more" />, ...) in your post content, where you want to do the cut.
Reply
If someone needs to test how News Manager works with a big number of posts, you can use this quick and dirty script:

Code:
<?php
$DIR = 'data/posts';
$NUM = 1000;
$SLUG = 'nm-test-post-';
$STARTDATE = strtotime('1 Aug 2014');
$ENDDATE = strtotime('15 May 2016');

if (isset($_GET['delete'])) {
  foreach(glob($DIR.'/'.$SLUG.'*.xml') as $file)
    unlink($file);
  ?>Test posts deleted. - <a href="<?php echo basename($_SERVER['PHP_SELF']); ?>">Generate test posts</a><?php
} else {
  for ($i = 1; $i <= $NUM; $i++) {
    $str = '<?xml version="1.0" encoding="UTF-8"?><item>
<title><![CDATA[News Manager test post #'.
strval($i)
.']]></title>
<date><![CDATA['.
date("F j, Y, g:i a",$STARTDATE+$i*($ENDDATE-$STARTDATE)/$NUM)
.']]></date>
<tags><![CDATA[nm-test-tag]]></tags>
<private><![CDATA[]]></private>
<image><![CDATA[]]></image>
<content><![CDATA[
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam velit enim, eleifend et odio ut, pulvinar dictum lectus. Praesent vitae vulputate orci, vitae pellentesque sapien. Praesent commodo orci eu erat egestas, sit amet finibus sapien eleifend. Maecenas at ante tincidunt, luctus ex eu, dapibus dolor. Phasellus feugiat vehicula sapien, sit amet dictum dolor interdum at. Vivamus a risus hendrerit, tristique mauris quis, lacinia dolor. Ut sem justo, suscipit facilisis lectus id, porttitor vehicula nunc. Quisque metus enim, sodales at velit ac, sollicitudin imperdiet augue. Morbi ligula velit, mattis in lacinia eget, gravida eu massa. Quisque libero nisi, auctor non nibh quis, tristique congue risus. Vestibulum elementum eros risus, at cursus quam ullamcorper in.
]]></content>
</item>';
    file_put_contents($DIR.'/'.$SLUG.strval($i).'.xml', $str);
  }
  echo $i-1; ?> test posts generated. <a href="<?php echo basename($_SERVER['PHP_SELF']); ?>?delete">Delete them</a>
<?php }
@unlink('data/other/news_manager/posts.xml');

// end of file

Copypaste and save it in your site's root folder with the name you wish, e.g. nm-test-posts.php
Edit the first lines of the script: change the number of posts ($NUM), slug prefix ($SLUG), start/end dates...
Then open it in your browser, e.g.: SITE/nm-test-posts.php
You should see a "xxx test posts generated." message and a "Delete them" link.
That's it. Now you can test how it works both in backend and frontend (maybe in another browser window/tab)

To delete the test posts, you can use the "delete them" link that the script displayed, or else visit SITE/nm-test-posts.php?delete and browse again to the NM admin panel (to refresh)
Reply
Hi together,

There is a Problem I have with News Manager (updated) Version 3.3 .

In my sidebar I have the Code for the Archives:

echo '<div class="section">';
echo '<h2>Archiv</h2>';
nm_list_archives();
echo '</div>';

it works fine but the date-format is englisch, e.G. May 2016.

How to change it into the german date-format, e.G. Mai 2016? The german language is activated in the settings.

Thanks
Peter
Reply
Is it a Windows-based server? If so, please try this: enable NM Custom Settings and enter LOCALE deu

If not, it might be that either your server or host doesn't support German locales, or it's none of the ones currently defined in NM's de_DE.php language file (de_DE.utf8,de.utf8,de_DE.UTF-8,de.UTF-8,de_DE,de) and you have to specify a different one (can you check this?)

Anyway, since NM 3.3 you can define your custom month names. A way to do it is by entering this in Custom Settings:
Code:
MONTHLIST Januar,Februar,März,April,Mai,Juni,Juli,August,September,Oktober,November,Dezember
Reply
Hi Carlos,

at the moment I am using the USB-Webserver local.

I have defined the custom month names in Custom Settings and it works. Thank you very much!

Peter
Reply
Could you please test this?

Try removing the MONTHLIST line from Custom settings and inserting this instead:
LOCALE deu

And after testing this, try with this other:
LOCALE de_DE.utf8,de.utf8,de_DE.UTF-8,de.UTF-8,de_DE,deu,de

and let me know if it works in each case (before you put the MONTHLIST definition back)

Thank you.
Reply
(2016-05-20, 05:52:51)Carlos Wrote: Could you please test this?

Try removing the MONTHLIST line from Custom settings and inserting this instead:
LOCALE deu

And after testing this, try with this other:
LOCALE de_DE.utf8,de.utf8,de_DE.UTF-8,de.UTF-8,de_DE,deu,de

and let me know if it works in each case (before you put the MONTHLIST definition back)

Thank you.

Hi Carlos,

both variants work, I have the german month-names. What is your reason for the both tests?

Peter
Reply
The reason is trying to make NM work properly in most setups.

If simply adding deu to the LOCALE makes it work fine in Windows, I'll do the change in the language file. (I had to do this for Spanish too.)
Reply
(2016-05-20, 23:11:08)Carlos Wrote: The reason is trying to make NM work properly in most setups.

If simply adding deu to the LOCALE makes it work fine in Windows, I'll do the change in the language file. (I had to do this for Spanish too.)

I`m a little bit astonished. I have uploaded the Site to the real www and the german Month-Names  are working out of the box.

http://littlereddog.de/gs/news/

My Hoster is Uberspace. Maybe, this is only a problem on local environments?

Peter
Reply
Probably yes, typically Windows based environments.
Reply
Hi all,

I hope you can help me. I want to change the format News Manager lists the posts, but I can't find which file I need to edit.
Here's a pic of what I currently have and what I want. If someone can tell me which file controls the format posts are outputted I'll probably (maybe) be able to figure out how to do it.

[Image: news_manager_what_to_edit.png]

Basically I have main menu items which link to the News Manager tags, like so:
http://madeupdomain/review/?tag=baselayer
And I want it to output as above so the post image is colour coded to the main menu panels.

Any and all help much appreciated.

Thanks.

C.
Reply
I think you can do most via css in your theme. Just open the console and check the classes on the News page.
Reply
Thanks. I'm no expert, so I'm sure you're right, but I don't see how I can move
Code:
<div class="nm_post_image"> xxxxxxx

to before:
Code:
   <h3 class="nm_post_title"> xxxxxx

using CSS.

But if I know what file is putting this together, I probably can.
Code:
<div class="nm_post">
   <h3 class="nm_post_title"> xxxxxx
   <p class="nm_post_date">Published on May 23, 2016</p>
   <div class="nm_post_image"> xxxxxxx
   <div class="nm_post_content">    </div>
   <p class="nm_post_meta"><b>Tags:</b> <a href="http://scramblekit.uk/review/?tag=clothing">clothing</a> <a href="http://scramblekit.uk/review/?tag=baselayer">baselayer</a></p>
 </div>

What am I missing?
Thanks for the quick response.

C.
Reply
Have you checked the info on: http://www.cyberiada.org/cnb/news-manager/
Reply




Users browsing this thread: 24 Guest(s)