Friday, 20 October 2017
  14 Replies
  7.6K Visits
0
Votes
Undo
Hello, I have used tag {{Event Id:EVID}} to get event ID in my custom layout and print it, and works good. But now I need to save the event ID in a php variable in order to use it in a script of my own.

Can you tell me what could be the code to get the event ID using php? Maybe somenthing like this:

<?php $eventid = getEvid(); ?>

Thanks in advance.
7 years ago
·
#194595
0
Votes
Undo
Where are you calling it from? In event details $row->ev_id() or: $row->id() depending on the event or repeat id you want.

Many thanks
Tony

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!Join the JEvents club today!

7 years ago
·
#194618
0
Votes
Undo
Thank you for your reply. I am calling it from event detail page, but it doesn´t work. Maybe something is wrong in my code. I am trying to print the id at first, in order to check the script. This is what I have in my custom layout:


<span>Joomla user ID: </span>
{source}
<?php
$user = JFactory::getUser();
$id = $user->id;
print_r($id);
?>
{/source}
<br/>
<span>Event ID: </span>
{source}
<?php
$eventID = $row->ev_id();
print_r($eventID);
?>


{source}{/source} are tags from the sourcerer plugin, used to insert php in joomla articles and modules. Joomla user ID is showing, but Event ID is not working. This is the error: "Call to a member function ev_id() on null". Same result with function id(). what could be wrong?

Thanks
7 years ago
·
#194712
0
Votes
Undo
Hello, any help with this, please? :)
7 years ago
·
#194728
0
Votes
Undo
Hello,

Are you calling $row after it has been defined?

Many thanks
Tony

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!Join the JEvents club today!

7 years ago
·
#194748
0
Votes
Undo
I thought $row was defined in the module's source code. Have I to define it? How?

The code above is the unique code I have in my event detail custom layout. I would be very pleasured if you could say me the entire php code with same behavior than {{Event Id:EVID}}

Many thanks :)
7 years ago
·
#194764
0
Votes
Undo
So are you doing this in the latest events module or the event detail?

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!Join the JEvents club today!

7 years ago
·
#194791
0
Votes
Undo
In event detail.
7 years ago
·
#194793
0
Votes
Undo
In that view should be:

$row=$this->data['row'];

Thus defining $row. Then you can use the calls else use: $this->data['row']->ev_id(); for instance.

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!Join the JEvents club today!

7 years ago
·
#194801
0
Votes
Undo
Unfortunately it is still not working. This is the new error:

"Using $this when not in object context"

And this is the code I´m using:


<?php
$row = $this->data['row'];
$eventID = $row->ev_id();
print_r($eventID);
?>


What am I doing wrong?

You can see attached a capture from the page where I am using the code.

Regards
7 years ago
·
#194805
0
Votes
Undo
Hello,

That wouldn't work there I suspect since you are using Sourcer you are not in the template view here you are being passed into a re-formatting view.

To use that code you need to use it in a template override view see:

https://www.jevents.net/docs/jevents/item/template-overrides-event-detail-page

Many thanks
Tony

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!Join the JEvents club today!

7 years ago
·
#194812
0
Votes
Undo
But I am not gold member, so I can see that document...

what is the file that contents the event details code? in which folder is located?

Thanks
7 years ago
·
#194873
0
Votes
Undo
what is the file that contents the event details code? in which folder is located?

Thanks


Could you, please?

Thanks.
7 years ago
·
#194891
0
Votes
Undo
It's just the standard Joomla! way to do a template override :-)

See the basic one here:
https://www.jevents.net/frequently-asked-questions/customising-layouts

Many thanks
Tony

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!Join the JEvents club today!

7 years ago
·
#194911
0
Votes
Undo
Thank you mate, maybe I haven´t explained myselft very well, probably for my english. In my last post I was asking for the path of the file which loads the event detail page, in order to create a template override with that file. But don´t worry because I have found it myself in this path:

/components/com_jevents/views/flat/icalevent/tmpl/detail.php

Thanks for your help, you have been very kind :)
  • 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.