GetSimple Support Forum
News Manager (updated) - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: Plugins (http://get-simple.info/forums/forumdisplay.php?fid=13)
+--- Thread: News Manager (updated) (/showthread.php?tid=3972)



RE: News Manager (updated) - Hypertexter - 2017-06-24

Hi Carlos,

looks interesting, but my template.php is a little bit sophisticated:

PHP Code:
<?php if (return_page_slug() == "blog") { ?>
                        <h1><a href="<?php echo find_url("blog"""); ?>"><?php if (!nm_is_single()) get_page_title(); ?></a></h1><?php 
                    else 
                    
?><h1><?php echo html_entity_decode(get_page_title(false)); ?></h1><?php ?>

to have a URL-title on blog page and no h1 on single post pages. So I fail to integrate your proposal for tag pages. [Image: sad.gif]

Could you perhaps show me how to do it?

Thank you,
Hypertexter


RE: News Manager (updated) - Carlos - 2017-06-24

@bensayers

No, I'm afraid there's no way to integrate the Custom Title plugin with News Manager (because NM doesn't use normal pages to store the posts).

Just the other day I was thinking about having something like this in NM - I'll add it to the to-do list. (#264)


RE: News Manager (updated) - Carlos - 2017-06-24

@Hypertexter

Perhaps with this (replace the code you posted):
PHP Code:
<?php if (!nm_is_site()) { ?><h1><?php echo html_entity_decode(get_page_title(false)); ?></h1>
<?php } elseif (nm_is_tag()) { ?><h1><?php nm_single_tag_title('Topic: '); ?></h1>
<?php } elseif (!nm_is_single()) { ?><h1><a href="<?php nm_get_url(); ?>"><?php get_page_title(); ?></a></h1>
<?php ?>



RE: News Manager (updated) - Hypertexter - 2017-06-24

Hi Carlos,

this is wonderful, it works perfectly! [Image: thumbsup.gif]

Thank you very much!

Hypertexter


RE: News Manager (updated) - Hypertexter - 2017-06-27

Hi Carlos,

is everything ok with the custom_display_random function? I tried to make a new component to show random links. You write it is "like nm_custom_display_recent, but with randomly selected posts". But I don' get a result with this code:

PHP Code:
<?php
nm_custom_display_random
('
  <a href="{{ post_link }}">{{ post_title }}</a> <span class=nm_post_date> ({{ post_date }})</span><br /> '
);
?>

It works fine, when I just replace "random" with "recent", so the component seems to be good code.

Thanks,
Hypertexter


RE: News Manager (updated) - Carlos - 2017-06-27

Do you have the latest NM Addons version? (0.9.5)


RE: News Manager (updated) - Hypertexter - 2017-06-27

Exclamation Now? Yes! Big Grin
Thank you!
Hypertexter


RE: News Manager (updated) - bensayers - 2017-07-07

(2017-06-24, 00:58:54)Carlos Wrote: @bensayers

No, I'm afraid there's no way to integrate the Custom Title plugin with News Manager (because NM doesn't use normal pages to store the posts).

Just the other day I was thinking about having something like this in NM - I'll add it to the to-do list. (#264)

Thanks Carlos, that would be great - I have a client that is a bit eager to have this option for SEO purposes.


RE: News Manager (updated) - siradje - 2017-07-07

Sorry for my English. Need help, maybe somewhere it was described but I did not find Sad I want the news on the site to show up not one by one but next to each other
[Image: block.jpg]


RE: News Manager (updated) - Timbow - 2017-07-08

You either:


Use the existing output of the plugin for the News page and apply css to the classes as they are, so something like
div.nm_post {
   width: 25%;
   display: inline-block;
}


or you:
use the custom display function in news manager add-ons to totally integrate your posts into bootstrap or whatever layout you wish to use.


RE: News Manager (updated) - guleyc - 2017-07-22

Hello,

I have three questions.

Firstly, I wanna remove /post/ in my blog links. Now my links like example.com/blog/post/hosgeldin, I wanna turn it to example.com/blog/hosgeldin

Secondly, auto link creator is not work properly, when i use "ı,ö,ü,ş,ç,ğ", it must be turn it to "i,o,u,s,c,g".
For example, if i use title as "Hoşgeldin", get-simple turns to link as "hogeldin", but I wanna "hosgeldin".

Thirdly, when I enter "space" in tags, it turns to "%20" sign. I wanna it turns to "+".

Thanks.


RE: News Manager (updated) - Carlos - 2017-07-23

First one: see gsconfig setting NMNOPARAMPOST (and .htaccess update required) here:
http://www.cyberiada.org/cnb/news-manager-b/ -> Single post URLs without prefix

Second one: this is not related to News Manager, but I'll reply later.

Third one: not currently possible.


RE: News Manager (updated) - Carlos - 2017-07-23

As for the third one, GS has built-in transliteration since 3.3.11 that should work for ç, ö and ü.

To make it work for the other characters, edit admin/lang/en_US.php and somewhere after this...
Code:
"TRANSLITERATION" => array(
...insert this:
Code:
// Turkish
  'ı'=>'i', 'ş'=>'s', 'ğ'=>'g',
  'İ'=>'i', 'Ş'=>'s', 'Ğ'=>'g',

Let me know if it works, please. Also if you think there are any other characters that should be included.


RE: News Manager (updated) - guleyc - 2017-07-23

(2017-07-23, 02:09:22)Carlos Wrote: As for the third one, GS has built-in transliteration since 3.3.11 that should work for ç, ö and ü.

To make it work for the other characters, edit admin/lang/en_US.php and somewhere after this...
Code:
"TRANSLITERATION" => array(
...insert this:
Code:
 // Turkish
 'ı'=>'i', 'ş'=>'s', 'ğ'=>'g',
 'İ'=>'i', 'Ş'=>'s', 'Ğ'=>'g',

Let me know if it works, please. Also if you think there are any other characters that should be included.

It works! I added ç,ö and ü. Thank you so much.


Code:
 // Turkish
 'ı'=>'i', 'ş'=>'s', 'ğ'=>'g', 'ç'=>'c', 'ö'=>'o', 'ü'=>'u',
 'İ'=>'i', 'Ş'=>'s', 'Ğ'=>'g', 'Ç'=>'c', 'Ö'=>'o', 'Ü'=>'u',



RE: News Manager (updated) - Carlos - 2017-07-23

You shouldn't need to add those, they should already be in the // Roman block.


RE: News Manager (updated) - Belletage - 2017-08-13

Hi!
How to get a list of links to the monthly Newspostings? Is there any prepared function for something
like
...
July 2013
June 2013
May 2013
...
bell


RE: News Manager (updated) - Carlos - 2017-08-13

Code:
<?php nm_list_archives(); ?>



RE: News Manager (updated) - Belletage - 2017-08-13

now I see -I should have found it ... #-|
Thank you!


other point:
I changed the i18n_search_news.php near line 145 because the result-links doesn't work:
PHP Code:
//        case 'link': return get_site_url(false).$NMPAGEURL.'/post/'.substr($this->id,4);  // to 
 
          case 'link': return get_site_url(false).$NMPAGEURL.'.html?post='.substr($this->id,4);   
shure, its fragil and only for one, my %slug%.html URL-permalink-structur ...

bell


RE: News Manager (updated) - Carlos - 2017-08-13

This patch should make it work for yours and other permalink structures:
http://get-simple.info/forums/showthread.php?tid=5766&pid=44984#pid44984


RE: News Manager (updated) - carpman - 2017-08-22

Hi Carlos and everyone else,

Is it possible to have different template files for different kinds of posts, as per:
single templateFile template-blog-post.php

But perhaps determined by tag, so for example, for image based posts I'd like to use one kind of template, for text based posts another. So I'd like to have a tag "image" and a tag "text" and depending which tag the post has, a different template file is used.

Something like this in custom settings?
single templateFile tag="text" template-blog-post-text.php
single templateFile tag="image" template-blog-post-image.php

Is this possible currently?
I'm not bothered about method (as per above), just whether this can be done at present.

Many thanks,
C.


RE: News Manager (updated) - Craziwolf - 2017-09-03

Hi Carlos, I was trying to figure out how to display my featured image in my side component. at the moment I can display some posts at random with an excerpt but cant get my feature image to work.

Here is my code without the feature image, where should I be inserting it?

Code:
<p style="margin-bottom:10px;">
<?php nm_set_custom_excerpt(220);
nm_set_custom_maxposts(3);
nm_custom_display_random('
<h3 style="margin-bottom:-10px;"><a href="{{ post_link }}">{{ post_title }}</a></h3> <br />
{{ post_excerpt }} <a href="{{ post_link }}" style="color:#fff;text-decoration:none;">[...]</a> <br /><a href="{{ post_link }}" >More...</a>
');
?></p>

Cheers!


RE: News Manager (updated) - Craziwolf - 2017-09-06

Hello again! I do have another question, how do I make the feature image full width of the div when the post opens up on its own page? I am trying to make it show as a thumbnail in the main window and full size on the post.

Cheers!


RE: News Manager (updated) - Carlos - 2017-09-12

(2017-08-22, 05:33:41)carpman Wrote: Is it possible to have different template files for different kinds of posts, as per:
single templateFile template-blog-post.php

But perhaps determined by tag, so for example, for image based posts I'd like to use one kind of template, for text based posts another. So I'd like to have a tag "image" and a tag "text" and depending which tag the post has, a different template file is used.

Something like this in custom settings?
single templateFile tag="text" template-blog-post-text.php
single templateFile tag="image" template-blog-post-image.php

Is this possible currently?
I'm not bothered about method (as per above), just whether this can be done at present.

Many thanks,
C.

Create a new template file (e.g. template-blog-single.php) with this contents:
PHP Code:
<?php if(!defined('IN_GS')){ die('you cannot load this page directly.'); }

function 
custom_include_template($temp) {
  global 
$TEMPLATE;
  
$file GSTHEMESPATH.$TEMPLATE.'/'.$temp;
  if (
file_exists($file)) include $file;
}

if (
nm_post_has_tag('text')) {
  
custom_include_template('template-blog-post-text.php');
} elseif (
nm_post_has_tag('image')) {
  
custom_include_template('template-blog-post-image.php');
} else {
  
custom_include_template('template-blog-post.php');
}

// end 

Now in NM Custom Settings, select it with:
Code:
single templateFile template-blog-single.php

PS I suggest you use the .inc.php extension instead of just .php for these "special templates" so that they cannot be selected for normal pages by your users.


RE: News Manager (updated) - Carlos - 2017-09-12

(2017-09-03, 21:24:08)Craziwolf Wrote: Hi Carlos, I was trying to figure out how to display my featured image in my side component. at the moment I can display some posts at random with an excerpt but cant get my feature image to work.

Here is my code without the feature image, where should I be inserting it?

You can use the {{ post_image }} or {{ post_image_url}} placeholders (see NM Addons documentation) wherever you need it in your code. Perhaps before the <h3>, or after the <br />, or after the excerpt... It depends on what you need, but you'll probably have to use css too...

(2017-09-06, 08:52:21)Craziwolf Wrote: Hello again! I do have another question, how do I make the feature image full width of the div when the post opens up on its own page? I am trying to make it show as a thumbnail in the main window and full size on the post.

Enter this in NM Custom Settings:
Code:
single imageSize full



RE: News Manager (updated) - carpman - 2017-09-19

(2017-09-12, 03:58:36)Carlos Wrote: Create a new template file (e.g. template-blog-single.php) with this contents:
PHP Code:
<?php if(!defined('IN_GS')){ die('you cannot load this page directly.'); }

function 
custom_include_template($temp) {
 
 global $TEMPLATE;
 
 $file GSTHEMESPATH.$TEMPLATE.'/'.$temp;
 
 if (file_exists($file)) include $file;
}

if (
nm_post_has_tag('text')) {
 
 custom_include_template('template-blog-post-text.php');
} elseif (
nm_post_has_tag('image')) {
 
 custom_include_template('template-blog-post-image.php');
} else {
 
 custom_include_template('template-blog-post.php');
}

// end 

Now in NM Custom Settings, select it with:
Code:
single templateFile template-blog-single.php

PS I suggest you use the .inc.php extension instead of just .php for these "special templates" so that they cannot be selected for normal pages by your users.

Thanks Carlos !!!!! That worked a treat. It's allowed me to a) use different header images, fonts etc .. for different kinds of posts, but more importantly I no longer need to run media based js (say for the audio player) on simple text posts.

You can see it in action here:

Main Blog (Directory)
http://www.giantpygmy.net/gptxt/index.php

Image Post
http://www.giantpygmy.net/gptxt/?post=image-gallery-beacons

Text Post
http://www.giantpygmy.net/gptxt/?post=i-dont-know-why

Thanks again! It's made a big difference.  Big Grin

C.