Thread Rating:
  • 4 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
News Manager (updated)
Hello

I'm using Getsimple 3.3.15 (last version) + News Manager updated 3.6 (last version).


QUESTIOn:
I want to put (in each of my post created by "News Manager updated" ) internal Links to other pages with similar argument.

it is possibile?


Thanks
Reply
Do you mean links to other posts?

What do you mean by "similar argument"? Same tag perhaps? Kind of "related posts" or what?
Reply
(2020-01-31, 00:13:48)Carlos Wrote: Do you mean links to other posts?

What do you mean by "similar argument"? Same tag perhaps? Kind of "related posts" or what?

for example, for Wordpress in the past i used a plugin "Related Post".
It simply put 3/4 links to other posts with "similar topic".
without tag / key.

It simply finds similar posts and put links!

I don't know if for getsimple/newsmanager there is a solution to have this option Huh
Reply
Similar/related posts in News Manager
Reply
(2020-02-01, 00:57:14)Carlos Wrote: Similar/related posts in News Manager

hello Carlos,

your solution is nice!
I read info in that page.

 I think it is good for me:
  • paste the code into a new component, named e.g. nm-similar-posts
  • insert this code somewhere in your template file -- you will probably need it after
    <?php get_page_content(); ?> :
Code:
<?php if (nm_is_single()) { get_component('nm-similar-posts'); } ?>


But ...a question:

but what is the template file?
name?

I'm using "closest" theme
http://get-simple.info/extend/theme/closest/1195/

in the zip, there is this
css/style.css

see here
https://filebin.net/zckjn5c9e9q6bdp4/sty...t=7k7apic5

i must put code in
css/style.css  file?


or in this another file
"template.php"
https://filebin.net/yzc5mmsws0u6ydub/tem...t=xpjzpypm

???
Reply
template.php
Reply
Hello,
thank you for this great plugin :

Here are some of my parameters :
markupTitle h2
tagSeparator ,
showFields title,image,content
READ_MORE "Lire l'annonce"
NOT_EXIST "L'annonce demandée n'existe pas ou a été retirée."
componentBottomPost bottompost


I display the posts in a page called "annonces" and was able to obtain an interesting look and feel.
Only one thing is would it be possible to have target="_blank" on these page for posts ?

Question : Is there a way to do this ??

--------
Let me share some code using Newmanager and Newsmanager addon + dynpages than can be useful and help someone :

#Display of
<?php global $args; ?>
<?php nm_set_custom_maxposts($args[0]); ?>
<?php nm_set_custom_image(190, 190); ?>
<?php nm_set_custom_excerpt(200); ?>
<?php nm_custom_display_recent('
<h2><a target="_blank" href="{{ post_link }}">{{ post_title }}</a></h2>
<div style="display: grid;grid-template-columns: 200px 1fr">
<div><a target="_blank" href="{{ post_link }}"><img style="float: left;margin: 0 15px 0 0;" href="{{ post_title }}" src="{{ post_image_url }}" alt="{{ post_title }}"></a></div><div><span><bold>Annonce :</bold> {{ post_excerpt }}... <a target="_blank" href="{{ post_link }}">Lire l\'annonce</a></span></div></div>',$args[1]); ?>

I can put this function in a component named display.

Displays $args[1] posts from category $args[0] in a grid.
You can put in a component and make a call in a page.

My way of using News Manager is as is :
I use only _tags so I can control how they display (invisible tags).

For each tag (example _barcelona) I create, I will also create a static normal page with slug barcelona.
I am using this page like a category or tag page in Wordpress.
This is good because on the static page I can put a lot of content for seo and write a really good article.
Then anywhere I want in the article, i make calls to a component like

Let's say i am displaying real estate listings in my barcelona page :
I will just add somewhere {% display _barcelona 10 %}

This is a great way for me to mix static and dynamic content to help the posts rank.

Also, I want to have the posts link back to the "barcelona" static page :
here are my settings for doing so from the post page.

showFields title,image,content
componentBottomPost bottompost

I do not display tags on the post page but call a component i named bottompost.

Here is this component :

<?php

global $nmdata;

if (count($nmdata['tags'])>0) {

echo "<p>Apartment ";

for ($tempvariable=0; $tempvariable<count($nmdata['tags']); $tempvariable++) {
$temptag = $nmdata['tags'][$tempvariable];
$temptag = str_replace("_", "", $temptag);
$temptag = str_replace("-", "", $temptag);

$tempdisplay = ucwords($temptag);
$tempurl = get_site_url(false).$temptag;

//echo "tempdisplay : ".$tempdisplay."<br>";
//echo "tempurl : ".$tempurl."<br>";
echo "<a href=\"$tempurl\" target=\"_blank\">$tempdisplay</a> ";
}

echo "</p>";
}

?>

simply, it will get the tags of the post and find _barcelona, transform it in barcelona and make a link to mywebsite.com/barcelona with anchor "Barcelona".

I do like this for all my tags. So one tag = one static page. The good thing is that like this I can work meta title, h1 and general seo of this page the way I want.

ALso for posts, if you do it for seo, don't forget to use nm_title to have a good different seo title for each post and a different canonnical url too !

I find it very interesting to use in my content.

For instance, if I write an article "5 reasons why you should consider buying a property in Barcelona".

I can make my article :

introduction

<h2>reason 1</h2>

reason1_text

insertion of a post with my last property

end of reason1_text

<h2>reason 2</h2>

...

If i make another component with changes of how it is displayed, it will look great in the content and very natural. Also if I use the nm_set_custom_offset($offset) i will make sure to not display the same listing and i can through this page display my 5 last listings wit the right offset.

-----

this is how i am using right now.

Let's imagine I have a tag _luxury and my apartments are in Madrid, Barcelona and Bilbao.

I will create a page with slug "luxury" etc.

Is there a possibility now to have a search like : luxury and madrid for instance ? @Carlos

If I can do that then everything is perfect Wink .

Thanks,

Pablito
Reply
Hello Carlos,

i hope maybe you can help me with my 2 questions :

1) Would it be possible to have target="_blank" on these page for posts ?
2) Can we use combination of two tags ?

Thanks in advance for everything you do to maintain this project.


3) another feature I would like would be a plugin to change everyday the date of the last post to make a rotation (it can make sense sometimes).

Is there a way to order such a plug in ?
Reply
How to solve pagination canonical for main new url :

go to newsmanager/inc/site.php

function nm_fix_get_header_full($function='get_header', $param2=null) {
// TODO: paginated, etc.
$canonical = false;
if (nm_is_single())
$canonical = nm_post_url(false);
elseif (nm_is_tag())
$canonical = nm_get_url('tag').rawurlencode(nm_single_tag_title('','',false));
elseif (nm_is_archive())
$canonical = nm_get_url('archive').intval($_GET[NMPARAMARCHIVE]);
elseif (nm_is_main() && intval($_GET[NMPARAMPAGE])>0) {
$canonical = nm_get_url('page').intval($_GET[NMPARAMPAGE]);
}
if ($canonical) {
$function(false, $param2);
echo '<link rel="canonical" href="',$canonical,'" />',"\n";
} else {
$function(true, $param2);
}
}

We need to update this function wit a little fix. We see there is a work in progress about canonical.

function nm_fix_get_header_full($function='get_header', $param2=null) {
// TODO: paginated, etc.
$canonical = false;
if (nm_is_single())
$canonical = nm_post_url(false);
elseif (nm_is_tag())
$canonical = nm_get_url('tag').rawurlencode(nm_single_tag_title('','',false));
elseif (nm_is_archive())
$canonical = nm_get_url('archive').intval($_GET[NMPARAMARCHIVE]);
elseif (nm_is_main() && intval($_GET[NMPARAMPAGE])>0)
$canonical = nm_get_url('page').intval($_GET[NMPARAMPAGE]);
if ($canonical) {
$function(false, $param2);
echo '<link rel="canonical" href="',$canonical,'" />',"\n";
} else {
$function(true, $param2);
}
}


------
The modif is :
elseif (nm_is_main() && intval($_GET[NMPARAMPAGE])>0)
$canonical = nm_get_url('page').intval($_GET[NMPARAMPAGE]);
Reply
For seo, a change on site.php :

// patch for <title> tag - single post or tag view
function nm_update_page_title() {
global $title, $nmpagetitle, $nmdata;

$nmpagetitle = false;
if (nm_is_site() && nm_get_option('titletag',true) && !function_exists('nmt_set_gstitle')) {
if (nm_is_single()) {
$tempdisplaytags = "";
for ($tempvariable=0; $tempvariable<count($nmdata['tags']); $tempvariable++) {

$temptag = $nmdata['tags'][$tempvariable];
$temptag = str_replace("_", "", $temptag);
$temptag = str_replace("-", "", $temptag);
$tempdisplay = ucwords($temptag);
$tempdisplaytags = $tempdisplaytags . " " . $tempdisplay;
}
$nmpagetitle = $title;
$title = nm_post_title('', ' - '.$title . $tempdisplaytags, false);
} elseif (nm_is_tag()) {
$nmpagetitle = $title;
$title = nm_single_tag_title('', ' - '.$title, false);
}
}
}

Search for this function and update like this. Your tags will be include in the meta title of the page of each post providing a better seo. Modify the position like you want.
Reply
Hi Carlos, don't know if this has been already worked out :

it is about url image post news manager updated version.

For me, it does not work when i paste URL directly in the "image" field under "post options"
(without using "select file" button)

Is it normal ?
Reply
Enable external images with imageExternal 1 in NM Custom Settings.
Reply
Wink 
(2020-06-02, 06:07:15)Carlos Wrote: Enable external images with imageExternal 1 in NM Custom Settings.

Thank you !
Reply




Users browsing this thread: 1 Guest(s)