Closed iwasingh closed 7 years ago
I don't know what exactly you are trying to achieve here. Do you want to disable/remove the default title on entire site or just for your controller/controller method?
Yes, in a certain way, i want disable/remove the default title for my controller/controller method.
As the docs says to set the default title to false if you do not want it, so the simple way of doing that is to override it in your controller.
/** Display the specified resource. **/
public function show(Request $request){
config(['seotools.meta.defaults.title' => false]);
$this->seo()->setTitle("Your title");
return view('your.view');
}
Update If it is necessary that the controller always have to hide the title by default, simply move the configuration line to the constructor
Problem solved, thank you!
If I may make a suggestion - the way this is explain in the docs is not very clear. "default" usually means the value that's used when none is explicitly set. The fact that it's appended to a value unless explicitly disabled is a little strange.
Great plugin though!
Hi and thanks for the great work. I don't know why but whenever i set new title in my controller, for example with
SEO::setTitle('test');
orSEO::setTitle('test',false);
the defaults value of title on seotools.php is appendend. That means the final title of the page will be 'test+defaults_title'. How can i override the value on seotools.php or disable the append of the default title?here is the seotools.php `<?php
return [ 'meta' => [ /*
The default configurations to be used by the meta generator. */
canonical url: https://moz.com/blog/canonical-url-tag-the-most-important-advancement-in-seo-practices-since-sitemaps */ 'defaults' => [ 'title' => "myDefaultString", // set false to total remove 'description' => "MyDefaultDescription.", // set false to total remove 'separator' => false, 'keywords' => [ 'test'], 'canonical' => false, // Set null for using Url::current(), set false to total remove //multiple pages considered as one ],
/*
The default configurations to be used by the opengraph generator. */
], 'twitter' => [ /*