Quantcast
Channel: Joomla! Forum - community, help and support
Viewing all articles
Browse latest Browse all 1505

Joomla! 4.x Coding • Meta-title tag via Joomla API

$
0
0
Hello,
I'm testing with the API to accurately define the Meta description and Meta title tags for my article.
Below is an excerpt of the code:

Code:

$this->article = ['title' => $article->titre.$now,'articletext' => $content2,'state' => 1,'catid' => $this->categorie,'tags' => $tags,'alias' => $article->slug.$now,'metakey' => $article->metaKey,'metadesc' => $article->metaDescription,'language' => "*",'metadata' => [     'title' => 'Test Meta Title personnalisé',     'author' => $name,     'robots' => 'index, follow',     'rights' => 'All rights reserved',],'images' => ['image_intro' => $urlImage,'image_intro_alt' => $article->titre,'image_fulltext' => $urlImage,'image_fulltext_alt' => $article->titre,],
the line

Code:

'metadesc' => $article->metaDescription,
works well. I retrieve the correct Meta description in my article but I cannot do it for the Meta title.

​I tried to do it like this

Code:

'metatitle' => $article->metaTitle,
it doesn't work.
I haven't seen any information about this in the documentation.

Do you have an idea?

Thanks

Statistics: Posted by ec83 — Mon Aug 19, 2024 4:06 pm



Viewing all articles
Browse latest Browse all 1505

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>