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.
Joomla Fields - display in Sermon Speaker
- Thomas Hunziker
-
- Offline
- Administrator
-
Less
More
22 May 2017 20:52 #6680
by Thomas Hunziker
Replied by Thomas Hunziker on topic Joomla Fields - display in Sermon Speaker
The automatic display events use the JLayout located in components/com_fields/layouts/fields/render.php. You can override that in your template globally or even make an override for com_sermonspeaker.
But I think you're not getting lucky with that either. You need to get a bit more creative for table layouts.
In the table header section, you can add this code at the place you like:
And in the data section you put this:
That should show all custom fields for an item at the place where you add the code.
If you only want to show selected you would have to hardcode it in your layout. Eg $item->jcfields[4] would be the field with the ID 4.
But I think you're not getting lucky with that either. You need to get a bit more creative for table layouts.
In the table header section, you can add this code at the place you like:
Code:
<?php if ($this->items[0]->jcfields) : ?>
<?php foreach ($this->items[0]->jcfields as $field) : ?>
<th><?php echo JText::_($field->title); ?></th>
<?php endforeach; ?>
<?php endif; ?>
Code:
<?php if ($item->jcfields) : ?>
<?php foreach ($item->jcfields as $field) : ?>
<td><?php echo $field->value; ?></td>
<?php endforeach; ?>
<?php endif; ?>
That should show all custom fields for an item at the place where you add the code.
If you only want to show selected you would have to hardcode it in your layout. Eg $item->jcfields[4] would be the field with the ID 4.
Please Log in or Create an account to join the conversation.
- Alan Wright
-
Topic Author
- Offline
- New Member
-
Less
More
- Posts: 4
- Thank you received: 0
23 May 2017 14:55 - 23 May 2017 15:10 #6681
by Alan Wright
Replied by Alan Wright on topic Joomla Fields - display in Sermon Speaker
Thanks again. The code you listed worked well - I was on a similar track, but couldn't figure out the syntax of jcfields.
I tried making the column sortable like the others, but couldn't get it to work. Probably something to do with the fields being in a different table to the sermons? Not a big deal - just thought I'd try.
I tried making the column sortable like the others, but couldn't get it to work. Probably something to do with the fields being in a different table to the sermons? Not a big deal - just thought I'd try.
Code:
<th class="ss-col ss-service hidden-
<?php if (!$limit) :
echo JHtml::_('grid.sort', $field->title, $field->value, $listDirn, $listOrder);
else :
echo JText::_($field->title);
endif; ?>
</th>
Last edit: 23 May 2017 15:10 by Alan Wright.
Please Log in or Create an account to join the conversation.
- Thomas Hunziker
-
- Offline
- Administrator
-
23 May 2017 15:31 #6682
by Thomas Hunziker
Replied by Thomas Hunziker on topic Joomla Fields - display in Sermon Speaker
You can't sort by the fields due to the way the whole custom field feature works.
Please Log in or Create an account to join the conversation.
Time to create page: 0.138 seconds