Sunday, 20 November 2022
  3 Replies
  384 Visits
0
Votes
Undo
Hi,
Because of duplicate title in SEO, I would like to cutom <title></title> in a detail event page.
Which file to edit ?
Template Geraint

Best regards
Michel
1 year ago
·
#228729
Accepted Answer
0
Votes
Undo
Great ! Thanks.
I would like to insert in title the ID used in the url.

Here 4110

https://www.ruer-formation.fr/intra/4110/ms-project-2021-lyon-69.html

See capture
1 year ago
·
#228696
0
Votes
Undo
Create and override for defaultsetpagetitle.php

Copy the file components/com_jevents/views/default/helpers/defaultsetpagetitle.php to templates/YOURTEMPLATE/html/com_jevents/helpers/ and edit its content e.g. this would put the category name ahead of the event title


<?php

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

use Joomla\CMS\Factory;

function DefaultSetPageTitle($view, $ev_title)
{

// Get menu item id

$newparams = Factory::getApplication('site')->getParams();
// Because the application sets a default page title,
// we need to get it from the menu item itself
$menu = Factory::getApplication()->getMenu()->getActive();

if (isset($menu->query["layout"]) && $menu->query["layout"] == "detail")
{
$newparams->def('page_heading', $newparams->get('page_title', $menu->title));
}
else
{
$event = $view->data['row'];

Factory::getDocument()->SetTitle( $event->getCategoryName() . " : " . $ev_title);
}
}

JEvents Club members can get priority forum support at the Support Forum. As well as access to a variety of custom JEvents addons and benefits. Join the JEvents club today!

1 year ago
·
#228729
Accepted Answer
0
Votes
Undo
Great ! Thanks.
I would like to insert in title the ID used in the url.

Here 4110

https://www.ruer-formation.fr/intra/4110/ms-project-2021-lyon-69.html

See capture
1 year ago
·
#228773
0
Votes
Undo
Sorry for the slow reply I had serious server issue I had to resolve as a matter of urgency :(

you can get the event id from

$id = $event->id();

JEvents Club members can get priority forum support at the Support Forum. As well as access to a variety of custom JEvents addons and benefits. Join the JEvents club today!

  • Page :
  • 1
There are no replies made for this post yet.

Members Area

Show your support

Unlike many Joomla calendars we do not charge to download JEvents - please show your support for this project by becoming a member of the JEvents Club Club members get access to early releases, exclusive member support forums, and Silver and Gold members can use many exciting JEvents addons

Your membership will ensure that JEvents continues to be the best events calendar for Joomla.