Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC:

JEM Wide - How to get Venuedata separately ? 7 years 6 months ago #19344

Hi.

Gibt es einen Weg sich die Daten des Veranstaltungsortes separat ausgeben zu lassen ? In etwa wie $item->title, aber eben mit der Straße oder der Postleitzahl.

Is there a way to get the Venuedata separately, like $item->street ? I try to create a eventlist with address, but without any links.

(Beispiel/Example):
EventnameDateStreetZip / City
Event xyz01.01. 2016Teststreet 101234 / Testcity


JEM: 2.1.4
Joomla: 3.4.3

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

JEM Wide - How to get Venuedata separately ? 7 years 6 months ago #19345

  • Hoffi
  • Hoffi's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 2279
  • Thank you received: 449
Hi JohnDoe,

generally it is by changing modules/mod_jem/wide/tmpl/default.php for which template overrides could be used.
But unfortunately the data flieds provided by the model are mapped in modules/mod_jem/wide/helper.php so you have to enhance this file too (where overrides are not available so you need to do this again each time you update JEM).

In your specific case search in helper.php around line 142
$lists[$i]->city    = htmlspecialchars($row->city, ENT_COMPAT, 'UTF-8');
Triplicate and modify this line so you finally get these three:
$lists[$i]->city    = htmlspecialchars($row->city, ENT_COMPAT, 'UTF-8');
$lists[$i]->zip     = htmlspecialchars($row->postalCode, ENT_COMPAT, 'UTF-8');
$lists[$i]->street  = htmlspecialchars($row->street, ENT_COMPAT, 'UTF-8');
So you can use $item->city, $item->zip and $item->street within the tmpl/default.php.
btw:
Same technique could be used on Banner or Teaser module too.

For other available fields take a look at components/com_jem/models/eventslist.php by checking "$query->select(..." lines in function getListQuery() - or set a breakpoint in helper.php and look at $row ;) )
Pessimists are optimists with experience!
The following user(s) said Thank You: JohnDoe

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

JEM Wide - How to get Venuedata separately ? 7 years 6 months ago #19346

Excellent. That works perfect. Thank you very much !
But, you're right...I have to do this every time, when I update JEM. It would be nice, when all variables are automatically available in this form.


[EDIT]:
In the helper.php is a line
$lists[$i]->eventdescription   = strip_tags($row->fulltext);
I fill some text in the descriptionfield of the event and try to display it with $item->eventdescription, but it doesn't work. Is this a bug or my mistake ?

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

Last edit: by JohnDoe.

JEM Wide - How to get Venuedata separately ? 7 years 6 months ago #19356

I think that $item->eventdescription should be correct, but it doesn't work. Any other ideas how to get the event-descriptiontext ?

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

JEM Wide - How to get Venuedata separately ? 7 years 6 months ago #19357

  • Hoffi
  • Hoffi's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 2279
  • Thank you received: 449
Hi JohnDoe,

sorry for late answer but I don't get an email if a post is edited. I only got one triggered by your last, new post.

You're right, "descriptiontext" is theoretical corrrect but the line in helper.php is ... preihstoric. :whistle:
Long time ago Joomla guys changed the introtext - fulltext handling so fulltext now will only contain the text behind the "read more" tag. If you don't have such a tag in your event description the complete description is stored in introtext.

So you can change "fulltext" to "inrotext" (in the line you quoted) to only get text before "read more" or use a line iike the following to always show the full description.
$lists[$i]->eventdescription   = strip_tags($row->introtext . ' ' . $row->fulltext);
Pessimists are optimists with experience!
The following user(s) said Thank You: JohnDoe

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

JEM Wide - How to get Venuedata separately ? 7 years 6 months ago #19358

Hi Hoffi.

Ich antworte mal in Deutsch, weil Du ja auch aus Deutschland bist und es mir einfacher fällt. :)

Danke Dir. Dein Tip hat super funktioniert., aber darauf muss man erstmal kommen. ;)
Wird das in der nächsten Version geändert oder muss ich das nach einem Update dann auch jedesmal ändern ?

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

  • Page:
  • 1
  • 2
Time to create page: 0.491 seconds

Donate

If you find JEM useful and if you use it on your site, please consider a donation to the project.

Private Messages

You are not logged in.

Follow us......