Renderfields not working

Everything to do with Joomla! 3.x templates and templating.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Locked
huubs
Joomla! Intern
Joomla! Intern
Posts: 74
Joined: Tue Aug 11, 2015 1:20 pm

Renderfields not working

Post by huubs » Tue Jun 27, 2017 1:50 pm

Hello,

I have a Joomla installation with a plugin which adds custom fields to the attribs object. I'm using that in full effect in my templates, etc. So far working great.

Now I have to add these fields to the template edit form on the frontend. But the following code (which is working in another Joomla installation) doesn't work:

Code: Select all

<?php if ($this->item->id) : ?>
							<?php $attribss = json_decode($this->item->attribs); ?>
							<? //print_r($attribss); ?>
							<?php $this->form->setValue('ank_datum', 'attribs', $attribss->ank_datum); ?>
							<?php $this->form->setValue('ank_soort', 'attribs', $attribss->ank_soort); ?>
							<?php $this->form->setValue('ank_leesmeer', 'attribs', $attribss->ank_leesmeer); ?>
							<?php $this->form->setValue('ank_prijs', 'attribs', $attribss->ank_prijs); ?>
							<?php $this->form->setValue('ank_tijd', 'attribs', $attribss->ank_tijd); ?>
							<?php $this->form->setValue('ank_locatie', 'attribs', $attribss->ank_locatie); ?>
							<?php endif; ?>
							<?php echo $this->form->renderField('ank_datum', 'attribs'); ?>
							<?php echo $this->form->renderField('ank_soort', 'attribs'); ?>
							<?php echo $this->form->renderField('ank_leesmeer', 'attribs'); ?>
							<?php echo $this->form->renderField('ank_prijs', 'attribs'); ?>
							<?php echo $this->form->renderField('ank_tijd', 'attribs'); ?>
							<?php echo $this->form->renderField('ank_locatie', 'attribs'); ?>
Anyone has an idea why its not working?

User avatar
websitedons
I've been banned!
Posts: 389
Joined: Sat May 27, 2017 9:42 am

Re: Renderfields not working

Post by websitedons » Wed Jun 28, 2017 3:43 am

What is the template edit form? Where is that located? Are you referring to article attribs?

huubs
Joomla! Intern
Joomla! Intern
Posts: 74
Joined: Tue Aug 11, 2015 1:20 pm

Re: Renderfields not working

Post by huubs » Thu Jun 29, 2017 8:45 am

websitedons wrote:What is the template edit form? Where is that located? Are you referring to article attribs?
The article edit screen. It's located in the /templates/template/html/form/edit.php

And yes I'm referring to the article attribs. I have transformed my plugin to the fields funtionalitity which is now Joomla native.


Locked

Return to “Templates for Joomla! 3.x”