Thread Rating:
  • 5 Vote(s) - 4.4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
News Manager (updated)
(2014-01-30, 07:54:57)ZackWhite Wrote: apparently you need to enable images in the settings menu.

Yes, by default you have to enable them to have the image input field in the post edit options.

However if you want to have that input but no post images in your news page, there are a couple ways to do it.
Reply
I'm using the 2.5 beta 15 version of the plugin. I'm trying to figure out how to grab just the image and title of a post to put them on my homepage. For instance, i'd like to have the most recent news story as the focal point of my homepage with image/title...and then the next three news stories represented by three smaller images, with their titles. I'm having a hard time locating a function reference to see what's available for me to accomplish this task. Any help would be much appreciated! Thanks.
Reply
You can use the News Manager Addons plugin http://get-simple.info/forums/showthread.php?tid=4339
You would probably use these functions (some of them a couple times) in your template (or a component):

nm_set_custom_maxposts
nm_set_custom_offset
nm_custom_image
nm_custom_display_recent

More info in the support thread (see recent posts as the docs are not up to date), please post any questions there.

If you don't understand how the plugin works, give some example (html code) of the post layout you need.
Reply
Is there anyway to chose a different page template for the single post page? I have a slider on my index page and because the plugin uses the index template I have yet to figure out a way to resolve the linked pages from my post's to new pages with unique templates.
Reply
The plugin uses the index page for news if you have it selected in settings, but you can select a different slug.
As for the rest, I don't understand what you want to accomplish.
I may allow selecting different templates for each view in some future version (it's in the to-do list), but in the meantime I suppose something like what you want could be done with conditionals in the template.
Reply
Hello! I have a question about output structure.

How to change the structure of lets say a post (in all posts page) as well as in the post itself? For example, i want the date not to be shown and i want the picture to appear let's say before the post's title?

Hope you understand me. Please reply as soon as possible Smile
Reply
(2014-02-08, 21:57:13)addi Wrote: Hello! I have a question about output structure.

How to change the structure of lets say a post (in all posts page) as well as in the post itself? For example, i want the date not to be shown and i want the picture to appear let's say before the post's title?

Hope you understand me. Please reply as soon as possible Smile

You can do that in /plugins/news_manager/inc/site.php. However, you can't make the structure of a single post different from a post in the main news page (all posts page as you say) easily.
However, if you're using latest beta, there is an extra class for the wrapper of the post, so you can style it differently including "display: none", so what you wanna reach is possible via CSS.
Tomáš Janeček - Multilingual personal website powered by GetSimple
» The little I did for GetSimple
Reply
Thanks, i will try. Started trying to apply GS for the first time. I am just not familiar with the structure of cms and plugins yet Smile.
Reply
(2014-02-08, 21:57:13)addi Wrote: Hello! I have a question about output structure.

How to change the structure of lets say a post (in all posts page) as well as in the post itself? For example, i want the date not to be shown and i want the picture to appear let's say before the post's title?

Hope you understand me. Please reply as soon as possible Smile

With the latest beta version you can enable Custom settings and use this:
Code:
showfields image,title,content,tags
Reply
I also have a suggestion for excerpts. Since you can't output html (because of cutting tags and closing tags) you could at least change an unordered list or ordered list to new lines, so that each list item would appear on a new line instead of making a nonsense sentence Smile
Reply
(2014-02-08, 20:53:35)Carlos Wrote: The plugin uses the index page for news if you have it selected in settings, but you can select a different slug.
As for the rest, I don't understand what you want to accomplish.
I may allow selecting different templates for each view in some future version (it's in the to-do list), but in the meantime I suppose something like what you want could be done with conditionals in the template.

Sorry, that wasn't very clear.

I have my plugin set to use the index page for news, but I also have a plugin for a slider gallery. When I click a title link to show the full entry to a URL like /post/title-of-post it also has the slider gallery. I think you have answered that question in the GitHub issue, but I also came across this thread [post 613], but when I enter that line into my template it disables my slider gallery.

This is an excellent plugin and one that my clients routinely ask for. Thank you for your continuing support and contribution.
Reply
Is that slider plugin in Extend?

[edit] I see, must be I18N Gallery. Will check this.
Reply
Is it possible to have two different pages for news? Let's say i want to have a page for news in sport and a page for news in science. If so, how could i adjust to achieve this? I don't need a function in admin panel or anything, just to have this.
Reply
(2014-02-09, 01:54:59)Carlos Wrote: Is that slider plugin in Extend?

[edit] I see, must be I18N Gallery. Will check this.

Finding similar issues with the nanoSLIDER4GS plugin. Is there any way the posts lists could be loaded into components?
Reply
(2014-02-09, 07:14:29)addi Wrote: Is it possible to have two different pages for news? Let's say i want to have a page for news in sport and a page for news in science. If so, how could i adjust to achieve this? I don't need a function in admin panel or anything, just to have this.

Yes, it is, but you have to edit your template file. Please, look here. It works quite well, this way I did my site multilingual in all ways Smile
Tomáš Janeček - Multilingual personal website powered by GetSimple
» The little I did for GetSimple
Reply
@dnichols.178

It seems that News Manager and I18N Gallery interfere if the same slug is selected for a gallery and news.

A workaround would be inserting the gallery code directly in the template (more info here):

- Between <head> and </head>:
PHP Code:
<?php if (nm_is_home()) get_i18n_gallery_header('your-gallery-id'); ?>

- In the body, to display the gallery:
PHP Code:
<?php if (nm_is_home()) get_i18n_gallery('your-gallery-id'); ?>

(This is for NM beta, with versions until 2.4.x the conditional would be somewhat longer.)

(2014-02-09, 07:46:02)dnichols.178 Wrote: Finding similar issues with the nanoSLIDER4GS plugin.

I suppose that something like this can be done for the NanoSlider plugin. I can check this...

(2014-02-09, 07:46:02)dnichols.178 Wrote: Is there any way the posts lists could be loaded into components?

You can use <?php nm_list_recent(); ?> (see info page) or custom output functions available in the News Manager Addons plugin.
Reply
I need to have news in two different pages (tips/recipes). I have tried what teejay suggested and added a small fix:

Code:
<?php
    if (return_page_slug()=='recipes' && !nm_is_single())
        nm_show_tag('recipes');
    else if (return_page_slug()=='tips' && !nm_is_single())
        nm_show_tag('tips');
    else
        insert_page_content();
?>

The problem is, that when you click the link in tips, it goes to www........com/recipes/post/tip, because the page for news is set to recipes by default. (When it should be tips/post/tip)

Is there anything i can change in the plugin or are there any special php calls to do this?

Help appreciated!
Reply
(2014-02-09, 23:04:06)addi Wrote: I need to have news in two different pages (tips/recipes).
...
The problem is, that when you click the link in tips, it goes to www........com/recipes/post/tip, because the page for news is set to recipes by default. (When it should be tips/post/tip)

Is there anything i can change in the plugin or are there any special php calls to do this?

Not currently possible, and no easy patch.
I want to add multi site/slug/page support to NM (and maybe categories), but this will not be soon.

Suggestions:
- use a slug that works for both tips and recipes, like recipes-tips, recipes-and-tips or a generic like info, web ...
or
- use other plugin that allows more customization like I18N Search + Special Pages (maybe fits this task better than NM), or check others here

PS thanks for your suggestion about excerpts.
Reply
Suggestion: is it possible to provide an option to auto-slug all new posts using just its creation date? Ideally I'm looking for URLs of the form http://example.com/news/20140211, as in my planned site virtually all news titles will be in CJK anyway. Any form of auto-romanization would also only cause more annoyance, actually.


Please ignore the old post below. I played around with the installation and broke it beyond recognition. Had to start a fresh install. Can't test any solutions now. Sad
----

Regarding beta 15.

Long story short:
  1. Fresh new install on Win8+Apache+PHP
  2. Installed News Manager 2.2.4
  3. Created a post with a CJK title
  4. Filename on disk end up being ".xml"
  5. Apache or GetSimple cannot handle this data file so the post gets listed all the time in the News Manager list but cannot edit nor get displayed on actual site
  6. Tried beta 15.
All "new posts" will start with the content of this ".xml", as if it's become the template for all new posts. It cannot be deleted from within News Manager ("incorrect path") probably due to how Windows treats empty filenames.

Deleting the actual ".xml" disk file doesn't seem to work. The item stays listed in the News Manager post list. Is there a way to fix this? Don't worry too much if it's too much trouble. I'm playing on a test site anyway and a clean install is perfectly fine.
Reply
(2014-02-11, 02:28:34)zfz Wrote: Regarding beta 15.

Long story short:
  1. Fresh new install on Win8+Apache+PHP
  2. Installed News Manager 2.2.4
  3. Created a post with a CJK title
  4. Filename on disk end up being ".xml"
  5. Apache or GetSimple cannot handle this data file so the post gets listed all the time in the News Manager list but cannot edit nor get displayed on actual site
  6. Tried beta 15.
All "new posts" will start with the content of this ".xml", as if it's become the template for all new posts. It cannot be deleted from within News Manager ("incorrect path") probably due to how Windows treats empty filenames.

Yes, known issues in older News Manager (until 2.2.4) versions.
(2.2.5 and later should not create that "bad" file, but however it is not removed if it existed.)

(2014-02-11, 02:28:34)zfz Wrote: Deleting the actual ".xml" disk file doesn't seem to work. The item stays listed in the News Manager post list. Is there a way to fix this? Don't worry too much if it's too much trouble. I'm playing on a test site anyway and a clean install is perfectly fine.

You should be able to delete it if you browse the data/posts folder, but if you can't, open a command-line window, go to that folder and type del ".xml"

(2014-02-11, 02:28:34)zfz Wrote: Also related suggestion: is it possible to provide an option to auto-slug all new posts using just its creation date? Ideally I'm looking for URLs of the form http://example.com/news/20140211, as in my planned site virtually all news titles will be in CJK anyway. Any form of auto-romanization would also only cause more annoyance, actually.

Interesting.
Right now if there are no transliteratable characters slugs are automatically created as post, post-1, post-2, ...
But I like your suggestion, I'll think about it.

In the meantime here's a patch:
Edit news_manager/inc/posts.php, find this:
Code:
$slug = nm_create_slug($_POST['post-title']);
and replace it by:
Code:
$slug = empty($_POST['post-date']) ? date('Ymd') : date('Ymd',strtotime($_POST['post-date'])); // patch

PS I had started writing half my reply and now that I've finished I notice you have edited your post. :-) I'm leaving quoted text like it was, I hope you don't mind.
Reply
Thanks for the quick reply! I don't mind at all!

I've actually just replaced the whole if(!empty(slug))-else with your new line so all posts use the date by default. It looks more uniform and opens up the possibility of fishing for a particular day's news in the future, and also allows for a quick "back then on this day" link by just modifying the permalink.

I hope I am not asking too much; if you ever consider making this an option, would it be possible to have the custom slug URL pre-populated for people using this option?

Thank you again for the quick patch!
Reply
(2014-02-12, 04:43:30)zfz Wrote: I've actually just replaced the whole if(!empty(slug))-else with your new line so all posts use the date by default. It looks more uniform and opens up the possibility of fishing for a particular day's news in the future, and also allows for a quick "back then on this day" link by just modifying the permalink.

If you do it that way you should hide the slug input field, as it will be ignored, i.e. anything that the user enters there will be replaced.
Also, if the user edits the date, the slug will change. Is that is what you wanted?

(2014-02-12, 04:43:30)zfz Wrote: I hope I am not asking too much; if you ever consider making this an option, would it be possible to have the custom slug URL pre-populated for people using this option?

I'd rather generate the slug when saving the post (like in the patch) instead of pre-populating it (unless it is meant to be editable). Any advantage on pre-populating?

I'm actually considering adding this option, probably as a gsconfig setting for now. This is what I've thinked of:

- A setting to define the date-based slug structure for new posts (strftime format). If defined, the slug field would not be visible/editable.
- Another setting to enable viewing/editing the slug field (if previous setting is defined).
- And maybe another setting to force updating the slug if an existing post is edited and saved (like in your version of my patch). I don't think this is convenient for blog-type sites, as permalinks should be "permanent", but I suppose that this may be useful for some sites.

Ideas welcome.

(2014-02-12, 04:43:30)zfz Wrote: Thank you again for the quick patch!

You're welcome!
Reply
I agree with adding such function (though I won't need it ever I guess), but one thing I got to add - please, never update the slug automatically as it changes the URL and all backlinks and/or URLs indexed in search engines will lead to 404 error pages.

But if it's gonna be just a thing of settings, it might be okay. Just make the setting hidden by default and disabled as you already do with images or whatever.
Tomáš Janeček - Multilingual personal website powered by GetSimple
» The little I did for GetSimple
Reply
Hi addi,
Let me say that the actual use of 'nm_show_tag' is already enough, because - until a few time ago - IT was considered only an internal function, until I invented this little trick.
If it can be useful for you, my site uses massively this function; the structure of my pages are like these ones..

http://www.partenope.org/?id=articoli&tag=editoriale
or
http://www.partenope.org/?id=articoli&tag=storia

I have sixteen categories (tags); If you still need help and some ispiration, we are here.


(2014-02-09, 23:04:06)addi Wrote: I need to have news in two different pages (tips/recipes). I have tried what teejay suggested and added a small fix:

Code:
<?php
    if (return_page_slug()=='recipes' && !nm_is_single())
        nm_show_tag('recipes');
    else if (return_page_slug()=='tips' && !nm_is_single())
        nm_show_tag('tips');
    else
        insert_page_content();
?>

The problem is, that when you click the link in tips, it goes to www........com/recipes/post/tip, because the page for news is set to recipes by default. (When it should be tips/post/tip)

Is there anything i can change in the plugin or are there any special php calls to do this?

Help appreciated!
My website made with GetSimple CMS is

Arte & Società
www.artesocieta.eu

An indipendent website about Italian Contemporary Visual Arts
Reply
News Manager 2.5 beta 16 attached to this post.

NEW:
- Sitemap supported in GS 3.3.x - posts are inserted in sitemap.xml

OTHER:
- UI enhancements and fixes (settings page; some of these contributed by @emanwebdev)
- fixed support for jquery cdn fallback to local (GS 3.2.2+)
- fixes for (potential) "non-lethal" issues with conditionals and some functions
- somewhat improved excerpt generation (whitespace and newlines treatment) (*)

(*) Excerpts may still not be totally correct - they're shorter than they should if there are html entities (&gt;, etc.) or unicode (cyrillic, etc.) characters in the post content

Please report any issues you find.

(If you have any problem and want to go back to 2.5 beta 15, it's here)

(see What was new in beta 13, beta 14, beta 15)

[attachment removed: news_manager-2.5-beta16.zip (Size: 71.89 KB / Downloads: 44) ]
Reply




Users browsing this thread: 1 Guest(s)