<?php
namespace App\Controller\Front;
use App\Entity\Menu;
use App\Entity\Post;
use App\Entity\UrlRef;
use App\Entity\UrlPost;
use App\Entity\Category;
use App\Entity\Language;
use App\Entity\ListeRef;
use App\Entity\MediaCms;
use App\Entity\Secteurs;
use App\Entity\TypePost;
use App\Entity\Activites;
use App\Entity\ListeMenu;
use App\Service\BuildTree;
use App\Entity\CpPostField;
use App\Entity\PostArchive;
use App\Service\RenderBloc;
use Spatie\SchemaOrg\Graph;
use App\Entity\ParametreRef;
use App\Entity\PostCategory;
use App\Service\MetaService;
use Spatie\SchemaOrg\Schema;
use App\Entity\ModelGallerie;
use App\Entity\ParametreSite;
use App\Entity\ReseauSociaux;
use App\Service\MetaClePageRef;
use App\Service\FunctionService;
use App\Service\AffichageGallerieService;
use App\Entity\ActiviteSecondaire;
use App\Entity\CpField;
use App\Entity\ParametrePost;
use App\Service\RefMetaTagsService;
use App\Service\MetaWithoutCategoryService;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\HttpFoundation\JsonResponse;
use Leogout\Bundle\SeoBundle\Seo\Og\OgSeoGenerator;
use Symfony\Component\String\Slugger\SluggerInterface;
use Leogout\Bundle\SeoBundle\Seo\Basic\BasicSeoGenerator;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
class PageCategorieController extends AbstractController
{
public $basicSeo;
public $seo;
private $slugger;
private $projectDir;
private $metaService;
private $metaClePageRef;
private $renderBloc;
private $buildTree;
private $functionService;
private $metaPostService;
private $theme;
private $refMetaTagsService;
private $affichageGallerieService;
public function __construct(string $projectDir,string $theme,
BasicSeoGenerator $basicSeo,
OgSeoGenerator $seo,
RenderBloc $renderBloc,
RefMetaTagsService $refMetaTagsService,
SluggerInterface $slugger,
BuildTree $buildTree,
MetaService $metaService,
MetaWithoutCategoryService $metaPostService,
MetaClePageRef $metaClePageRef,
FunctionService $functionService,
AffichageGallerieService $affichageGallerieService){
$this->metaService = $metaService;
$this->metaPostService = $metaPostService;
$this->basicSeo = $basicSeo;
$this->seo = $seo;
$this->buildTree = $buildTree;
$this->slugger = $slugger;
$this->metaClePageRef = $metaClePageRef;
$this->functionService = $functionService;
$this->refMetaTagsService = $refMetaTagsService;
$this->renderBloc = $renderBloc;
$this->projectDir = $projectDir;
$this->theme = $theme;
$this->affichageGallerieService = $affichageGallerieService;
}
/**
* @Route("/{categorie1}/{categorie2}", name="page_sous_categorie",priority="-2")
*/
public function PageCategorieN2(Request $request,$categorie1,$categorie2,$page = 1){
$_locale = $request->getLocale();
if($request->query->get('page')){
$page = $request->query->get('page');
}
$slug_lang = $this->getDoctrine()->getRepository(UrlPost::class)->findLangUrl($categorie1);
if ($slug_lang['locale'] != $_locale) {
$request->getSession()->set('_locale', $slug_lang['locale']);
return $this->redirectToroute('page_sous_categorie',['categorie1'=> $categorie1,'categorie2'=>$categorie2]);
}
$categorie = $this->getDoctrine()->getRepository(Category::class)->findCategoryBySlug($categorie1);
$sous_categorie = $this->getDoctrine()->getRepository(Category::class)->findCategoryBySlug($categorie2);
$post = $this->getDoctrine()->getRepository(Post::class)->findPostBySlug($categorie2);
if(empty($categorie) || (empty($sous_categorie) && empty($post))){
throw new NotFoundHttpException('Sorry not existing!');
}
if ($sous_categorie != null) {
$this->MetaModulePostOrCategory($request,$categorie2,'Sous-categorie');
$template = $this->PageSousCategorie($request,$categorie,$sous_categorie,$page);
}else{
if ($post->getTypePost()->translate($_locale)->getSystemName() != 'produits') {
return $this->redirectToRoute('page',['slug'=> $categorie2]);
}
$this->MetaModulePostOrCategory($request,$categorie2,'Post');
$template = $this->PageProduit($request,$post,$categorie);
}
return $template;
}
/**
* @Route("/{categorie1}/{categorie2}/{categorie3}", name="page_sous_sous_categorie",priority="-2")
*/
public function PageCategorieN3(Request $request,$categorie1,$categorie2,$categorie3,$page = 1){
$_locale = $request->getLocale();
if($request->query->get('page')){
$page = $request->query->get('page');
}
$slug_lang = $this->getDoctrine()->getRepository(UrlPost::class)->findLangUrl($categorie1);
if ($slug_lang['locale'] != $_locale) {
$request->getSession()->set('_locale', $slug_lang['locale']);
return $this->redirectToroute('page_sous_sous_categorie',['categorie1'=> $categorie1,'categorie2'=>$categorie2,'categorie3'=>$categorie3]);
}
$categorie = $this->getDoctrine()->getRepository(Category::class)->findCategoryBySlug($categorie1);
$sous_categorie = $this->getDoctrine()->getRepository(Category::class)->findCategoryBySlug($categorie2);
$sous_sous_categorie = $this->getDoctrine()->getRepository(Category::class)->findCategoryBySlug($categorie3);
$post = $this->getDoctrine()->getRepository(Post::class)->findPostBySlug($categorie3);
if((empty($categorie) && empty($sous_categorie)) || (empty($sous_sous_categorie) && empty($post))){
throw new NotFoundHttpException('Sorry not existing!');
}
if ($sous_sous_categorie != null) {
$this->MetaModulePostOrCategory($request,$categorie3,'Sous-sous-categorie');
$template = $this->PageSousSousCategorie($request,$categorie,$sous_categorie,$sous_sous_categorie,$page);
}else{
$this->MetaModulePostOrCategory($request,$categorie3,'Post');
$template = $this->PageProduit($request,$post,$categorie,$sous_categorie,$sous_sous_categorie);
}
return $template;
}
/**
* @Route("/{categorie1}/{categorie2}/{categorie3}/{slug_produit}", name="page_produit",priority="-2")
*/
public function PageCategorieProduit(Request $request,$categorie1,$categorie2,$categorie3,$slug_produit,$page = 1){
$_locale = $request->getLocale();
if($request->query->get('page')){
$page = $request->query->get('page');
}
$slug_lang = $this->getDoctrine()->getRepository(UrlPost::class)->findLangUrl($categorie1);
if ($slug_lang['locale'] != $_locale) {
$request->getSession()->set('_locale', $slug_lang['locale']);
return $this->redirectToroute('page_produit',[
'categorie1'=> $categorie1,'categorie2'=>$categorie2,
'categorie3'=>$categorie3,'slug_produit' => $slug_produit]);
}
$categorie = $this->getDoctrine()->getRepository(Category::class)->findCategoryBySlug($categorie1);
$sous_categorie = $this->getDoctrine()->getRepository(Category::class)->findCategoryBySlug($categorie2);
$sous_sous_categorie = $this->getDoctrine()->getRepository(Category::class)->findCategoryBySlug($categorie3);
$post = $this->getDoctrine()->getRepository(Post::class)->findPostBySlug($slug_produit);
if(empty($categorie) && empty($sous_categorie) && empty($sous_sous_categorie) && empty($post)){
throw new NotFoundHttpException('Sorry not existing!');
}
$this->MetaModulePostOrCategory($request,$slug_produit,'Post');
$template = $this->PageProduit($request,$post,$categorie,$sous_categorie,$sous_sous_categorie,$post);
return $template;
}
public function PageSousCategorie($request,$categorie,$sous_categorie,$page){
$module = 'category';
$resultats = [];
$schemaOrg = new Graph();
$_locale = $request->getLocale();
$home = $this->getDoctrine()->getRepository(Post::class)->findPostBySlug('Home');
$template = $sous_categorie->getTypeAffichageHome();
$bloc_categorie = $this->renderBloc->RenderBloc($sous_categorie,$schemaOrg,'categorie');
$show_filter_categorie = $categorie->getTypePost()->getFilterCategorie();
// Galleries
$galleries_images = [];
$modele_galerie_choisie = $sous_categorie->getModeleGallerie() ? $sous_categorie->getModeleGallerie()->getId() : 1;
$modele_gallerie = $this->getDoctrine()->getRepository(ModelGallerie::class)->findById($modele_galerie_choisie);
$galleries = $this->getDoctrine()->getRepository(MediaCms::class)->findFileByModule($module,$sous_categorie->getId(),'media');
$galleries_images = $this->affichageGallerieService->GallerieImages($galleries,$galleries_images);
$template_model_galerie = $modele_gallerie[0]->getTwig();
$title_home_ariane = $home->getBreadcrumb() ? $home->getBreadcrumb() : "Accueil";
$meta_robots = $sous_categorie->getMetaRobots();
$schema_breadcrumb_items = [];
$breadcrumb = [];
$breadcrumb [] = ['url'=> $this->generateUrl('index_home', [], UrlGeneratorInterface::ABSOLUTE_URL),'name'=> $title_home_ariane,'active'=> true];
$schema_breadcrumb_items[] = Schema::ListItem()->position(1)
->item(["@id"=> $this->generateUrl('index_home', [], UrlGeneratorInterface::ABSOLUTE_URL),"name"=> $title_home_ariane]);
$breadcrumb [] = ['url'=> $this->generateUrl('page', ['slug'=> $categorie->translate($_locale)->getSlugUrl()], UrlGeneratorInterface::ABSOLUTE_URL),'name'=> $categorie->translate($_locale)->getTitreCategorie(),'active'=> true];
$schema_breadcrumb_items[] = Schema::ListItem()->position(2)
->item(["@id"=> $this->generateUrl('page', ['slug'=> $categorie->translate($_locale)->getSlugUrl()], UrlGeneratorInterface::ABSOLUTE_URL),"name"=> $categorie->translate($_locale)->getTitreCategorie()]);
$breadcrumb [] = ['url'=> $this->generateUrl('page_sous_categorie', ['categorie1'=> $categorie->translate($_locale)->getSlugUrl(),'categorie2'=> $sous_categorie->translate($_locale)->getSlugUrl()], UrlGeneratorInterface::ABSOLUTE_URL),'name'=> $sous_categorie->translate($_locale)->getTitreCategorie(),'active'=> false];
$schema_breadcrumb_items[] = Schema::ListItem()->position(3)
->item(["@id"=> $this->generateUrl('page_sous_categorie', ['categorie1'=> $categorie->translate($_locale)->getSlugUrl(),'categorie2'=> $sous_categorie->translate($_locale)->getSlugUrl()], UrlGeneratorInterface::ABSOLUTE_URL),"name"=> $sous_categorie->translate($_locale)->getTitreCategorie()]);
if ($schema_breadcrumb_items) {
$schemaOrg->add(Schema::BreadcrumBList()->itemListElement($schema_breadcrumb_items));
}
$baseurl = $request->getScheme() . '://' . $request->getHttpHost() . $request->getBasePath();
$schemaOrg->add(Schema::Article()
->headline($sous_categorie->translate($_locale)->getTitreCategorie())
->datePublished($sous_categorie->getCreatedAt())
->dateModified($sous_categorie->getUpdatedAt())
->image($sous_categorie->getImage()!= null?$baseurl.$sous_categorie->getImage():'')
->publisher(Schema::Organization()
->name($this->functionService->parametreGenerale()?$this->functionService->parametreGenerale()->translate($_locale)->getTitre():'')
->logo($this->functionService->parametreGenerale()?$baseurl.'/public/uploads/images/'.$this->functionService->parametreGenerale()->getImage():''))
->mainEntityOfPage(Schema::WebPage()->url($this->generateUrl('page_sous_categorie', ['categorie1'=> $categorie->translate($_locale)->getSlugUrl(),'categorie2'=> $sous_categorie->translate($_locale)->getSlugUrl()],
UrlGeneratorInterface::ABSOLUTE_URL)))
);
$docs = $this->getDoctrine()->getRepository(MediaCms::class)->findFileByModule($module,$categorie->getId(),'doc');
$parametre = $this->functionService->parametreGenerale();
$categories_tree = [];
$categories_principal = $this->getDoctrine()->getRepository(Category::class)->findBy(['actif'=> true,'parent'=> 0,'sousParent'=> 0,'TypePost'=> $categorie->getTypePost()]);
if ($categories_principal) {
foreach ($categories_principal as $value) {
$data_slug_sous_categorie = [];
$tree_sous_categorie = $this->getDoctrine()->getRepository(Category::class)->findBy(['actif'=> true,'parent'=> $value->getId()],['position'=>'ASC']);
if($tree_sous_categorie){
foreach ($tree_sous_categorie as $sous_categorie_items) {
$data_slug_sous_sous_categorie = [];
$tree_sous_sous_categorie = $this->getDoctrine()->getRepository(Category::class)->findBy(['actif'=> true,'parent'=> 0,'sousParent'=> $sous_categorie_items->getId()],['position'=>'ASC']);
if ($tree_sous_sous_categorie) {
foreach ($tree_sous_sous_categorie as $sous_sous_categorie_items) {
$data_slug_sous_sous_categorie[] = [
'id'=> $sous_sous_categorie_items->getId(),
'titre'=> $sous_sous_categorie_items->translate($_locale)->getTitreCategorie(),
'slug'=> $sous_sous_categorie_items->translate($_locale)->getSlugUrl()];
}
}
$data_slug_sous_categorie[] = ['id'=> $sous_categorie_items->getId(),
'titre'=> $sous_categorie_items->translate($_locale)->getTitreCategorie(),
'slug'=> $sous_categorie_items->translate($_locale)->getSlugUrl(),
'sous_sous_categories'=> $data_slug_sous_sous_categorie,
];
}
}
$categories_tree[] = ['id'=> $value->getId(),
'titre'=> $value->translate($_locale)->getTitreCategorie(),
'slug'=> $value->translate($_locale)->getSlugUrl(),
'sous_categories'=> $data_slug_sous_categorie,
];
}
}
$parametrePost = $this->getDoctrine()->getRepository(ParametrePost::class)->findOneBy(['TypePost'=> $categorie->getTypePost()]);
if($parametrePost->getShowCategories()) {
$sous_s_categorie = $this->getDoctrine()->getRepository(Category::class)->findBy(['actif'=> true,'parent'=> '0','sousParent'=> $sous_categorie->getId()],['position'=>'ASC']);
if ($sous_s_categorie) {
$posts = $this->getDoctrine()->getRepository(Category::class)->findSousCategorie($sous_categorie,$page);
$postItems = $sous_categorie->getPagination() == true?$posts->getResults():$sous_s_categorie;
foreach ($postItems as $value) {
$resultats[] = [ 'id'=> $value->getId(),
'slug'=> $value->translate($_locale)->getSlugUrl(),
'slug_categorie_parent'=> $categorie->translate($_locale)->getSlugUrl(),
'slug_sous_categorie'=> $sous_categorie->translate($_locale)->getSlugUrl(),
'titre'=> $value->translate($_locale)->getTitreCategorie(),
'title_affichage'=> null,
'content'=> $value->translate($_locale)->getTexteCategorie(),
'chapeau'=> $value->translate($_locale)->getChapeauCategorie(),
'image'=> $value->getImage(),
'typelien'=> $value->getTypeLien(),
'titrelien'=> $value->getTitreLien(),
'telephone'=> $value->getTelephone(),
'lieninterne'=> $value->getLienInterne(),
'lienexterne'=> $value->getLienExterne(),
];
}
}else{
$posts = $this->getDoctrine()->getRepository(Post::class)->findPostBySpecifiqueCategory($sous_categorie,$page,$this->functionService->findRelatedIdsByCategorie($categories_tree,$sous_categorie->getId(),'2'));
$postItems = $categorie->getPagination() == true ?$posts->getResults():$posts;
if ($postItems) {
foreach ($postItems as $value) {
$galleries_first_image = $this->affichageGallerieService->FirstGallerieImagePost($value);
// Champs personnalisés
$champsPersonnalisesPost = [];
$champsPersonnalisesPost = $this->functionService->getChampsPersonnalisesPost($value);
$resultats[] = [ 'id'=> $value->getId(),
'slug'=> $value->getSlug(),
'titre'=> $value->getTitle(),
'title_affichage'=> $value->getTitleAffichage(),
'slug_categorie_parent'=> $categorie->translate($_locale)->getSlugUrl(),
'slug_sous_categorie'=> $sous_categorie->translate($_locale)->getSlugUrl(),
'content'=> $value->getContent(),
'chapeau'=> $value->getSummary(),
'image'=> $value->getImage(),
'image_couverture'=> $value->getImageCouverture(),
'galleries_first_image'=> $galleries_first_image,
'typelien'=> $value->getTypeLien(),
'titrelien'=> $value->getTitreLien(),
'telephone'=> $value->getTelephone(),
'lieninterne'=> $value->getLienInterne(),
'lienexterne'=> $value->getLienExterne(),
'prixproduit'=> $value->getPrixProduit(),
'referance'=> $value->getReferanceProduit(),
'champsPersonnalisesPost' => $champsPersonnalisesPost];
}
}
}
}else {
$posts = $this->getDoctrine()->getRepository(Post::class)->findPostBySpecifiqueCategory($sous_categorie,$page,$this->functionService->findRelatedIdsByCategorie($categories_tree,$sous_categorie->getId(),'2'));
$postItems = $categorie->getPagination() == true ?$posts->getResults():$posts;
if ($postItems) {
foreach ($postItems as $value) {
$galleries_first_image = $this->affichageGallerieService->FirstGallerieImagePost($value);
// Champs personnalisés
$champsPersonnalisesPost = [];
$champsPersonnalisesPost = $this->functionService->getChampsPersonnalisesPost($value);
$resultats[] = [ 'id'=> $value->getId(),
'slug'=> $value->getSlug(),
'titre'=> $value->getTitle(),
'title_affichage'=> $value->getTitleAffichage(),
'slug_categorie_parent'=> $categorie->translate($_locale)->getSlugUrl(),
'slug_sous_categorie'=> $sous_categorie->translate($_locale)->getSlugUrl(),
'content'=> $value->getContent(),
'chapeau'=> $value->getSummary(),
'image'=> $value->getImage(),
'image_couverture'=> $value->getImageCouverture(),
'galleries_first_image'=> $galleries_first_image,
'typelien'=> $value->getTypeLien(),
'titrelien'=> $value->getTitreLien(),
'telephone'=> $value->getTelephone(),
'lieninterne'=> $value->getLienInterne(),
'lienexterne'=> $value->getLienExterne(),
'prixproduit'=> $value->getPrixProduit(),
'referance'=> $value->getReferanceProduit(),
'champsPersonnalisesPost' => $champsPersonnalisesPost];
}
}
}
return $this->render('front/'.$this->theme.'/produits/page_sous_categorie.html.twig',[
'template'=> $template,
'categories_tree'=> $categories_tree,
'title_home_ariane' => $title_home_ariane,
'categorie'=> $categorie,
'sous_categorie'=> $sous_categorie,
'resultats'=> $resultats,
'blocs'=> $bloc_categorie,
'show_filter_categorie'=> $show_filter_categorie,
'posts'=> $posts,
'meta_robots'=> $meta_robots,
'pagination'=> $sous_categorie->getPagination(),
'schemaOrg'=> $schemaOrg,
'galleries'=> $galleries_images,
'docs'=> $docs,
'breadcrumb'=> $breadcrumb,
'parametre'=> $parametre,
'modele_galerie' => $modele_gallerie,
'template_model_gallerie' => $template_model_galerie,
]);
}
public function PageSousSousCategorie($request,$categorie,$sous_categorie,$sous_sous_categorie,$page){
$module = 'category';
$resultats = [];
$schemaOrg = new Graph();
$_locale = $request->getLocale();
$home = $this->getDoctrine()->getRepository(Post::class)->findPostBySlug('Home');
$template = $sous_categorie->getTypeAffichageHome();
$bloc_categorie = $this->renderBloc->RenderBloc($sous_sous_categorie,$schemaOrg,'categorie');
$show_filter_categorie = $categorie->getTypePost()->getFilterCategorie();
// Galleries
$galleries_images = [];
$modele_galerie_choisie = $sous_sous_categorie->getModeleGallerie() ? $sous_sous_categorie->getModeleGallerie()->getId() : 1;
$modele_gallerie = $this->getDoctrine()->getRepository(ModelGallerie::class)->findById($modele_galerie_choisie);
$galleries = $this->getDoctrine()->getRepository(MediaCms::class)->findFileByModule($module,$sous_sous_categorie->getId(),'media');
$galleries_images = $this->affichageGallerieService->GallerieImages($galleries,$galleries_images);
$template_model_galerie = $modele_gallerie[0]->getTwig();
$title_home_ariane = $home->getBreadcrumb() ? $home->getBreadcrumb() : "Accueil";
$meta_robots = $sous_categorie->getMetaRobots();
$schema_breadcrumb_items = [];
$breadcrumb = [];
$breadcrumb [] = ['url'=> $this->generateUrl('index_home', [], UrlGeneratorInterface::ABSOLUTE_URL),'name'=> $title_home_ariane,'active'=> true];
$schema_breadcrumb_items[] = Schema::ListItem()->position(1)
->item(["@id"=> $this->generateUrl('index_home', [], UrlGeneratorInterface::ABSOLUTE_URL),"name"=> $title_home_ariane]);
$breadcrumb [] = ['url'=> $this->generateUrl('page', ['slug'=> $categorie->translate($_locale)->getSlugUrl()], UrlGeneratorInterface::ABSOLUTE_URL),'name'=> $categorie->translate($_locale)->getTitreCategorie(),'active'=> true];
$schema_breadcrumb_items[] = Schema::ListItem()->position(2)
->item(["@id"=> $this->generateUrl('page', ['slug'=> $categorie->translate($_locale)->getSlugUrl()], UrlGeneratorInterface::ABSOLUTE_URL),"name"=> $categorie->translate($_locale)->getTitreCategorie()]);
$breadcrumb [] = ['url'=> $this->generateUrl('page_sous_categorie', ['categorie1'=> $categorie->translate($_locale)->getSlugUrl(),'categorie2'=> $sous_categorie->translate($_locale)->getSlugUrl()], UrlGeneratorInterface::ABSOLUTE_URL),'name'=> $sous_categorie->translate($_locale)->getTitreCategorie(),'active'=> true];
$schema_breadcrumb_items[] = Schema::ListItem()->position(3)
->item(["@id"=> $this->generateUrl('page_sous_categorie', ['categorie1'=> $categorie->translate($_locale)->getSlugUrl(),'categorie2'=> $sous_categorie->translate($_locale)->getSlugUrl()], UrlGeneratorInterface::ABSOLUTE_URL),"name"=> $sous_categorie->translate($_locale)->getTitreCategorie()]);
$breadcrumb [] = ['url'=> $this->generateUrl('page_sous_sous_categorie', [
'categorie1'=> $categorie->translate($_locale)->getSlugUrl(),
'categorie2'=> $sous_categorie->translate($_locale)->getSlugUrl(),
'categorie3'=> $sous_sous_categorie->translate($_locale)->getSlugUrl(),
], UrlGeneratorInterface::ABSOLUTE_URL),'name'=> $sous_sous_categorie->translate($_locale)->getTitreCategorie(),'active'=> false];
$schema_breadcrumb_items[] = Schema::ListItem()->position(4)
->item(["@id"=> $this->generateUrl('page_sous_sous_categorie', [
'categorie1'=> $categorie->translate($_locale)->getSlugUrl(),
'categorie2'=> $sous_categorie->translate($_locale)->getSlugUrl(),
'categorie3'=> $sous_sous_categorie->translate($_locale)->getSlugUrl(),
], UrlGeneratorInterface::ABSOLUTE_URL),"name"=> $sous_sous_categorie->translate($_locale)->getTitreCategorie()]);
if ($schema_breadcrumb_items) {
$schemaOrg->add(Schema::BreadcrumBList()->itemListElement($schema_breadcrumb_items));
}
$baseurl = $request->getScheme() . '://' . $request->getHttpHost() . $request->getBasePath();
$schemaOrg->add(Schema::Article()
->headline($sous_sous_categorie->translate($_locale)->getTitreCategorie())
->datePublished($sous_sous_categorie->getCreatedAt())
->dateModified($sous_sous_categorie->getUpdatedAt())
->image($sous_sous_categorie->getImage()!= null?$baseurl.$sous_sous_categorie->getImage():'')
->publisher(Schema::Organization()
->name($this->functionService->parametreGenerale()?$this->functionService->parametreGenerale()->translate($_locale)->getTitre():'')
->logo($this->functionService->parametreGenerale()?$baseurl.'/public/uploads/images/'.$this->functionService->parametreGenerale()->getImage():''))
->mainEntityOfPage(Schema::WebPage()->url($this->generateUrl('page_sous_sous_categorie', [
'categorie1'=> $categorie->translate($_locale)->getSlugUrl(),
'categorie2'=> $sous_categorie->translate($_locale)->getSlugUrl(),
'categorie3'=> $sous_sous_categorie->translate($_locale)->getSlugUrl()
], UrlGeneratorInterface::ABSOLUTE_URL)))
);
$docs = $this->getDoctrine()->getRepository(MediaCms::class)->findFileByModule($module,$sous_sous_categorie->getId(),'doc');
$parametre = $this->functionService->parametreGenerale();
$categories_tree = [];
$categories_principal = $this->getDoctrine()->getRepository(Category::class)->findBy(['actif'=> true,'parent'=> 0,'sousParent'=> 0,'TypePost'=> $categorie->getTypePost()],['position'=> 'ASC']);
if ($categories_principal) {
foreach ($categories_principal as $value) {
$data_slug_sous_categorie = [];
$tree_sous_categorie = $this->getDoctrine()->getRepository(Category::class)->findBy(['actif'=> true,'parent'=> $value->getId()],['position'=>'ASC']);
if($tree_sous_categorie){
foreach ($tree_sous_categorie as $sous_categorie_items) {
$data_slug_sous_sous_categorie = [];
$tree_sous_sous_categorie = $this->getDoctrine()->getRepository(Category::class)->findBy(['actif'=> true,'parent'=> 0,'sousParent'=> $sous_categorie_items->getId()],['position'=>'ASC']);
if ($tree_sous_sous_categorie) {
foreach ($tree_sous_sous_categorie as $sous_sous_categorie_items) {
$data_slug_sous_sous_categorie[] = [
'id'=> $sous_sous_categorie_items->getId(),
'titre'=> $sous_sous_categorie_items->translate($_locale)->getTitreCategorie(),
'slug'=> $sous_sous_categorie_items->translate($_locale)->getSlugUrl()];
}
}
$data_slug_sous_categorie[] = ['id'=> $sous_categorie_items->getId(),
'titre'=> $sous_categorie_items->translate($_locale)->getTitreCategorie(),
'slug'=> $sous_categorie_items->translate($_locale)->getSlugUrl(),
'sous_sous_categories'=> $data_slug_sous_sous_categorie,
];
}
}
$categories_tree[] = ['id'=> $value->getId(),
'titre'=> $value->translate($_locale)->getTitreCategorie(),
'slug'=> $value->translate($_locale)->getSlugUrl(),
'sous_categories'=> $data_slug_sous_categorie,
];
}
}
if ($sous_sous_categorie->getPagination() == true) {
$posts = $this->getDoctrine()->getRepository(Post::class)->findPostBySpecifiqueCategory($sous_sous_categorie,$page,$this->functionService->findRelatedIdsByCategorie($categories_tree,$sous_sous_categorie->getId(),'3'));
if($posts->getResults()){
foreach ($posts->getResults() as $value) {
$galleries_first_image = $this->affichageGallerieService->FirstGallerieImagePost($value);
$champsPersonnalisesPost = [];
$champsPersonnalisesPost = $this->functionService->getChampsPersonnalisesPost($value);
$resultats[] = [ 'id'=> $value->getId(),
'slug'=> $value->getSlug(),
'titre'=> $value->getTitle(),
'title_affichage'=> $value->getTitleAffichage(),
'slug_categorie_parent'=> $categorie->translate($_locale)->getSlugUrl(),
'slug_sous_categorie'=> $sous_categorie->translate($_locale)->getSlugUrl(),
'slug_sous_sous_categorie'=> $sous_sous_categorie->translate($_locale)->getSlugUrl(),
'content'=> $value->getContent(),
'chapeau'=> $value->getSummary(),
'image'=> $value->getImage(),
'typelien'=> $value->getTypeLien(),
'titrelien'=> $value->getTitreLien(),
'telephone'=> $value->getTelephone(),
'lieninterne'=> $value->getLienInterne(),
'lienexterne'=> $value->getLienExterne(),
'prixproduit'=> $value->getPrixProduit(),
'referance'=> $value->getReferanceProduit(),
'galleries_first_image'=> $galleries_first_image,
'champsPersonnalisesPost' => $champsPersonnalisesPost
];
}
}
}else{
$posts = $this->getDoctrine()->getRepository(Post::class)->findPostBySpecifiqueCategory($sous_sous_categorie,$page,$this->functionService->findRelatedIdsByCategorie($categories_tree,$sous_sous_categorie->getId(),'3'));
if($posts){
foreach ($posts as $value) {
$galleries_first_image = $this->affichageGallerieService->FirstGallerieImagePost($value);
$champsPersonnalisesPost = [];
$champsPersonnalisesPost = $this->functionService->getChampsPersonnalisesPost($value);
$resultats[] = [ 'id'=> $value->getId(),
'slug'=> $value->getSlug(),
'titre'=> $value->getTitle(),
'title_affichage'=> $value->getTitleAffichage(),
'slug_categorie_parent'=> $categorie->translate($_locale)->getSlugUrl(),
'slug_sous_categorie'=> $sous_categorie->translate($_locale)->getSlugUrl(),
'slug_sous_sous_categorie'=> $sous_sous_categorie->translate($_locale)->getSlugUrl(),
'content'=> $value->getContent(),
'chapeau'=> $value->getSummary(),
'image'=> $value->getImage(),
'typelien'=> $value->getTypeLien(),
'titrelien'=> $value->getTitreLien(),
'telephone'=> $value->getTelephone(),
'lieninterne'=> $value->getLienInterne(),
'lienexterne'=> $value->getLienExterne(),
'prixproduit'=> $value->getPrixProduit(),
'referance'=> $value->getReferanceProduit(),
'galleries_first_image'=> $galleries_first_image,
'champsPersonnalisesPost' => $champsPersonnalisesPost
];
}
}
}
return $this->render('front/'.$this->theme.'/produits/page_sous_sous_categorie.html.twig',[
'template'=> $template,
'categories_tree'=> $categories_tree,
'title_home_ariane' => $title_home_ariane,
'categorie'=> $categorie,
'sous_categorie'=> $sous_categorie,
'sous_sous_categorie'=> $sous_sous_categorie,
'show_filter_categorie'=> $show_filter_categorie,
'resultats'=> $resultats,
'blocs'=> $bloc_categorie,
'posts'=> $posts,
'meta_robots'=> $meta_robots,
'pagination'=> $sous_sous_categorie->getPagination(),
'schemaOrg'=> $schemaOrg,
'galleries'=> $galleries_images,
'docs'=> $docs,
'breadcrumb'=> $breadcrumb,
'parametre'=> $parametre,
'modele_galerie' => $modele_gallerie,
'template_model_gallerie' => $template_model_galerie,
]);
}
public function PageProduit($request,$post,$categorie1 = null,$categorie2 = null, $categorie3 = null){
$schemaOrg = new Graph();
$_locale = $request->getLocale();
$home = $this->getDoctrine()->getRepository(Post::class)->findPostBySlug('Home');
$modele_galerie_choisie = $post->getModeleGallerie() ? $post->getModeleGallerie()->getId() : 1;
$modele_gallerie = $this->getDoctrine()->getRepository(ModelGallerie::class)->findById($modele_galerie_choisie);
$baseurl = $request->getScheme() . '://' . $request->getHttpHost() . $request->getBasePath();
$seo_image = '';
$type_post = $post->getTypePost();
$show_filter_categorie = $type_post->getFilterCategorie();
$parametrePost = $this->getDoctrine()->getRepository(ParametrePost::class)->findOneBy(['TypePost'=> $type_post]);
if ($this->functionService->parametreGenerale()) {
if ($this->functionService->parametreGenerale()->getApercuImageLien()) {
$seo_image = $baseurl.'/public/uploads/images/'.$this->functionService->parametreGenerale()->getApercuImageLien();
}
}
$galleries_images = [];
$bloc_post = $this->renderBloc->RenderBloc($post,$schemaOrg);
$module = $post->getTypePost()->getSystemName();
$galleries = $this->getDoctrine()->getRepository(MediaCms::class)->findFileByModule($module,$post->getId(),'media');
// Debut Ajout image produit dans la gallerie si type gallerie est 5
if($modele_galerie_choisie == 5){
$image_post = $post->getImage();
$chemin_image = dirname($image_post);
$cdn_path = '';
$extension_file = pathinfo($image_post, PATHINFO_EXTENSION);
$new_galleries_images = ['id'=> "1",
'path'=> '',
'lienexterne' => "",
'titre'=> $post->translate($_locale)->getTitle(),
'description'=> "",
'extension_file' => $extension_file
];
if($extension_file != 'mp4'){
// On récupère le nom de fichier sans son extension
$nom_sans_extension = pathinfo($image_post, PATHINFO_FILENAME);
// On modifie l'extension du fichier
$nouvelle_extension = 'webp';
$nouveau_nom_fichier = $nom_sans_extension . '.' . $nouvelle_extension;
if (strpos($_SERVER['HTTP_USER_AGENT'], 'Safari') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome') === false) {
$new_galleries_images['path'] = str_replace("files/",$cdn_path."thumbs/files800/",$image_post);
}else{
$new_galleries_images['path'] = str_replace("files/",$cdn_path."thumbs/files800/",$chemin_image."/".$nouveau_nom_fichier);
}
}else{
$new_galleries_images['path'] = str_replace("files/",$cdn_path."thumbs/files800/",$image_post);
}
$galleries_images[] = $new_galleries_images;
}
// Fin Ajout image produit dans la gallerie si type gallerie est 5
$galleries_images = $this->affichageGallerieService->GallerieImages($galleries,$galleries_images);
$docs = $this->getDoctrine()->getRepository(MediaCms::class)->findFileByModule($module,$post->getId(),'doc');
$meta_robots = $post->getMetaRobots();
$custom_schemaOrg = null;
if ($post->translate($_locale)->getSchema() != '') {
$custom_schemaOrg = $post->translate($_locale)->getSchema();
}
$title_home_ariane = $home->getBreadcrumb() ? $home->getBreadcrumb() : "Accueil";
$breadcrumb_item = 1;
$breadcrumb = [];
$schema_breadcrumb_items = [];
$title_post_ariane = $post->translate($_locale)->getBreadcrumb() ? $post->translate($_locale)->getBreadcrumb() : $post->translate($_locale)->getTitle();
$title_post_ariane = strip_tags($title_post_ariane);
$breadcrumb [] = ['url'=> $this->generateUrl('index_home', [], UrlGeneratorInterface::ABSOLUTE_URL),"name"=> $title_home_ariane,'active'=> true];
$schema_breadcrumb_items[] = Schema::ListItem()->position($breadcrumb_item)->item(
["@id"=> $this->generateUrl('index_home', [], UrlGeneratorInterface::ABSOLUTE_URL),"name"=> $title_home_ariane]);
if ($categorie1 != null && $categorie2 == null && $categorie3 == null) {
$breadcrumb [] = ['url'=> $this->generateUrl('page', ['slug'=> $categorie1->translate($_locale)->getSlugUrl()], UrlGeneratorInterface::ABSOLUTE_URL),
'name'=> $categorie1->translate($_locale)->getTitreCategorie(),'active'=> true];
$breadcrumb_item = $breadcrumb_item +1;
$schema_breadcrumb_items[] = Schema::ListItem()->position($breadcrumb_item)->item(["@id"=> $this->generateUrl('page',
['slug'=> $categorie1->translate($_locale)->getSlugUrl()], UrlGeneratorInterface::ABSOLUTE_URL),
"name"=> $categorie1->translate($_locale)->getTitreCategorie()]);
$breadcrumb_item = $breadcrumb_item +1;
$url = $this->generateUrl('page_sous_categorie', ['categorie1'=> $categorie1->translate($_locale)->getSlugUrl(),
'categorie2'=> $post->translate($_locale)->getSlug()], UrlGeneratorInterface::ABSOLUTE_URL);
$schema_breadcrumb_items[] = Schema::ListItem()->position($breadcrumb_item)->item(["@id"=> $url,"name"=> $title_post_ariane]);
$breadcrumb [] = ['url'=> $url,"name"=> $title_post_ariane,'active'=> false];
}elseif($categorie1 != null && $categorie2 != null && $categorie3 == null){
// categorie 1
$breadcrumb [] = ['url'=> $this->generateUrl('page', ['slug'=> $categorie1->translate($_locale)->getSlugUrl()], UrlGeneratorInterface::ABSOLUTE_URL),
'name'=> $categorie1->translate($_locale)->getTitreCategorie(),'active'=> true];
$breadcrumb_item = $breadcrumb_item +1;
$schema_breadcrumb_items[] = Schema::ListItem()->position($breadcrumb_item)->item(["@id"=> $this->generateUrl('page',
["slug"=> $categorie1->translate($_locale)->getSlugUrl()], UrlGeneratorInterface::ABSOLUTE_URL),
"name"=> $categorie1->translate($_locale)->getTitreCategorie()]);
// categorie 2
$breadcrumb [] = ['url'=> $this->generateUrl('page_sous_categorie', ['categorie1'=> $categorie1->translate($_locale)->getSlugUrl(),
'categorie2'=> $categorie2->translate($_locale)->getSlugUrl()], UrlGeneratorInterface::ABSOLUTE_URL),
'name'=> $categorie2->translate($_locale)->getTitreCategorie(),'active'=> true];
$breadcrumb_item = $breadcrumb_item +1;
$schema_breadcrumb_items[] = Schema::ListItem()->position($breadcrumb_item)->item(["@id"=> $this->generateUrl('page_sous_categorie',
['categorie1'=> $categorie1->translate($_locale)->getSlugUrl(),'categorie2'=> $categorie2->translate($_locale)->getSlugUrl()], UrlGeneratorInterface::ABSOLUTE_URL),
"name"=> $categorie2->translate($_locale)->getTitreCategorie()]);
$breadcrumb_item = $breadcrumb_item + 1;
$url = $this->generateUrl('page_sous_sous_categorie', ['categorie1'=> $categorie1->translate($_locale)->getSlugUrl(),
'categorie2'=> $categorie2->translate($_locale)->getSlugUrl(),
'categorie3'=> $post->translate($_locale)->getSlug()], UrlGeneratorInterface::ABSOLUTE_URL);
$schema_breadcrumb_items[] = Schema::ListItem()->position($breadcrumb_item)->item(["@id"=> $url,"name"=> $title_post_ariane]);
$breadcrumb [] = ['url'=> $url,"name"=> $title_post_ariane,'active'=> false];
}elseif($categorie1 != null && $categorie2 != null && $categorie3 != null){
// categorie 1
$breadcrumb [] = ['url'=> $this->generateUrl('page', ['slug'=> $categorie1->translate($_locale)->getSlugUrl()], UrlGeneratorInterface::ABSOLUTE_URL),
'name'=> $categorie1->translate($_locale)->getTitreCategorie(),'active'=> true];
$breadcrumb_item = $breadcrumb_item + 1;
$schema_breadcrumb_items[] = Schema::ListItem()->position($breadcrumb_item)->item(["@id"=> $this->generateUrl('page',
["slug"=> $categorie1->translate($_locale)->getSlugUrl()], UrlGeneratorInterface::ABSOLUTE_URL),
"name"=> $categorie1->translate($_locale)->getTitreCategorie()]);
// categorie 2
$breadcrumb [] = ['url'=> $this->generateUrl('page_sous_categorie', ['categorie1'=> $categorie1->translate($_locale)->getSlugUrl(),
'categorie2'=> $categorie2->translate($_locale)->getSlugUrl()], UrlGeneratorInterface::ABSOLUTE_URL),
'name'=> $categorie2->translate($_locale)->getTitreCategorie(),'active'=> true];
$breadcrumb_item = $breadcrumb_item + 1;
$schema_breadcrumb_items[] = Schema::ListItem()->position($breadcrumb_item)->item(["@id"=> $this->generateUrl('page_sous_categorie',
['categorie1'=> $categorie1->translate($_locale)->getSlugUrl(),'categorie2'=> $categorie2->translate($_locale)->getSlugUrl()], UrlGeneratorInterface::ABSOLUTE_URL),
"name"=> $categorie2->translate($_locale)->getTitreCategorie()]);
// categorie 3
$breadcrumb [] = ['url'=> $this->generateUrl('page_sous_sous_categorie', [
'categorie1'=> $categorie1->translate($_locale)->getSlugUrl(),'categorie2'=> $categorie2->translate($_locale)->getSlugUrl(),
'categorie3'=> $categorie3->translate($_locale)->getSlugUrl()], UrlGeneratorInterface::ABSOLUTE_URL),
'name'=> $categorie3->translate($_locale)->getTitreCategorie(),'active'=> true];
$breadcrumb_item = $breadcrumb_item + 1;
$schema_breadcrumb_items[] = Schema::ListItem()->position($breadcrumb_item)->item(["@id"=> $this->generateUrl('page_sous_sous_categorie',
['categorie1'=> $categorie1->translate($_locale)->getSlugUrl(),'categorie2'=> $categorie2->translate($_locale)->getSlugUrl(),
'categorie3'=> $categorie2->translate($_locale)->getSlugUrl()], UrlGeneratorInterface::ABSOLUTE_URL),
"name"=> $categorie3->translate($_locale)->getTitreCategorie()]);
$breadcrumb_item = $breadcrumb_item + 1;
$url = $this->generateUrl('page_produit', ['categorie1'=> $categorie1->translate($_locale)->getSlugUrl(),
'categorie2'=> $categorie2->translate($_locale)->getSlugUrl(),
'categorie3'=> $categorie3->translate($_locale)->getSlugUrl(),
'slug_produit'=> $post->translate($_locale)->getSlug()], UrlGeneratorInterface::ABSOLUTE_URL);
$schema_breadcrumb_items[] = Schema::ListItem()->position($breadcrumb_item)->item(["@id"=> $url,"name"=> $title_post_ariane]);
$breadcrumb [] = ['url'=> $url,"name"=> $title_post_ariane,'active'=> false];
}
$schemaOrg->add(Schema::Article()->headline($title_post_ariane)
->datePublished($post->getDatePublication()?$post->getDatePublication():$post->getCreatedAt())
->dateModified($post->getUpdatedAt())
->image($post->getImage()!= null?$baseurl.$post->getImage():'')
->publisher(Schema::Organization()
->name($this->functionService->parametreGenerale()?$this->functionService->parametreGenerale()->translate($_locale)->getTitre():'')
->logo($this->functionService->parametreGenerale()?$baseurl.'/public/uploads/images/'.$this->functionService->parametreGenerale()->getImage():''))
->mainEntityOfPage(Schema::WebPage()->url($url))
);
$url_social = [];
$social = $this->getDoctrine()->getRepository(ReseauSociaux::class)->findAll();
if($social){
foreach ($social as $value) {
$url_social[] = $value->getUrl();
}
}
// id categorie related with post
$categoiesPosts = $this->getDoctrine()->getRepository(PostCategory::class)->findCategorieByPost($post->getId());
$next_article = $this->getDoctrine()->getRepository(Post::class)->findPostPrevOrNext($categoiesPosts,$post->getId());
$prev_article = $this->getDoctrine()->getRepository(Post::class)->findPostPrevOrNext($categoiesPosts,$post->getId(),'prev');
$template_model_galerie = $modele_gallerie[0]->getTwig();
$categories_tree = [];
$categories_principal = $this->getDoctrine()->getRepository(Category::class)->findBy(['actif'=> true,'parent'=> 0,'sousParent'=> 0,'TypePost'=> $post->getTypePost()],['position'=> 'ASC']);
if ($categories_principal) {
foreach ($categories_principal as $value) {
$data_slug_sous_categorie = [];
$tree_sous_categorie = $this->getDoctrine()->getRepository(Category::class)->findBy(['actif'=> true,'parent'=> $value->getId()],['position'=>'ASC']);
if($tree_sous_categorie){
foreach ($tree_sous_categorie as $sous_categorie_items) {
$data_slug_sous_sous_categorie = [];
$tree_sous_sous_categorie = $this->getDoctrine()->getRepository(Category::class)->findBy(['actif'=> true,'parent'=> 0,'sousParent'=> $sous_categorie_items->getId()],['position'=>'ASC']);
if ($tree_sous_sous_categorie) {
foreach ($tree_sous_sous_categorie as $sous_sous_categorie_items) {
$data_slug_sous_sous_categorie[] = [
'id'=> $sous_sous_categorie_items->getId(),
'titre'=> $sous_sous_categorie_items->translate($_locale)->getTitreCategorie(),
'slug'=> $sous_sous_categorie_items->translate($_locale)->getSlugUrl()];
}
}
$data_slug_sous_categorie[] = ['id'=> $sous_categorie_items->getId(),
'titre'=> $sous_categorie_items->translate($_locale)->getTitreCategorie(),
'slug'=> $sous_categorie_items->translate($_locale)->getSlugUrl(),
'sous_sous_categories'=> $data_slug_sous_sous_categorie,
];
}
}
$categories_tree[] = ['id'=> $value->getId(),
'titre'=> $value->translate($_locale)->getTitreCategorie(),
'slug'=> $value->translate($_locale)->getSlugUrl(),
'sous_categories'=> $data_slug_sous_categorie,
];
}
}
$parametre = $this->functionService->parametreGenerale();
$produit_related = null;
$resultats_first_images_produits = [];
// Find product related with default categorie
// if($post->getDefaultCategorie()){
// $canonical = $this->functionService->canonicalUrlProduit($post);
// $produit_related = $this->getDoctrine()->getRepository(Post::class)->findProductRelated($post->getTypePost(),$post->getId(),$post->getDefaultCategorie());
// if($produit_related){
// foreach ($produit_related as $value) {
// $galleries_first_image = $this->affichageGallerieService->FirstGallerieImagePost($value);
// $resultats_first_images_produits[] = [
// 'id'=> $value->getId(),
// 'galleries_first_image'=> $galleries_first_image
// ];
// }
// }
// }else{
// $canonical = $this->functionService->canonicalUrl($post->translate($_locale)->getCanonical());
// }
// Find product related
if ($post->getPostsAssocies()) {
$canonical = $this->functionService->canonicalUrlProduit($post);
foreach (explode(',',$post->getPostsAssocies()) as $id) {
$produit = $this->getDoctrine()->getRepository(Post::class)->find($id);
if ($produit) {
$produit_related[] = $produit;
$galleries_first_image = $this->affichageGallerieService->FirstGallerieImagePost($produit);
$resultats_first_images_produits[] = [
'id'=> $produit->getId(),
'galleries_first_image'=> $galleries_first_image
];
}
}
}else{
$canonical = $this->functionService->canonicalUrl($post->translate($_locale)->getCanonical());
}
$champsPersonnalisesPost = [];
$champsPersonnalisesPost = $this->functionService->getChampsPersonnalisesPost($post);
return $template = $this->render('front/'.$this->theme.'/produits/page_produit.html.twig',[
'post'=> $post,
'produit_related'=> $produit_related,
'canonical'=> $canonical,
'parametre'=> $parametre,
'title_home_ariane' => $title_home_ariane,
'galleries'=> $galleries_images,
'categories_tree'=> $categories_tree,
'categorie'=> $categorie1,
'sous_categorie'=> $categorie2,
'sous_sous_categorie'=> $categorie3,
'show_filter_categorie'=> $show_filter_categorie,
'docs'=> $docs,
'blocs'=> $bloc_post,
'meta_robots'=> $meta_robots,
'schemaOrg'=> $schemaOrg,
'custom_schemaOrg'=> $custom_schemaOrg,
'next_article'=> $next_article,
'prev_article'=> $prev_article,
'modele_galerie' => $modele_gallerie,
'template_model_gallerie' => $template_model_galerie,
'breadcrumb'=> $breadcrumb,
'resultats_first_images_produits'=> $resultats_first_images_produits,
'champsPersonnalisesPost' => $champsPersonnalisesPost,
'param_post' => $parametrePost
]);
}
function MetaModulePostOrCategory($request,$slug,$type){
$baseurl = $request->getScheme() . '://' . $request->getHttpHost() . $request->getBasePath();
$metaService = $this->metaService->meta($slug,$type);
$title_seo = isset($metaService['title'])?$metaService['title']:null;
$description_seo = isset($metaService['description'])?$metaService['description']:null;
$metacle = isset($metaService['metacle'])?$metaService['metacle']:null;
if($title_seo != '' || $description_seo != ''){
$this->basicSeo->setTitle(strip_tags($title_seo))
->setDescription($description_seo)
->setkeywords($metacle);
$this->seo->setTitle(strip_tags($title_seo))
->setDescription($description_seo);
//->setUrl($url);
if ($this->functionService->parametreGenerale()) {
if ($this->functionService->parametreGenerale()->getApercuImageLien()) {
$this->seo->setImage($baseurl.'/public/uploads/images/'.$this->functionService->parametreGenerale()->getApercuImageLien());
}
}
}
}
}