Intro Text in Categories View Default Layout/Template

  • LAC Webadmin
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
7 years 11 months ago #112661 by LAC Webadmin
Hi Tuan,

In this file components/com_eventbooking/view/categories/tmpl/default.php, there is a variable:
Code:
$description = $this->category ? $this->category->description : $this->introText;

I created a menu item for Categories - Default Layout, there is an option tab for Intro Text but that value is under $params. I wonder where is the value for $this->introText can be entered, I can't find it under Configuration.

Thanks,

Jackson

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

More
7 years 11 months ago - 7 years 11 months ago #112662 by James Riley
I think it is [ EB -> Emails & Messages -> Form Messages -> Intro text ], which is described as "If you enter this message, it will be displayed at the top of upcoming events, calendar and categories pages."

edit: [strike]I think it is a global message and cannot be set individually for each event / calendar / category. Searching through the code, I didn't see any where where this "intro_text" field (which, by the way, is stored in the #__eb_messages table) can be overridden. @Tuan will be able to correct me if I'm wrong.[/strike]

James Riley .: EventBooking user since 2014 ::: JoomDonation user since 2016 :.
.: grfx & web design / IT / AV @ St. Therese Institute of Faith and Mission, Bruno, SK, Canada :.
Last edit: 7 years 11 months ago by James Riley.

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

More
7 years 11 months ago - 7 years 11 months ago #112663 by James Riley
This sets the global default for all the pages. As you posted in your original post, $this->category->description will override $this->introText if the 'description' contains text, otherwise the global 'Intro Text' will show.

James Riley .: EventBooking user since 2014 ::: JoomDonation user since 2016 :.
.: grfx & web design / IT / AV @ St. Therese Institute of Faith and Mission, Bruno, SK, Canada :.
Last edit: 7 years 11 months ago by James Riley.

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

  • LAC Webadmin
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
7 years 11 months ago #112664 by LAC Webadmin
Thanks James, found it!

Yes, I can see the check for description text in the code. Unfortunately, the Intro Text when creating a category menu item is going nowhere. There's no code added to use that value $this->params->get('intro_text). Do you know where it appears?

Thanks,

Jackson

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

More
7 years 11 months ago - 7 years 11 months ago #112665 by James Riley
I think it is In view/categories/html.php:
Code:
(stating at line 67) $message = EventbookingHelper::getMessages(); if ($fieldSuffix && EventbookingHelper::isValidMessage($message->{'intro_text' . $fieldSuffix})) { $introText = $message->{'intro_text' . $fieldSuffix}; } elseif (EventbookingHelper::isValidMessage($message->intro_text)) { $introText = $message->intro_text; } else { $introText = ''; }

James Riley .: EventBooking user since 2014 ::: JoomDonation user since 2016 :.
.: grfx & web design / IT / AV @ St. Therese Institute of Faith and Mission, Bruno, SK, Canada :.
Last edit: 7 years 11 months ago by James Riley.

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

More
7 years 11 months ago - 7 years 11 months ago #112666 by James Riley
... and in the getMessages() helper, it pulls data from the #__eb_messages table (which is where the 'intro_text' field saves to).

James Riley .: EventBooking user since 2014 ::: JoomDonation user since 2016 :.
.: grfx & web design / IT / AV @ St. Therese Institute of Faith and Mission, Bruno, SK, Canada :.
Last edit: 7 years 11 months ago by James Riley.

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

  • LAC Webadmin
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
7 years 11 months ago #112667 by LAC Webadmin
Nah, that's the same intro_text from what you pointed out previously. :D Tuan used the same variable/field name in both parameters and both are defined in different areas. One is in email/messages and the other is in the menu.

Anyways, I'll just take advantage of it in my override.

Thanks,

Jackson

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

More
7 years 11 months ago #112668 by James Riley
Hmmm... I would have been sure that html.php was where it all happened because, a few lines further down (line 84)
Code:
$this->introText = $introText;
.

I wonder what is preventing this from passing to the tmpl/default.php page?

This is one of the great and might @Tuan to figure out :)

James Riley .: EventBooking user since 2014 ::: JoomDonation user since 2016 :.
.: grfx & web design / IT / AV @ St. Therese Institute of Faith and Mission, Bruno, SK, Canada :.

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

  • Tuan Pham Ngoc
  • Away
  • Administrator
  • Administrator
More
7 years 11 months ago #112677 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Intro Text in Categories View Default Layout/Template
It's in line 160 of the file components/com_eventbooking/view/categories/html.php, the code is:
Code:
if (EventbookingHelper::isValidMessage($this->params->get('intro_text'))) { $this->introText = $this->params->get('intro_text'); }

Regards,

Tuan

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

  • LAC Webadmin
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
7 years 10 months ago - 7 years 10 months ago #112722 by LAC Webadmin
Hi Tuan,

I missed that line :D


Thanks,

Jackson
Last edit: 7 years 10 months ago by LAC Webadmin.

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

Moderators: Tuan Pham Ngoc