Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
News Manager Title plugin
#1
This plugin tries to add the title of the current News Manager post to the page <title> tag.

It doesn't require editing template files. It can be an easy way to enhance SEO for sites using NM.

Tested with Innovation, Cardinal, GSkeleton themes. It should work with most standard templates (as long as the <title> tag is located before <?php get_header(); ?>)

It may not work (but shouldn't break anything) with some plugin (maybe some of the I18N family).

Download News Manager Title (Extend) / GitHub

Usage:

Upload news_manager_title.php to your plugins folder.
Make sure it is activated.

By default NM post pages will have then:

Code:
<title>Post title - Page title ...</title>

You can change this structure by adding this to your gsconfig.php file:
PHP Code:
# Insert post title into/instead of page title. 1 = before, 2 = after, 0 = replace. Default 1.
#define("NMTPOSITION",1);

# Text to be used as separator between page title and post title. Default " - "
#define("NMTSEPARATOR"," - "); 

Examples:

If you don't want the page title, only the post title:
PHP Code:
define("NMTPOSITION",0); 

If you want it like this:
Code:
<title>Page title: Post title ...</title>
use this:
PHP Code:
define("NMTPOSITION",2);
define("NMTSEPARATOR",": "); 


I've used this couple settings, but I may change them (or add another...) in a future release.
Reply
#2
Carlos, I question whether you can use this to something like the title?
<title> <? php if (return_page_slug () == 'index') {?> <? php get_site_name ();?> <? php} else {?> <? php get_page_clean_title ();?> - <? php get_site_name ();?> <? php}?> </ title>
- I do not want to on the main page to show in the name of the news that is just the <title> in the news but I would like their names.

Thank You.
Reply
#3
I'm not sure I understand. Do you mean the page title that is shown in the page content? (inside <h1>...</h1> tags, depending on your template)
Reply
#4
Carlos, I in my theme I have something like that pasted the head:
Code:
<title> <? php if (return_page_slug () == 'index') {?> <? php get_site_name ();?> <? php} else {?> <? php get_page_clean_title ();?> - <? php get_site_name ();?> <? php}?> </ title>
- And how do I do now that the title of the news item appeared in <title> page?

I do not want to be named page / subpage on the home page because it is locked in <title>:
<? php get_page_clean_title ();?> Smile
Reply
#5
Have you tried this plugin?
Reply
#6
So I enabled this plugin, but at the same <title> have given it does not work. When it works, but then default on the home page I added the title of <h1> in <title> and do not want to Smile
Reply
#7
Sorry I don't get it.

1.Tell me if your news page is 'index' or other slug.

2. Let's say your site's name is "Site name", your news page has title "News page" and there's a post with title "Post title". How do you want your index, news, and post <title>'s to be?

Example:

index -> Site name
news -> News page - Site name
post -> Post title - News page - Site name

(This is the way the plugin should be working by default with the template code you have pasted.)
Reply
#8
This is really useful. I have a site with a blog for one of my other professions which will get a real SEO boost from this plugin.

I was already using the Custom Title plugin and the two are not incompatible but won't work on the same page so I just made a duplicate page template for the News page, reset the stuff between the <title> tags and everything is fine. - Thanks Carlos.
Reply
#9
Nice to know it's useful to you.

What version of News Manager are you using? If it's the updated one (after 2.2.4), since 2.3.0 there's another way to set the title tag that can work with other plugins. With the Custom Title plugin it would be a bit different as with GS defaults, but I can tell you a way to do it so that you dont have to duplicate templates.
Reply
#10
sidetracking the thread for a second, to get custom titles in core, would you want a tokenized title sitewide or a per page custom title ?
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#11
@shawn_a
http://get-simple.info/forums/showthread...9#pid32909
Reply
#12
(2013-02-12, 05:43:43)Carlos Wrote: What version of News Manager are you using? If it's the updated one (after 2.2.4), since 2.3.0 there's another way to set the title tag that can work with other plugins. With the Custom Title plugin it would be a bit different as with GS defaults, but I can tell you a way to do it so that you dont have to duplicate templates.

I would be interested to know. This is NM 2.2.6 on GS 3.1.2.
Reply
#13
I'll answer in the NM (updated) thread: http://get-simple.info/forums/showthread...1#pid32941
Reply
#14
I tested this plugin both with the Cardinal theme and Emerald2 (modified a bit), but it's not working. Is there some coding I have to implement in the theme file? Because I missed that then.

Here my site: http://gs.wouterb.be/
Reply
#15
What do you have in your template between <title> and </title> ?

With a non-modified Cardinal template it should work.

I've just checked the Emerald2 theme. To make it work with this plugin you should move the <title>...</title> line and put it before the <?php get_header(); ?> tag. (This plugin expects it to be that way)

Anyway if you're using News Manager 2.3+, instead of using this plugin you could edit your template to use the new nm_post_title tag. See here: http://get-simple.info/forums/showthread...1#pid31721
Reply
#16
(2013-03-03, 08:13:04)Carlos Wrote: What do you have in your template between <title> and </title> ?

With a non-modified Cardinal template it should work.

I've just checked the Emerald2 theme. To make it work with this plugin you should move the <title>...</title> line and put it before the <?php get_header(); ?> tag. (This plugin expects it to be that way)

Anyway if you're using News Manager 2.3+, instead of using this plugin you could edit your template to use the new nm_post_title tag. See here: http://get-simple.info/forums/showthread...1#pid31721

Thanks, I'm using version 2.3.2 so it seams I don't need to use the plugin.


Edit:
Ok I will move this to the main thread of News Manager 2.3
Reply
#17
Updated to version 0.2.
If using News Manager 2.4+ it will not read the post xml file again to get the post title.
Reply
#18
(2013-11-23, 21:29:02)Carlos Wrote: Updated to version 0.2.
If using News Manager 2.4+ it will not read the post xml file again to get the post title.

I've just discovered this plugin but my title already works so, and all I did for it is just this piece of code in my title
Code:
<title><?php nm_post_title() or get_page_clean_title(); ?> | <?php get_site_name(); ?></title>

Is there anything extra that this plugin provides in addition to the code above? I prefer the coding version I use, so I'm just curious if it can offer me some kind of bonus.

Nevertheless, this plugin is great when we think about what this CMS is about - simplicity, and this is exactly it. Thanks for it, this makes more and more people want to use this great (and little at the same time) CMS Smile
Tomáš Janeček - Multilingual personal website powered by GetSimple
» The little I did for GetSimple
Reply
#19
I created this plugin before NM 2.3, when function nm_post_title() was not available.

It doesn't provide anything extra - only it can be easier, as you don't need to edit the template.
Reply




Users browsing this thread: 1 Guest(s)