Thread Rating:
  • 4 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
News Manager (updated)
(2015-02-12, 06:40:40)revotron Wrote: I would like to know if it's possible to add tags as an additional class to the nm_post item. For example, if you going to create a new post and set the tag "foo", the rendered output looks something like this <div class="nm_post foo">.

Is this somehow possible?

Not currently possible.

Just curious, do you need this for the single/full post view only, or also for lists of posts (main news page, archives, etc)?
If a post had tags "foo, bar", would you need to have classes for both tags, or just for the first one?
Reply
(2015-02-12, 08:26:07)Carlos Wrote:
(2015-02-12, 06:40:40)revotron Wrote: I would like to know if it's possible to add tags as an additional class to the nm_post item. For example, if you going to create a new post and set the tag "foo", the rendered output looks something like this <div class="nm_post foo">.

Is this somehow possible?

Not currently possible.

Just curious, do you need this for the single/full post view only, or also for lists of posts (main news page, archives, etc)?
If a post had tags "foo, bar", would you need to have classes for both tags, or just for the first one?


I would like to display all news items one one page. There are three categories (or tags) and you can filter the news by tag by clicking on buttons, something similar like the isotope filter.

So basically I have to touch the code of the plug-in and change it to my needs. Is there any good practice to change an existing plug-in with Get Simple?

Alternatively I just could write some JS for those functionality and manipulate the DOM on client site. But I think this may be too much and doesn't feel right for such core features as having the tag as a class name.
It should be a class for all tags set.
Reply
Here's a patch for NM 3.0. Edit news_manager/inc/site.php, find this:

Code:
echo '  <',$nmoption['markuppost'],' class="nm_post';
    if ($single) echo ' nm_post_single';
    echo '">',PHP_EOL;

and replace it by:

Code:
echo '  <',$nmoption['markuppost'],' class="nm_post';
    if ($single) echo ' nm_post_single';
    // patch - tag classes
    foreach ($tags as $tag)
      if (substr($tag, 0, 1) != '_')
        echo ' nm_tag_'.htmlspecialchars($tag);
    // end patch
    echo '">',PHP_EOL;

This should generate additional classes nm_tag_foo, nm_tag_bar, ... in the post container.

Of course you will have to re-do the patch when you upgrade.
This part of the code will be changed in NM 3.1, so the patch would be a bit different.

In some future version this will be possible without patches, when some kind of post templating is implemented.
Reply
Woah! Thanks a lot! I definitely will try this next week, when I'm back home.
Reply
(2015-02-04, 04:36:50)Carlos Wrote:
(2015-02-03, 19:56:02)domscatterbrain Wrote: When do the news manager start paginating the news list? I've posted about 30 news items so far.

News Manager -> Settings -> Number of posts on News Page:
(enter the maximum number of posts per page there)

Sorry I forgot something. Yes, I've seen the settings of "Number of posts on News Page". But not that what I meant to know. The question I've asked about news list paginating was meant to the list in news manager on admin page. Any suggestion?
Reply
(2015-02-15, 01:29:20)domscatterbrain Wrote: Sorry I forgot something. Yes, I've seen the settings of "Number of posts on News Page". But not that what I meant to know. The question I've asked about news list paginating was meant to the list in news manager on admin page. Any suggestion?

Currently there's no pagination in the backend.
However it's in the roadmap ( https://github.com/cnb/News_Manager-gets...issues/172 )
Reply
News Manager 3.1 beta 26 available for testing.

New in this BETA version:
- Auto-generated post meta description (optional, custom setting) (@Oleg06)
- Custom authors (via array in gsconfig)
- Some more custom settings for custom classes in post's elements (like markupPost and markupTitle)

More info in the link above. Feedback much appreciated.
Reply
(2015-02-15, 02:49:16)Carlos Wrote: Currently there's no pagination in the backend.
However it's in the roadmap ( https://github.com/cnb/News_Manager-gets...issues/172 )

Thank you
Reply
Hello,

could you tell me how the archiving function in News Manager works?

I switched to monthly archiving, but nothing happened.

And what happens, when one day it really archives entries? Is it resettable, when I switch back from monthly to yearly?

Thank you!
Hypertexter
Reply
In your template or some component (e.g. Sidebar), insert this:
Code:
<?php nm_list_archives(); ?>
where you want to display the list of links to archive pages. It will be monthly or yearly depending on what you define in settings.
Reply
OK, I understand... it is a different view on all entries, sorted by year or month. Thanks!
Reply
Hello,

thank you for this great plug-in!

I am having troubles with the excerpt length. Whereever I change it it doesn't take any effect. The length is always about 200 characters. I am using NM 3.0 and News Manager AddonsVersion 0.9.3.

What am I doing wrong?

Thank you for your help :-)
Reply
Do you have this issue in the news page? Or is it in some template code with NM Addons' functions? Or both?

You set the excerpt length in the NM settings page. You can also set if you enable Custom Settings and enter:
Code:
excerptlength 123
that overrides the above mentioned setting.

For NM Addons you can specify a custom length with:
Code:
<?php nm_set_custom_excerpt(123); ?>
before the display function.
Reply
Thank you very much for your quick response, Carlos.

I have tried both of your suggestions, but nothing changed.

Maybe my code is not correct:
PHP Code:
<?php nm_set_custom_excerpt(123); ?>
        <?php nm_custom_display_recent('
        <a href="{{ post_link }}" title="{{ post_title }}"><p class="date">{{ post_date }}</p>
        <h3>{{ post_title }}</h3>
        <p class="newsteaser">{{ post_excerpt }}... <span>Mehr &rsaquo;</span></p></a>'
); ?>

Everything works fine so far except for the excerpt.

Thank you again :-)
Reply
It's a bug in NM Addons - since 0.9.2
I've just released a fix - version 0.9.3.1
Thanks.
Reply
Thank you so much, Carlos!

Works like a charme now Smile
Reply
One more question Shy

As far as I know I have to assign a page where the complete news text will be displayed and the content will be overwritten.

Is it possible to assign a template (not a page) and using custom tags? For example if I don't want to display the date or place it anywhere on the template.

Something like this:
PHP Code:
<h1>{{ post_title }}</h1>
<
p>{{ post_content }}</p

Thank you in advance and have a good day Smile
Reply
See here -> Custom settings -> Post layout

For example, to show just title and content and use h1 for the post title, enable Custom Settings and enter:
Code:
showFields title,content
markupTitle h1
Reply
Works perfect! Many thanks to you! Smile
Reply
Just a note: if you want to use <h1> only in the single post view, but <h2> in other news pages (as several <h1>'s would be incorrect), then it could be:
Code:
markupTitle h2
single markupTitle h1
Reply
Thanks for the information, Carlos Smile Good to know.
Reply
News Manager version 3.1 released - Download (Extend)

Changes (3.0 users, see Upgrade notes for more info)

- Private posts are now visible to logged-in users (@Hypertexter)
- Image/file browser improvements: default sorted by date; sortable columns (filename, date, size)
- The <title> tag in tag pages now contains the tag name
- Tag pages are now included in Sitemap

New settings/options (More information here)

New Custom Settings for:
- Auto-generated post meta description: autometad (@Oleg06)
- Using post Tags as meta keywords: metaKeywordsTags (@newdeepdan)
- Using custom GS thumbnails: imageThumbnail (@Hypertexter)
- Custom CSS class selectors (post layout, etc.) (thanks @Oleg06)
- Custom HTML markup (post layout elements)
- Customizable page navigation (custom markup and classes, useful for Bootstrap etc.)

New gsconfig settings for:
- Image sorting (filebrowser): NMIMAGESORT
- Custom authors (public names): $NMAUTHOR array
- Excluding tag pages from Sitemap: NMSITEMAPEXCLUDETAGS

New template tag/function to display/return current tag: nm_single_tag_title()

Fixes

- image filebrowser was broken if custom admin folder. GSADMIN gsconfig setting is now supported
- Custom Settings label/textarea was not rendered properly with GSSTYLE wide (@Gooos)
- post options adjusted - prepared for responsive admin styles (GS 3.4), also better for navigation with keyboard (tab)
- sets "URL" as default link type in CKEditor
- better support for I18N-based multilanguage sites (prevent broken links in backend with some permalink structures)
- bug with read more link and Full Text setting when using more 1 custom setting (@Gooos)
- several filebrowser issues (@johnnyb, @bensayers)
- added security on pic script + better parameter validation
- function nm_is_single did not always work properly
- Language file was loaded twice in frontend
- Entities were decoded in Custom Settings when saving settings
- Quotes were escaped in Custom Settings if magic_quotes_gpc enabled (@Oleg06)
- Direct links to full-size post images (instead of passing them to the resizing script)
- Several other slight fixes

Other

- added Finnish language (@naavis)
- backend warning if GSCANONICAL enabled (may help detecting issues)

Full information: What's new in NM 3.1

PS Special thanks to the great beta tester Oleg Svetlov.
Reply
Works perfectly - tested on two websites already (including mine) :)
Tomáš Janeček - Multilingual personal website powered by GetSimple
» The little I did for GetSimple
Reply
(2015-03-04, 11:54:13)TeeJay Wrote: Works perfectly - tested on two websites already (including mine) Smile

Great to know! thanks for reporting.
Reply
Hello Carlos,

thank you for all the new stuff!

There is one Shy additional wish I have since some time: Is there a way in NM 3.1 to add some semantic markup to the posts automatically?

Something like

Code:
<time itemprop="datePublished" datetime="2015-01-07T07:07:21+02:00">January 7, 2015</time>

(in HTML5) would be very helpful for the Google snippet of a post, or some schema.org markup - and it could be made automatically since every post has a date...

And thanks for all your work.
Hypertexter
Reply




Users browsing this thread: 2 Guest(s)