GetSimple Support Forum
News Manager (updated) - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: Plugins (http://get-simple.info/forums/forumdisplay.php?fid=13)
+--- Thread: News Manager (updated) (/showthread.php?tid=3972)



RE: News Manager (updated) - Carlos - 2014-06-09

News Manager 3.0 beta 22 - Download / Info

Changes (since beta 21):
  • content filter applied in functions nm_show_tag, nm_show_post, etc. when used as template tags - so placeholders, etc. will be processed by other plugins (including NM Authors) - thanks @Oleg06 for reporting
  • updated/expanded .htaccess sample file (like the one in GS 3.3) - thanks @snooze
Feedback appreciated, etc.


RE: News Manager (updated) - jeherrin - 2014-06-10

I'm using the last stable of New Manager (2.4.6) and I'm very pleased with it.

The site I'm working on has two basic template files — the main, default template file for the overall site, and a second blog template to deal with and style the blog page. In the interests of making the site responsive and mobile-friendly, my CSS uses media queries to restyle the site depending on the viewer's browsing device.

On the desktop site view, News Manager is set to display full posts, with five posts per page (the client tends to write quite long posts!) but on the mobile view, I'd like it to change to titles and excerpts, rather than showing the full thing. Is there a way to set this in the template rather than in the options? This way, I can use CSS to show/hide content container divs as required — I'll have two content divs, each with the blog, but the second div set to only show excerpts, and set via the CSS to only display on certain screen sizes.

It's very possible I'm simply missing something obvious here!

Thanks.


RE: News Manager (updated) - tapioka - 2014-06-11

I do not understand how to make the navigation on the news page: [1] [2] [3] etc


RE: News Manager (updated) - Carlos - 2014-06-11

(2014-06-11, 03:08:50)tapioka Wrote: I do not understand how to make the navigation on the news page: [1] [2] [3] etc

Not currently possible, though it's in the to-do list.


RE: News Manager (updated) - Carlos - 2014-06-11

(2014-06-10, 21:46:55)jeherrin Wrote: The site I'm working on has two basic template files — the main, default template file for the overall site, and a second blog template to deal with and style the blog page. In the interests of making the site responsive and mobile-friendly, my CSS uses media queries to restyle the site depending on the viewer's browsing device.

On the desktop site view, News Manager is set to display full posts, with five posts per page (the client tends to write quite long posts!) but on the mobile view, I'd like it to change to titles and excerpts, rather than showing the full thing. Is there a way to set this in the template rather than in the options? This way, I can use CSS to show/hide content container divs as required — I'll have two content divs, each with the blog, but the second div set to only show excerpts, and set via the CSS to only display on certain screen sizes.

Very interesting.
With News Manager 3.0 ("beta but usable") you can use some of its new functions to do something like this: in your blog template, replace
PHP Code:
<?php get_page_content(); ?>
by
PHP Code:
<?php if (nm_is_main()) { ?>
<div id="desktop_version">
<?php get_page_content(); ?>
</div>
<div id="mobile_version">
<?php nm_set_option('excerpt',1); nm_show_page(intval(@$_GET[NMPARAMPAGE])); ?>
</div>
<?php } else { get_page_content(); } ?>

(change the id's by the ones you like, or classes if you prefer)


RE: News Manager (updated) - jeherrin - 2014-06-11

(2014-06-11, 05:20:25)Carlos Wrote:
(2014-06-10, 21:46:55)jeherrin Wrote: The site I'm working on has two basic template files — the main, default template file for the overall site, and a second blog template to deal with and style the blog page. In the interests of making the site responsive and mobile-friendly, my CSS uses media queries to restyle the site depending on the viewer's browsing device.

On the desktop site view, News Manager is set to display full posts, with five posts per page (the client tends to write quite long posts!) but on the mobile view, I'd like it to change to titles and excerpts, rather than showing the full thing. Is there a way to set this in the template rather than in the options? This way, I can use CSS to show/hide content container divs as required — I'll have two content divs, each with the blog, but the second div set to only show excerpts, and set via the CSS to only display on certain screen sizes.

Very interesting.
With News Manager 3.0 ("beta but usable") you can use some of its new functions to do something like this: in your blog template, replace
PHP Code:
<?php get_page_content(); ?>
by
PHP Code:
<?php if (nm_is_main()) { ?>
<div id="desktop_version">
<?php get_page_content(); ?>
</div>
<div id="mobile_version">
<?php nm_set_option('excerpt',1); nm_show_page(intval(@$_GET[NMPARAMPAGE])); ?>
</div>
<?php } else { get_page_content(); } ?>

(change the id's by the ones you like, or classes if you prefer)

Awesome. I'll give this a bash!


RE: News Manager (updated) - jeherrin - 2014-06-11

Carlos, it works like a dream. Thanks so much!


RE: News Manager (updated) - shawn_a - 2014-06-11

how stable is this for production site ?


RE: News Manager (updated) - tapioka - 2014-06-11

(2014-06-11, 04:14:43)Carlos Wrote:
(2014-06-11, 03:08:50)tapioka Wrote: I do not understand how to make the navigation on the news page: [1] [2] [3] etc

Not currently possible, though it's in the to-do list.

Oh, thank you. We will wait with impatience.


RE: News Manager (updated) - Carlos - 2014-06-12

@jeherrin You're welcome. Nice to know it works for you.

@shawn_a I think it's stable enough. I'll release it to Extend shortly.


RE: News Manager (updated) - shawn_a - 2014-06-17

spaces in tags are removed unlike gs page tags.

Is it possible to override the GS $title on article pages so the GS $title is the article title, and skip showing the title in the content ? Seems like it would be useful to not have to create a custom template for news pages, and use any existing gs template.


RE: News Manager (updated) - Carlos - 2014-06-17

(2014-06-17, 01:12:51)shawn_a Wrote: spaces in tags are removed unlike gs page tags.

I suppose you're using NM 2.x
That's the normal behaviour, spaces are not allowed.
In 3.0 that changes, almost any character are allowed.

(2014-06-17, 01:12:51)shawn_a Wrote: Is it possible to override the GS $title on article pages so the GS $title is the article title, and skip showing the title in the content ? Seems like it would be useful to not have to create a custom template for news pages, and use any existing gs template.

I had thought about it, but I'm not sure I like it this way. Maybe I'll add an option for that later.
It's easy to customize with some if instead of several templates.


RE: News Manager (updated) - shawn_a - 2014-06-17

Yeah old version ,whoops.

Are you setting global $title and then setting it back?
Cause I am unable to override it myself, so i am assuming it is being set back $data_index somewhere.


RE: News Manager (updated) - Carlos - 2014-06-17

Yes. Doing this to insert the post title in the <title> tag.

Can be disabled with custom setting titleTag 0


RE: News Manager (updated) - shawn_a - 2014-06-17

PHP Code:
function nm_restore_page_title() {
  if (!
nm_is_single() || !nm_get_option('titletag',true) || function_exists('nmt_set_gstitle')) {
    return;
  } else {
    global 
$title$data_index;
    
$title $data_index->title;
  }

Needs to restore $title back to $title, not data-index, since anyone can modify it after index-post-dataindex

maybe

PHP Code:
// patch for <title> tag
function nm_update_page_title() {
  if (!
nm_is_single() || !nm_get_option('titletag',true) || function_exists('nmt_set_gstitle')) {
    return;
  } else {
    global 
$title,$nmtitle_old;
    
$nmtitle_old $title;
    
$title nm_post_title('',' - '.$title,false);
  }
}

// restore original title - <title> tag patch
function nm_restore_page_title() {
  if (!
nm_is_single() || !nm_get_option('titletag',true) || function_exists('nmt_set_gstitle')) {
    return;
  } else {
    global 
$title$nmtitle_old$data_index;
    
$title $nmtitle_old;
  }




RE: News Manager (updated) - Carlos - 2014-06-17

That's how I was going to do initally, like the NM Title plugin already does, using a temp global...
I'll look into it, thanks.


RE: News Manager (updated) - shawn_a - 2014-06-17

I am trying to override the title with the news title for page title also ( just like meta title ), but was unable to. lol I also need to hide the nm title in content, is there a optiontag for that ?
Is there a list of options ?


RE: News Manager (updated) - Carlos - 2014-06-17

Display post title if in single view, but normal page title if not:
<?php nm_post_title() or get_page_title(); ?>

Hiding title in single post view - custom setting:
single showFields date,author,image,content,tags
(default is title,date,author,image,content,tags)

List of new settings/options in 3.0 (draft):
http://www.cyberiada.org/cnb/news-manager-b/


RE: News Manager (updated) - shawn_a - 2014-06-17

Ok that is what i figure, did not know if that was the final doc page ( titleTag you mentioned above is not noted there )
Thanks!


RE: News Manager (updated) - Carlos - 2014-06-17

@shawn_a
Oh sorry, this was added to latest betas and forgot to add it to the docs I believe.

@tapioka
Next beta will have numbered page navigation.


RE: News Manager (updated) - shawn_a - 2014-06-17

fyi my workaround for using nmtitle as page heading
PHP Code:
<?php
# hook_theme-header
GLOBAL $id,$title,$data_index,$NMPAGEURL;
if(
$id == $NMPAGEURL)$data_index->title $title nm_post_title('','',false);
?>

I could add a check i guess to make sure this is necessary and that the nm title override already ran, but in my case its always executed before my hook.


also collecting info here for core enhancements related to titles and stuff
https://github.com/GetSimpleCMS/GetSimpleCMS/issues/831


RE: News Manager (updated) - Carlos - 2014-06-21

News Manager 3.0 beta 23 - Download / Info

Changes (since beta 22):
  • completed Danish translation (thanks @chrsand)
  • pagination starts at 1 instead of 0 (so the second page (URL) is 2 instead of 1, etc.)
  • numbered + prev/next navigation (as default - older/newer now optional) (@tapioka)
  • new strings in language files for prev/next links (texts and link titles)
  • several slight changes

Pagination index (page= or page/ in URL) starts now at 1 instead of 0 by default.
This can be changed back to the old way with a new custom setting:
Code:
define('NMFIRSTPAGE',0);

If you don't want the new prev/next numbered navigation and prefer the classic Older/Newer links, use this new custom setting:
Code:
navOldNew 1

If you want the prev/next links but don't want the numbers between them, use this custom setting:
Code:
navNumber 0

If for any reason you need to disable the navigation,
Code:
showNav 0

These are the new language strings (can be redefined in Custom settings or in gsconfig with $nm_i18n[...]):
Code:
PREV_TEXT &lt;
PREV_LINK "Previous page"
NEXT_TEXT &gt;
NEXT_LINK "Next page"
(default English values shown)

Opinions and feedback is very welcome.

Unless there's some issue, this should be another release candidate. :-)


RE: News Manager (updated) - TeeJay - 2014-06-21

Seems very nice. Next week I'm going to go through all the updates since beta 18 and become up-to-date again Smile

I just want to ask as I can't try it right now - when you are browsing through pages 1, 2, 3... does the current page number link have a class="current" attribute or something like that?

Anyway, great work again, thanks for that.


RE: News Manager (updated) - Carlos - 2014-06-21

Oh sorry, I forgot to comment about styling the navigation. Yes, it's class="current"
It's done very like in I18N Search's navigation:

Previous page: <span class="previous"><a href="...
Number links: <span><a href="...
Current number: <span class="current">...
Next page: <span class="next"><a href="...

(inside a <div class="nm_page_nav">, like with Older/Newer nav)


RE: News Manager (updated) - Oleg06 - 2014-06-21

great plugin <span class="current"> http://www.without-db.ru/demo/000/news/page/2