Posts: 43
Threads: 3
Joined: Nov 2012
Hi!
I am trying to use the "I18N Search for News Manager Posts" by Sbatko and I was wondering if News Manager has some general "hidden" tags. I am not sure this is the correct term but I mean something like "_special_news" as for the Special Pages plugin.
This option could be very useful if you wish, for instance, to call the last two or three posts (independently by the posts's specific tag) in a page. Or also when a customer forgets to fill in the tag field.
Thanks
GP
Posts: 2,094
Threads: 54
Joined: Jan 2011
2014-03-12, 21:47:35
(This post was last modified: 2014-03-12, 21:47:51 by mvlcek.)
(2014-03-12, 21:21:58)GPB61 Wrote: I am trying to use the "I18N Search for News Manager Posts" by Sbatko and I was wondering if News Manager has some general "hidden" tags. I am not sure this is the correct term but I mean something like "_special_news" as for the Special Pages plugin.
This option could be very useful if you wish, for instance, to call the last two or three posts (independently by the posts's specific tag) in a page. Or also when a customer forgets to fill in the tag field.
I just looked at the plugin's code. It adds a (virtual) tag _newsmanager to the search index. Thus you will get all news by searching for tag _newsmanager.
Posts: 43
Threads: 3
Joined: Nov 2012
(2014-03-12, 21:47:35)mvlcek Wrote: I just looked at the plugin's code. It adds a (virtual) tag _newsmanager to the search index. Thus you will get all news by searching for tag _newsmanager.
Oh yes, I see, thank you very much to point it out!
This is a very useful plugin, even if it looks like that it only renders title and excerpts while some other fields from NM (i.e. image and "readmore") are missing. And also it doesn't render the publication date, I get only an empty <div>. Or perhaps, it is me not able to set it properly.
Posts: 12
Threads: 2
Joined: Mar 2014
(2014-03-12, 22:07:53)GPB61 Wrote: (2014-03-12, 21:47:35)mvlcek Wrote: I just looked at the plugin's code. It adds a (virtual) tag _newsmanager to the search index. Thus you will get all news by searching for tag _newsmanager.
Oh yes, I see, thank you very much to point it out!
This is a very useful plugin, even if it looks like that it only renders title and excerpts while some other fields from NM (i.e. image and "readmore") are missing. And also it doesn't render the publication date, I get only an empty <div>. Or perhaps, it is me not able to set it properly.
Hi
I replied You in this thread about date issue:
http://get-simple.info/forums/showthread...6#pid43696
I'm waiting for information from you
Greets
Sebastian
Posts: 3,491
Threads: 106
Joined: Mar 2010
(2014-03-12, 21:21:58)GPB61 Wrote: This option could be very useful if you wish, for instance, to call the last two or three posts (independently by the posts's specific tag) in a page. Or also when a customer forgets to fill in the tag field.
Just a quick comment. You could also display the latest n posts (by tag or independently of the tag) with the NM Addons plugin: it allows to customize the html output, and supports NM beta's images.
Posts: 43
Threads: 3
Joined: Nov 2012
Sorry, Carlos, I didn't look with more attention to the other threads.
And, of course, thank you, this is doing the job!
GP
Posts: 3,491
Threads: 106
Joined: Mar 2010
(2014-03-12, 10:13:06)TeeJay Wrote: I was expecting <hr> to only solve the issue with the truncating intro text in the middle of a sentence, but it also (maybe accidentally) disables escaping HTML tags like <strong> in the excerpts. It looks much better, doesn't it?
It's intentional. It's what people had asked for time ago (and I wanted to have)
Now you can choose between:
- excerpt without html tags
- full content with html tags
- content before "<hr" preserving html tags (kind of "rich excerpt")
(You can use different custom settings for each news page type, and set a default for when there's no "<hr" in the content.)
(2014-03-12, 10:13:06)TeeJay Wrote: Now I'm thinking how could we solve the same issue in the sidebar list of post which requires much shorter excerpts, I have no idea so far... never mind.
I have to make some changes to NM Addons so that it supports this new "more" option.
However this is not what you need, I suppose. After taking a look to your personal site I would suggest you change the ellipsis to "..." and enable the "readmore" link there too. Maybe it'd look better (just MHO, it's what I'm used to see on the web)
Thanks for the feedback as always. I will answer the rest of your post later...
Posts: 12
Threads: 2
Joined: Mar 2014
(2014-03-12, 10:13:06)TeeJay Wrote: PS: Could interest D.O. :
I have discovered an obvious issue with using nm_show_tag('foo') for to replace "categories" of articles in your main menu. As all those articles under specified "categories" actually belong to "news" menu item (or any other, but it's always only 1 of the categories), whenever you click onto any of articles from anywhere, you'll always loose the current class on the "category" you were looking at. Instead, "news" category gets chosen. It's logical and obvious, I just didn't think of it before, so I wanted to point it out.
Carlos, would you guess what I'd like you to introduce? :-P Just kidding, when real categories become your #1, I'm sure you'll let us know. You're doing a great job.
Hi
Today I worked on categories of News and find sulution but need some help.
My setup:
1. Create 2 new entries in .htaccess file BEFORE original News Manager entries:
Code: RewriteRule ^category/(.*)/(.*)/(.*)$ index.php?id=category&category=$1&dummy=$2&slug=$3 [L]
RewriteRule ^category/([^/.]+)/?$ index.php?id=category&category=$1 [L]
2. Create component (i like writing small php code pieces in components and inserting them by DynPages plugin) with this content:
Code: <?php
global $NMPAGEURL;
$kat=@$_GET['category'];
$slug=@$_GET['slug'];
if (!$slug=='') {
nm_show_post($slug,false,false);
} else {
$NMPAGEURL = 'category/'.$kat;
nm_show_tag($kat);
}
?>
Name it 'menu_category'. Trick is temporary changing global $NMPAGEURL so links generated by [i]nm_show_tag[/] begins with 'category/' (not 'news/').
3. Create normal page with slug 'category', write any content You want and insert DynPages directive '{% menu_category %}'.
In this place component inserts list of articles with selected tag when url is like:
where '_software' is virtual tag of News Manager posts
OR
News Manager post when link is like:
Code: /category/_software/post/any-news-manager-slug
By using this setup You achieve real categories out of '/news/' context.
Of course You may modify this setup to accomplish Your needs.
Now my question: when modifying $NMPAGEURL and displaying posts with nm_show_tag on '/category/_software' url lots of warnings and notices is shown. Probably my .htaccess modifications are not ideal.
Any suggestions how to improve it? works but not perfectly
Posts: 3,491
Threads: 106
Joined: Mar 2010
(2014-03-12, 10:13:06)TeeJay Wrote: I have discovered an obvious issue with using nm_show_tag('foo') for to replace "categories" of articles in your main menu. As all those articles under specified "categories" actually belong to "news" menu item (or any other, but it's always only 1 of the categories), whenever you click onto any of articles from anywhere, you'll always loose the current class on the "category" you were looking at. Instead, "news" category gets chosen. It's logical and obvious, I just didn't think of it before, so I wanted to point it out.
I am adding another conditional function ( nm_post_has_tag) that will allow checking if the current single post has a given tag.
So you'll be able to use it for what you say, like:
Code: if (nm_post_has_tag('foo'))
get_navigation('foo-page');
else
get_navigation(return_page_slug());
Posts: 206
Threads: 7
Joined: Mar 2013
2014-03-14, 07:23:45
(This post was last modified: 2014-03-14, 07:24:05 by TeeJay.)
(2014-03-14, 06:44:48)Carlos Wrote: I am adding another conditional function (nm_post_has_tag) that will allow checking if the current single post has a given tag.
So you'll be able to use it for what you say, like:
Code: if (nm_post_has_tag('foo'))
get_navigation('foo-page');
else
get_navigation(return_page_slug());
Okay, looks promising
Does it mean that NM will generate its menu completely on its own or is it going to use GS/I18N functions? I have always been using get_i18n_navigation.
Posts: 3,491
Threads: 106
Joined: Mar 2010
That code snippet is just an example for use with a standard/default GS template. If you use e.g. I18N or Hierarchical Menus to generate your nav, you'll want to replace get_navigation by get_i18n_navigation (with the corresponding parameters) or get_hierarchical_navigation/get_top_navigation, ...
This is for highlighting (that is, addng the current class to) a different menu item (your "pseudo-category" page) instead of the news page.
The example is for only one tag. For several ones it would be a bit longer (some elseif's or a conditional switch - ask for it when you need it)
Posts: 3,491
Threads: 106
Joined: Mar 2010
I've consolidated most of the scattered info about NM beta's new features, settings, etc. into this documentation page.
It's a draft, needs to be completed and improved a lot, but at least you only have to look at one place now.
PS I'm using Shawn's great SA Toc Anchors plugin for the table of contents.
Posts: 1,928
Threads: 88
Joined: Apr 2010
When can we expect a stable version? no beta
Posts: 321
Threads: 15
Joined: Feb 2012
<?php nm_tag_list(); ?>
Perfect I was waiting for the stable version
I can remove my pacth from Partenope.org now
My website made with GetSimple CMS is
Arte & Società
www.artesocieta.eu
An indipendent website about Italian Contemporary Visual Arts
Posts: 3,491
Threads: 106
Joined: Mar 2010
(2014-03-26, 05:12:37)Oleg06 Wrote: When can we expect a stable version? no beta
Soon after you have sent me (or posted) your bug reports. :-)
Seriously, I intend to add a couple more features for yet another beta, and after that I'll probably release some kind of stable version.
However I'm a bit busy with other stuff, so sorry, I can't tell you when.
Posts: 8
Threads: 1
Joined: Dec 2012
How can I put the "nm_list_archives" function in a web page (not in a sidebar or template)?
Posts: 321
Threads: 15
Joined: Feb 2012
2014-04-04, 18:10:48
(This post was last modified: 2014-04-05, 01:27:31 by D.O..)
Interesting question.
I always modified my template or used a component to do that...
Anway, you could try to use thi plugin
http://mvlcek.bplaced.net/get-simple/dynpages
Good Luck
My website made with GetSimple CMS is
Arte & Società
www.artesocieta.eu
An indipendent website about Italian Contemporary Visual Arts
Posts: 12
Threads: 2
Joined: Mar 2014
(2014-04-04, 17:13:55)ochsadad Wrote: How can I put the "nm_list_archives" function in a web page (not in a sidebar or template)?
You can put code in component and insert component to page via DynPages plugin (accepts parameters also) - it's my favorite way
http://get-simple.info/extend/plugin/dynpages/81/
Posts: 8
Threads: 1
Joined: Dec 2012
(2014-04-04, 19:02:02)sbatko Wrote: (2014-04-04, 17:13:55)ochsadad Wrote: How can I put the "nm_list_archives" function in a web page (not in a sidebar or template)?
You can put code in component and insert component to page via DynPages plugin (accepts parameters also) - it's my favorite way
http://get-simple.info/extend/plugin/dynpages/81/
Thanks to you and D.O. for the suggestions.
DynPages worked great (quick and easy)!
Posts: 3,491
Threads: 106
Joined: Mar 2010
(2014-04-04, 17:13:55)ochsadad Wrote: How can I put the "nm_list_archives" function in a web page (not in a sidebar or template)?
As sbatko says, you can use the Dynpages plugin, create a component named e.g. listarchives with this content:
Code: <?php nm_list_archives(); ?>
and call it in your archive page by inserting this in the body:
Another way is inserting this in your template, before or after the <?php get_page_content(); ?> line:
Code: <?php if (return_page_slug()=='archivepage') nm_list_archives(); ?>
(where archivepage is the slug (page id) of the page where you want the archives to be displayed)
[edit] I hadn't seen your last post, it seems I was typing while you published it... :-)
Posts: 8
Threads: 1
Joined: Dec 2012
(2014-04-05, 00:44:03)Carlos Wrote: (2014-04-04, 17:13:55)ochsadad Wrote: How can I put the "nm_list_archives" function in a web page (not in a sidebar or template)?
As sbatko says, you can use the Dynpages plugin, create a component named e.g. listarchives with this content:
Code: <?php nm_list_archives(); ?>
and call it in your archive page by inserting this in the body:
Another way is inserting this in your template, before or after the <?php get_page_content(); ?> line:
Code: <?php if (return_page_slug()=='archivepage') nm_list_archives(); ?>
(where archivepage is the slug (page id) of the page where you want the archives to be displayed)
[edit] I hadn't seen your last post, it seems I was typing while you published it... :-)
Thanks for the other alternatives, Carlos.
Posts: 3,491
Threads: 106
Joined: Mar 2010
I've added a custom setting to enable prev/next pagination on tag pages, just like in the main news page. It's already in the dev version and will be available in the next beta.
There are two flavours: one that appends &page=N to the URL, and another that does it like /page/N.
The first one (default/dynamic) works without changes, both with and without fancy urls enabled.
However for the second one (fancy/folder-style) it is necessary to add a new rewriterule in the .htaccess file. I don't know much about this, but after playing a bit this seems to work (example for slug news):
Code: RewriteRule ^news/tag/([^/.]+)/page/([^/.]+)/?$ index.php?id=news&tag=$1&page=$2 [L]
Can anyone tell me if this is correct, or should I change something? Thanks.
Posts: 321
Threads: 15
Joined: Feb 2012
Amazing News!
Well maybe we should test it
to find some bug in that RewriteRule
(2014-04-11, 06:13:49)Carlos Wrote: I've added a custom setting to enable prev/next pagination on tag pages, just like in the main news page. It's already in the dev version and will be available in the next beta.
There are two flavours: one that appends &page=N to the URL, and another that does it like /page/N.
The first one (default/dynamic) works without changes, both with and without fancy urls enabled.
However for the second one (fancy/folder-style) it is necessary to add a new rewriterule in the .htaccess file. I don't know much about this, but after playing a bit this seems to work (example for slug news):
Code: RewriteRule ^news/tag/([^/.]+)/page/([^/.]+)/?$ index.php?id=news&tag=$1&page=$2 [L]
Can anyone tell me if this is correct, or should I change something? Thanks.
My website made with GetSimple CMS is
Arte & Società
www.artesocieta.eu
An indipendent website about Italian Contemporary Visual Arts
Posts: 5
Threads: 0
Joined: Mar 2014
2014-04-12, 04:46:05
(This post was last modified: 2014-04-12, 07:46:31 by wass.)
On the local I'm testing NM beta with Addon, news code -- if nm_show_tag ('de'); else nm_show_tag ('en');--
I can't save maximum pages "Number of posts on News Page:" and nm_set_custom_maxposts not responding also.
and then how to do pagination?
Posts: 3,491
Threads: 106
Joined: Mar 2010
nm_set_custom_maxposts is intended for use with the other NM Addons functions, like nm_custom_display_recent, etc. It doesn't work with NM's internal function nm_show_tag, that simply displays all posts with the given tag.
As for your if ... code, I suppose it's some kind of pseudocode - I think it wouldn't work like that, looks like it's not complete, it's missing some conditional, etc.
Pagination on tag pages will be available in next beta. If you or anyone wants to test it now, download the zip for the current development version: https://github.com/cnb/News_Manager-getsimplecms
(To use this option, enable Custom Settings and enter tagpagination d).
But note that this will not work with the if ... nm_show_tag... trick - I'm using a new function for tag pages pagination, nm_show_tag_page (that shows the prev/next links)
Anyway: I'm not sure what you want to accomplish. If it's just showing the latest n posts in a certain page, with no pagination, you can do with NM Addons, by using nm_custom_display_recent (that allows filtering by tag). If so, I can give you an example.
|