Calendar Object from Page
Permalink Browser Info Environment
Could this be customized to include an Event Attribute from the page that the form is located on?
Type: | Ticket |
---|---|
Status: | Resolved |
Thanks for the fast reply!
I downloaded the package you sent me, and began to modify it.
When I went to install it, I get this error "Unable to install Hidden Attributes Calendar. Please check that this package has been updated for 5.7."
I downloaded the package you sent me, and began to modify it.
When I went to install it, I get this error "Unable to install Hidden Attributes Calendar. Please check that this package has been updated for 5.7."
What version of concrete5 are you using? The minimum version required is 8.2.1
And you also must install the main Hidden Attribute Package first
And you also must install the main Hidden Attribute Package first
8.5.2
I have attached the revised package in case you want to take a look.
I have attached the revised package in case you want to take a look.
You had a few issues with the code. I corrected it for you, it should work now.
I'm attaching the new version to this message
I'm attaching the new version to this message
Thank you for that. Installed perfectly.
Now to another issue that is not really related to your add-on but I can not find any documentation or forum posts about. If you wouldn't mind to point me in the right direction.
How do I access the info about the event? I know how to get custom attributes I have created for the event, but I can not figure out how to get the basic event info, e.g. Title, start time, description, topic.
Now to another issue that is not really related to your add-on but I can not find any documentation or forum posts about. If you wouldn't mind to point me in the right direction.
How do I access the info about the event? I know how to get custom attributes I have created for the event, but I can not figure out how to get the basic event info, e.g. Title, start time, description, topic.
I am not 100% sure but I think you'd do something like this. Once you have your event $event_att you can get the title and description like this:
While start and end times are relative to occurrences so you'd do it like this:
I'm afraid none of this is tested but there's a reasonable chance it'll work :)
$event = $event_att->getSelectedVersion(); $title = $event->getName(); $description = $event->getDescription(); $topics = $event->getCategories();
While start and end times are relative to occurrences so you'd do it like this:
$eventOccurrences = $event_att->getOccurrences(); if (is_array($eventOccurrences)) { foreach($eventOccurrences as $occurrence) { $startTime = $occurrence->getStart(); $endTime = $occurrence->getEnd(); // do something with it } }
I'm afraid none of this is tested but there's a reasonable chance it'll work :)
That's exactly what I was looking for. Thank you so much!
Glad I could help :)
If you find the package useful, it would really mean a lot if you could leave a review for it.
If you have time, you can do it here:https://marketplace.concretecms.com/marketplace/addons/hidden-data-a...
Thank you.
If you find the package useful, it would really mean a lot if you could leave a review for it.
If you have time, you can do it here:https://marketplace.concretecms.com/marketplace/addons/hidden-data-a...
Thank you.
By using the included current page data source as an example you can modify it to grab the attribute from the page instead of just the page.
Here's an example package to show you how to create your own custom data:https://github.com/mnakalay/kalmoya_test_dynamic_source...