• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Spaties verwijderen met strip_tags
PostPosted: Tue Dec 12, 2017 5:31 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Thu Mar 23, 2006 9:25 am
Posts: 1813
Location: The Netherlands
Op de plaatsen waar ik {$page_description} gebruik viel me op dat er aan het begin en het einde van de string een spatie blijft staan, bijv. in de meta-tag:
Quote:
<meta name="description" content=" Bestaande Lewmar kajuitramen (patrijspoorten) vervangen door een zelfgemaakt acrylaatramen. ">

In CGBlog maakte ik de variabele aan:
Code:
{$page_description = $entry->summary|default:$entry->content|strip_tags|strip|truncate:150 scope=global}


Na enig zoeken kwam ik erachter dat je de spaties aan begin en einde kunt weghalen door 'false' aan strip_tags toe te voegen, dus:
Code:
{$page_description = $entry->summary|default:$entry->content|strip_tags:false|strip|truncate:150 scope=global}


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Spaties verwijderen met strip_tags
PostPosted: Fri Dec 15, 2017 9:14 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Wed Apr 23, 2008 7:53 am
Posts: 7618
Location: The Netherlands
Goede tip!
Kleine aanvulling, van Google mag je nu 300 tekens gebruiken in de "description". Dus de 150 in de geposte code kan 300 worden!

_________________
Image

Did my post help you solving a problem at your (customers) website and it saved you many hours of work? Great!! Consider buying me a cup of coffee in return!



Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Spaties verwijderen met strip_tags
PostPosted: Sat Dec 16, 2017 8:26 am 
Offline
Power Poster
Power Poster
User avatar

Joined: Thu Mar 23, 2006 9:25 am
Posts: 1813
Location: The Netherlands
Dank je.
Zal de description aanpassen. Heb je nog meer Google-tips? Misschien het “oude” seo topic weer activeren.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
A2 Hosting