Need advice for adding Event Creator to the Table Layout

  • Mick Graham
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
7 years 1 week ago #115058 by Mick Graham
I would like the Event Creator to be in the Table Layout list.

Any pointers to which file to edit would be handy.

thanks
Mick

Please Log in or Create an account to join the conversation.

More
7 years 1 week ago #115059 by Tuan Pham Ngoc
Hi Mick

The file you need to edit is components/com_eventbooking/view/common/tmpl/events_table.php

Inside the for loop, you can use this command to get creator

$creator = JFactory::getUser($item->created_by);

echo $creator->name;

echo $creator->username;

// Something like that should help

Tuan

Please Log in or Create an account to join the conversation.

  • Mick Graham
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
7 years 1 week ago #115062 by Mick Graham
Should the override file go here?

templates/mytemplate/html/com_eventbooking/common/tmpl/events_table.php

Please Log in or Create an account to join the conversation.

More
7 years 1 week ago #115063 by Tuan Pham Ngoc
templates/mytemplate/html/com_eventbooking/common/events_table.php

(No need for tmpl in override path)

Tuan

Please Log in or Create an account to join the conversation.

  • Mick Graham
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
7 years 1 week ago #115080 by Mick Graham
Just incase anyone else wants to do this, I botched it with my very poor knowledge of php, but it works lol!

up around line 50 you need to put the header column for the event creator text.
?>
<th class="location_col">
<?php echo JText::_('EB_CREATED_BY'); ?>
</th>
<?php

then around line 290, to fit it in after Location I added this.
$creator = JFactory::getUser($item->created_by);
{
?>
<td class="center tdno<?php echo $i; ?>" data-content="<?php echo JText::_('EB_REGISTERED'); ?>">
<?php

{
echo $creator->name;
}

?>
</td>
<?php
}

You have to decide where you are going to put the column so I put it after location both times for the header TH and the content TD

I'll need to do some online lessons, but thanks Tuan for pointing me in the right direction LOL

Please Log in or Create an account to join the conversation.

More
7 years 1 week ago #115084 by Tuan Pham Ngoc
Hi Mick

Maybe you can upload the modified file here (zip it before uploading) so that in case someone needs it, they can use it

Regards,

Tuan

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc