Friday, 20 October 2017
  14 Replies
  8K 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.
Friday, 20 October 2017 21:45
·
#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
Saturday, 21 October 2017 01:04
·
#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
Tuesday, 24 October 2017 19:56
·
#194712
0
Votes
Undo
Hello, any help with this, please? :)
Wednesday, 25 October 2017 09:32
·
#194728
0
Votes
Undo
Hello,

Are you calling $row after it has been defined?

Many thanks
Tony
Wednesday, 25 October 2017 13:27
·
#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 :)
Wednesday, 25 October 2017 20:41
·
#194764
0
Votes
Undo
So are you doing this in the latest events module or the event detail?
Wednesday, 25 October 2017 22:01
·
#194791
0
Votes
Undo
In event detail.
Wednesday, 25 October 2017 22:32
·
#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.
Thursday, 26 October 2017 08:36
·
#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
Thursday, 26 October 2017 09:30
·
#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
Thursday, 26 October 2017 10:40
·
#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
Friday, 27 October 2017 17:50
·
#194873
0
Votes
Undo
what is the file that contents the event details code? in which folder is located?

Thanks


Could you, please?

Thanks.
Monday, 30 October 2017 08:00
·
#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
Monday, 30 October 2017 10:56
·
#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.