Posts: 3,491
Threads: 106
Joined: Mar 2010
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.
Posts: 8
Threads: 2
Joined: Oct 2013
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.
Posts: 4
Threads: 0
Joined: Jan 2014
I do not understand how to make the navigation on the news page: [1] [2] [3] etc
Posts: 3,491
Threads: 106
Joined: Mar 2010
(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.
Posts: 3,491
Threads: 106
Joined: Mar 2010
(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)
Posts: 8
Threads: 2
Joined: Oct 2013
(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!
Posts: 8
Threads: 2
Joined: Oct 2013
Carlos, it works like a dream. Thanks so much!
Posts: 6,266
Threads: 181
Joined: Sep 2011
how stable is this for production site ?
Posts: 4
Threads: 0
Joined: Jan 2014
(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.
Posts: 3,491
Threads: 106
Joined: Mar 2010
@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.
Posts: 6,266
Threads: 181
Joined: Sep 2011
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.
Posts: 3,491
Threads: 106
Joined: Mar 2010
(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.
Posts: 6,266
Threads: 181
Joined: Sep 2011
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.
Posts: 3,491
Threads: 106
Joined: Mar 2010
Yes. Doing this to insert the post title in the <title> tag.
Can be disabled with custom setting titleTag 0
Posts: 6,266
Threads: 181
Joined: Sep 2011
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; } }
Posts: 3,491
Threads: 106
Joined: Mar 2010
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.
Posts: 6,266
Threads: 181
Joined: Sep 2011
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 ?
Posts: 3,491
Threads: 106
Joined: Mar 2010
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/
Posts: 6,266
Threads: 181
Joined: Sep 2011
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!
Posts: 3,491
Threads: 106
Joined: Mar 2010
@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.
Posts: 6,266
Threads: 181
Joined: Sep 2011
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
Posts: 3,491
Threads: 106
Joined: Mar 2010
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:
If you want the prev/next links but don't want the numbers between them, use this custom setting:
If for any reason you need to disable the navigation,
These are the new language strings (can be redefined in Custom settings or in gsconfig with $nm_i18n[...]):
Code: PREV_TEXT <
PREV_LINK "Previous page"
NEXT_TEXT >
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. :-)
Posts: 206
Threads: 7
Joined: Mar 2013
2014-06-21, 05:01:27
(This post was last modified: 2014-06-21, 05:01:38 by TeeJay.)
Seems very nice. Next week I'm going to go through all the updates since beta 18 and become up-to-date again
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.
Posts: 3,491
Threads: 106
Joined: Mar 2010
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)
Posts: 1,908
Threads: 86
Joined: Apr 2010
|