- Posts: 10
- Thank you received: 0
Support for SermonSpeaker 5.x is in bugfix mode only, the same as it is for Joomla 3.10.
I will not add any new features to this releases.
Please upgrade to SermonSpeaker 6.x and Joomla 4.x, which is better anyway.
I will not add any new features to this releases.
Please upgrade to SermonSpeaker 6.x and Joomla 4.x, which is better anyway.
Custom Fields in Categories
09 Dec 2020 20:45 #7760
by Brent C
Custom Fields in Categories was created by Brent C
I'm working on updating a site that has used SermonSpeaker for years, so there are quite a few series built up. As part of the redesign I'd like to include an element on the Series List page that indicates the year the series was created. I know custom fields are available but they seem to only apply to sermons. Is there any way to get custom fields for categories, or is there another spot in the existing setup where I could put this and be able to access it from a custom layout?
Please Log in or Create an account to join the conversation.
- Thomas Hunziker
- Offline
- Administrator
09 Dec 2020 21:05 #7761
by Thomas Hunziker
Replied by Thomas Hunziker on topic Custom Fields in Categories
Custom Fields are available for Sermons, Series and Speakers. In the fields manager, there is a dropdown where you can change the context.
I don't remember why I didn't include the categories context. Probably something didn't work as expected or I just missed it.
I don't remember why I didn't include the categories context. Probably something didn't work as expected or I just missed it.
Please Log in or Create an account to join the conversation.
10 Dec 2020 17:02 - 10 Dec 2020 17:02 #7762
by Brent C
Replied by Brent C on topic Custom Fields in Categories
Found it! I was looking in the edit view for the custom field, not on the manager page. And yes, I said categories when I meant series.
Next question - how can I access the value of that field in a custom layout? I tried
based on the info I found here: www.sermonspeaker.net/forum/sermonspeake...-sermon-speaker.html , but it returns an "Object of class stdClass could not be converted to string" error. Rereading that thread, it looks like you guys might have been talking about actual Joomla custom fields, not SermonSpeaker?
Next question - how can I access the value of that field in a custom layout? I tried
Code:
<?php echo $item->jcfields[3]; ?>
based on the info I found here: www.sermonspeaker.net/forum/sermonspeake...-sermon-speaker.html , but it returns an "Object of class stdClass could not be converted to string" error. Rereading that thread, it looks like you guys might have been talking about actual Joomla custom fields, not SermonSpeaker?
Last edit: 10 Dec 2020 17:02 by Brent C.
Please Log in or Create an account to join the conversation.
- Thomas Hunziker
- Offline
- Administrator
10 Dec 2020 17:18 #7763
by Thomas Hunziker
Replied by Thomas Hunziker on topic Custom Fields in Categories
SermonSpeaker uses the Joomla custom fields. Those are the same
$item->jcfields is a collection (array) of fields. With the square brackets you can access a specific field in that array. $item->jcfields[3] would give you the third field in that collection.
Now the field itself is sort of a collection as well, but this time it's not an array but a class with properties. $item->jcfields[3]->title would give you the name of the third field, $item->jcfields[3]->value the actual value.
$item->jcfields is a collection (array) of fields. With the square brackets you can access a specific field in that array. $item->jcfields[3] would give you the third field in that collection.
Now the field itself is sort of a collection as well, but this time it's not an array but a class with properties. $item->jcfields[3]->title would give you the name of the third field, $item->jcfields[3]->value the actual value.
Please Log in or Create an account to join the conversation.
10 Dec 2020 17:30 #7764
by Brent C
Replied by Brent C on topic Custom Fields in Categories
Thanks - you did cover that in the other thread, I just missed it. The ->value is what I was missing.
I appreciate the help!
I appreciate the help!
Please Log in or Create an account to join the conversation.
Time to create page: 0.111 seconds