Thread Rating:
  • 6 Vote(s) - 4.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
News Manager (updated)
As per xxdex's request, here's a simple plugin so that you don't have to edit NM files.

News Manager Auto-open Post Options 0.1 - download
Automatically open the post options when editing News Manager posts
(similar to what this plugin does for pages, but not remembering last state)

Optional:

- To enable only when creating new posts (but not editing existing ones), add this to your site's gsconfig.php file:
Code:
define('NMAUTOOPEN','new');

- To disable auto-open without deactivating the plugin:
Code:
define('NMAUTOOPEN',0);
Reply
I've just published a post with a text-based image (too bad for jpg) - 900x471px, text "Bootstrap classes", large letters (72 font-size). The PhotoShop export looked great, 75 JPG quality and 33 kB in size. I uploaded it to my site, added to the article and got shocked by the compression it must have gone through. The file got like 8 kB smaller, but the quality went down rapidly (I'm aware that it looked so bad just because there's the text in the image, but that's what the image is like and I can't use PNG because of pic.php - I could edit it, but I don't need png for every post's image).

So I checked pic.php and changed line 75
Code:
imagejpeg($dst, $thumbdir.$outfile, 75);
so that the quality became 100.

Now, it almost doesn't decrease the quality (it still does but nothing serious), but the filesize is now 88 kB instead of 33 kB (and the quality is still slightly worse as it uselessly (in this case) went though the jpeg generating process again).
I don't really need News Manager to recompress my images - I do upload them in the final resolution that I use on the frontend. I'm fine with recompression for the sidebar thumbs, but for the main image not - it just causes my files to be bigger or/and worse quality.

I know I could play with the number and set 90 or something like that, but I'd be glad if I could just choose to skip the recompression for the nmimage*.jpg that is not gonna be resized (uploaded in the final resolution) and also change the quality value in the administration via custom settings in the textarea.
Is there a possibility that you'll add such feature in the future?

Thank you. If not, I'll edit pic.php myself and just overwrite it each time I update, but there might be other people that would use this feature as well - who knows. Just an idea, thanks for consideration Smile
Tomáš Janeček - Multilingual personal website powered by GetSimple
» The little I did for GetSimple
Reply
I remember this solution: you already post it a couple of years ago. Right?

(2014-09-26, 01:58:18)Carlos Wrote: As per xxdex's request, here's a simple plugin so that you don't have to edit NM files.

News Manager Auto-open Post Options 0.1 - download
Automatically open the post options when editing News Manager posts
(similar to what this plugin does for pages, but not remembering last state)

Optional:

- To enable only when creating new posts (but not editing existing ones), add this to your site's gsconfig.php file:
Code:
define('NMAUTOOPEN','new');

- To disable auto-open without deactivating the plugin:
Code:
define('NMAUTOOPEN',0);
My website made with GetSimple CMS is

Arte & Società
www.artesocieta.eu

An indipendent website about Italian Contemporary Visual Arts
Reply
@TeeJay
You can skip resizing/recompressing your post images by setting both width and height to 0 (or leave empty) in NM settings.
(Or if you wish to apply this only to single posts, by using custom setting single imagesize full)

@D.O.
What I fixed 2 years ago was an issue with post options not visible with javascript disabled.
Reply
Hello,

I managed to bring News Manager individual post title tags together with individual page title tags from the Custom Title plugin with this sequence for title tag:

<title><?php nm_post_title(); ?><?php echo(get_custom_title_tag()); ?></title>

Just if anybody is interested in this Big Grin
Reply
...Or if you prefer to have the post title and page title separated by a dash:
Code:
<title><?php nm_post_title('',' - '); echo get_custom_title_tag(); ?></title>
Reply
Okay, this is my variation. It's been some time since I wrote it, maybe it's not even the most effective way, but it gets me what I want (with proper Custom Title settings) and is easy to understand
Page Title | Site Name
(and on on a single post page)
Post Title | Site Name
Code:
<title><?php if (nm_is_single()) { nm_post_title(); ?> | <?php get_site_name(); } else { echo(get_custom_title_tag()); }?></title>
Tomáš Janeček - Multilingual personal website powered by GetSimple
» The little I did for GetSimple
Reply
Great, thanks!

But now I would like to ask for something completely different:

Where can I add semantic markup to my news article? I think about this scheme: https://schema.org/NewsArticle

And things like headline or datepublished could be pre-filled... Cool
Reply
Some basic semantic markup is possible with NM 3.0: You can change the html tags used for the post container and title with custom settings markupPost and markupTitle

For example, if you want <h2> for your post titles, but <h1> if it's the single/full post view:
Code:
markupTitle h2
single markupTitle h1

If you want to change the default <div> tag used as wrapper for posts, by HTML5's <article> tag:
Code:
markupPost article

Full post layout customization will be possible in some future version.
Reply
Hmm, I tried
"markupPost article"
but it lead to funny formatting of the overview blog page... each short entry had a big box around it.
Reply
Hello,

now I see that in my installation GS makes no sitemap entries for the blog posts!

What did I do wrong? Do I have to switch it on somewhere?

There is an entry for the www.domain.xx/blog page, but not for the single post pages...

I use the fancy url settings of GS and NM and get URL's like
www.domain.xx/blog/post/posttitle1

Huh
Reply
(2014-10-01, 16:59:17)Hypertexter Wrote: Hmm, I tried
"markupPost article"
but it lead to funny formatting of the overview blog page... each short entry had a big box around it.

You probably have some styling for the article tag in your theme's css.

(2014-10-01, 17:02:35)Hypertexter Wrote: now I see that in my installation GS makes no sitemap entries for the blog posts!

What did I do wrong? Do I have to switch it on somewhere?
[...]

You don't have to do anything, it's enabled by default (you can disable it with NMNOSITEMAP)

It seems there's an issue: when you create a new post, it is not inmediately added to the Sitemap, but only after you've done some other update (saved/removed any page or post, saved settings...). I'll look into it.

Previous posts, however, should be present in sitemap.xml, unless you're using GS 3.1.x or 3.2.x. If you're using 3.3.x, it could be a conflict with some other plugin.
Reply
Hi,

my version is the newest: 3.3.3 and the installed plugins you can see in the attached screenshot.

My theme ist Innovation and I think the boxes around articles are part of that theme.


Attached Files Thumbnail(s)
   
Reply
The Sitemap is is being generated by the I18N plugin (instead of GS), in a way that doesn't let other plugins like NM add their own entries.

Quick hack: edit i18n_base/sitemap.class.php, insert this
Code:
$xml = exec_filter('sitemap',$xml); // patch
around line 61 or 62 (in I18N version 3.2.8), just before this:
Code:
XMLsave($xml, $file);
Reply
Oh.

Could not NM create its own sitemap file and an index file to connect them?

Like this:
https://support.google.com/webmasters/answer/75712?rd=1
Reply
If I'm not mistaken, NM would need to insert something in sitemap.xml anyway, but it cannot do that if the 'sitemap' filter is not run.
Reply
I am assuming i18n never lets it get there, since it does its own redirects, and does not call new stuff since 3.3
It also could fix this by using filters and getting rid of its changedata shim.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
Strangely enough, I get this message when trying to copy the code
Code:
Failed to generate a .htaccess sample for the current site settings
Reply
NM currently only generates the sample htaccess if you use a GS "standard" fancy URLs structure (default, %parent%/%slug%, %slug%/, ...)

You get that "error" (or notice) if you use:
- a non-standard GS permalink structure (e.g. with %language%, %nondefaultlanguage%, ...)
or
- NM custom URL parameters/prefixes (e.g. NMNOPARAMPOST, NMPARAMPOST, etc)

In both cases you'd have to create specific rewrite rules for your setup. (Ask here if you need help.)



I know that the "Failed..." message is not very helpful. It's kind of a temporary thing until I decide how to deal with special structures. (Ideally NM would not require changes in htaccess, that's what I'd like to do.)
Reply
(2014-10-03, 06:27:35)shawn_a Wrote: I am assuming i18n never lets it get there, since it does its own redirects, and does not call new stuff since 3.3
It also could fix this by using filters and getting rid of its changedata shim.

Exactly.
I just suggested a quick patch. Ideally I18N would use the 'sitemap' filter, but I suppose that mvlcek would also prefer to keep a fallback for GS versions < 3.3
Reply
Thanks, it works
(2014-10-04, 18:32:51)Carlos Wrote: NM currently only generates the sample htaccess if you use a GS "standard" fancy URLs structure (default, %parent%/%slug%, %slug%/, ...)

You get that "error" (or notice) if you use:
- a non-standard GS permalink structure (e.g. with %language%, %nondefaultlanguage%, ...)
or
- NM custom URL parameters/prefixes (e.g. NMNOPARAMPOST, NMPARAMPOST, etc)

In both cases you'd have to create specific rewrite rules for your setup. (Ask here if you need help.)



I know that the "Failed..." message is not very helpful. It's kind of a temporary thing until I decide how to deal with special structures. (Ideally NM would not require changes in htaccess, that's what I'd like to do.)
Reply
again , somewhere to use the new pageid hook to deal with special structures instead of making special rewrites. Let me know thoughts on this while thinking about it. Do we need to add theme functions to help plugins handle path splitting and parsing ? Would we build this into the multi level url support issue on github and merge in that ancient proposed rewrite rule change? 3.4 is at almost 2/3 completion
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
For this I intended to play with parsing $_SERVER['REQUEST_URI'] to get params and stuff, and then assign the proper page id with the indexid filter. (but I haven't started experimenting yet)

(As for multilevel URLs, I think that in principle there's no need to change anything in current rewriterules. It's more about find_url, etc. to generate proper URLs, as we were discussing in issue 655.)
Reply
Hello,

I added the patch line ($xml = exec_filter('sitemap',$xml); // patch) and it seems to work fine, thank you!

It creates sitemap entries. But they are different to the normal ones. They are not very fancy:

www.domain.xx/blog?lang=de/post/posttitle

If Google has no problems with it, it doesn't matter.
Reply
Oops.
No, that's not a correct URL scheme - better not to have NM posts included in the Sitemap then.
It seems it does not work properly with your custom permalink structure. I suggest you undo the patch for now.
Reply




Users browsing this thread: 11 Guest(s)