Thread Rating:
  • 6 Vote(s) - 4.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
News Manager (updated)
(2014-03-11, 09:56:16)Lucianp Wrote: Thanks Carlos,
1.
Quote:(I assume you want to associate images to posts so that they're shown e.g. in the main news page - of course you can just insert images in the post content just like with normal pages)
Yes, sort of :-) What I was trying for, was to have the images show in the the excerpt so they would be dominant in a handheld (RWD). It seems that is not possible so my other option would be added to the content, which I thought I was doing in the source of Edit Post. I am assuming the PHP syntax is
Code:
<img src="<?php get_site_url(); ?><?php get_theme_url(); ?>/group-of-pets.png" alt="picture of domestic pets" />
but when I added it, the content disappeared from the excerpt and there was no image in the full page. So my syntax must be wrong. What should it be?

2. I had actually changed
Code:
ELLIPSIS =>"[...]" to "ELLIPSIS"            =>  " ... read more"
, in plugins/news_manager/en_US
I changed the code to
Code:
ELLIPSIS ""
READ_MORE [...]
but lost everything. Obviously I'm doing it in the wrong place. Where should it be?


3.Ok, that's fine.

You probably noticed, PHP is not a strong point yet so your response and help is appreciated.

thanks


Hi,

1) The only way how to put an image next to the excerpt is via the administration. But as Carlos said, you have to use News Manager Beta, current version is 2.5.17. Here is an example how does it look like with the beta on my website.

2) You have to write it in the textarea in the News Manager setting (in the GS administration). But this feature is available only in the beta, too, and the textarea for those special settings is also only in the beta.

Beta 17 is the latest News Manager and though it's not officially stable, I'm using it on all production sites I do including my blog without any problems, there aren't any bugs I would say. And it gives so much more features Smile

Give a chance to the beta, you'll love it.


And thank you Carlos for the last release, especially the feature I asked for, I'm gonna try it tomorrow... ehh, it's morning already, so in the afternoon Smile
Tomáš Janeček - Multilingual personal website powered by GetSimple
» The little I did for GetSimple
Reply
Works like a dream: image in Full Text and 'read more' link in excerpt.

Thank you Carlos, for your excellent code
and thank you TJ for your help too.
I'm no Einstein, nor do I profess to be. Just saying what I would try in the circumstances.
Reply
So as I promised, I have tested the latest beta and again, it's just another long step further.

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? Wink

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.

Thank you Carlos


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.
Tomáš Janeček - Multilingual personal website powered by GetSimple
» The little I did for GetSimple
Reply
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
Reply
(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.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
(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.
Reply
(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 Smile

Greets
Sebastian
Reply
(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.
Reply
Sorry, Carlos, I didn't look with more attention to the other threads.
And, of course, thank you, this is doing the job!
GP
Reply
(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? Wink

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...
Reply
(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:
Code:
/category/_software
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 Sad
Reply
(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());
Reply
(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 Smile
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.
Tomáš Janeček - Multilingual personal website powered by GetSimple
» The little I did for GetSimple
Reply
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)
Reply
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.
Reply
When can we expect a stable version? no beta Smile
Reply
<?php nm_tag_list(); ?>
Perfect I was waiting for the stable version
I can remove my pacth from Partenope.org now Wink
My website made with GetSimple CMS is

Arte & Società
www.artesocieta.eu

An indipendent website about Italian Contemporary Visual Arts
Reply
(2014-03-26, 05:12:37)Oleg06 Wrote: When can we expect a stable version? no beta Smile

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.
Reply
How can I put the "nm_list_archives" function in a web page (not in a sidebar or template)?
Reply
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
Reply
(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 Smile
http://get-simple.info/extend/plugin/dynpages/81/
Reply
(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 Smile
http://get-simple.info/extend/plugin/dynpages/81/

Thanks to you and D.O. for the suggestions.
DynPages worked great (quick and easy)!
Reply
(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:
Code:
{% listarchives %}

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... :-)
Reply
(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:
Code:
{% listarchives %}

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.
Reply
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.
Reply




Users browsing this thread: 6 Guest(s)