News:

Support for jDownloads 3 has been ended
Since 17 August 2023 Joomla.org has discontinued support for Joomla 3.x. Therefore, we will no longer offer official support for our Joomla 3 jDownloads version 3.9.x from January 2024.
Please update your website to the latest Joomla version (Joomla 4 or Joomla 5) as soon as possible. Afterwards, please update jDownloads to the latest published version. The longer you delay, the more difficult the upgrade process for your website is likely to be.

Main Menu
Support-Forum

Fields not showing in front-end when defined in layout [not a bug]

Started by mvisser, 16.05.2022 22:02:52

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

mvisser

Hello,

First of all, thank you for all the work done to build this component and update/support it!

I've defined Fields to be used with my downloads and cannot manage to show these Fields in a downloads layout (e.g. 'Standard Files Layout without Checkboxes 3.9').
In case I use the correct placeholder variables as mentioned in the documentation, i.e. {jdfield 'id'} and {jdfield_value 'id'}, no data is shown on the front-end.

However, all field data is shown before (or after) the download view in the layout in case I select for the Field to appear before or after the view under 'Options' in the Field settings. I.e. the Fields are configured and the related downloads do have their field data filled in.

Hopefully, you can help me out here in getting the Fields visible in the front-end Downloads layout.

Kind regards,

Mart
  •  

ColinM

Mart
Sorry for the delay in resonse :( - have various challenges ongoing.  It took me some time to identify the 'challenge'
You need an underscore character, that is  an _ character in between jd and field

jd_field_title and jd_field  NOT jdfield.

Colin
Colin M
  •  

mvisser

Hello,

No problem, I'm glad there is a support forum like this available!

I've tried your suggestion, but the placeholder variables {jd_field_title} and {jd_field} do not seem to work as placeholder variables, refer to the attached screenshot.
The documentation (https://www.jdownloads.net/documentation-for-v3-9/layouts-v3-9/layouts-place-holders#fields) by the way also indicates the placeholder variable names 'jdfield_title' and 'jdfield'.

Anything else I can try or maybe provide additional information on to help troubleshoot this issue?

Regards, Mart

edit: I've managed to find where these placeholder variables are checked and replaced with the corresponding data (for the category view I'm using), i.e. 'com_jdownloads\site\views\category\tmpl\default.php'.
I found that the the 'jcfields' property of the '$files[$i]' object is not set. As a result, the placeholder variable is replaced by an empty string ''.
Any idea why my download is missing this property? (I've also checked this on the 'download' view, and it shows the same behavior)
  •  

ColinM

Mart,
Apologigies I got my _ mixed up!
The format is {jdfield_title id} and {jdfield id}
Thought you had an underscore in front of the id as in {jdfield_title_id} and {jdfield_id}

It is interesting that you say you have $items[$i]->jcfields not set - most unusual
items is a very large array of info

Will look further

Colin
Colin M
  •  

mvisser

  •  

ColinM

Mart
Are you saying that you editted 'com_jdownloads\site\views\category\tmpl\default.php' ?

{jd_field_title} and {jd_field} do work so I think I still do not understand  - sorry for delay have been working on jD4

Colin
Colin M
  •  

mvisser

Hi Colin,

Correct, I've temporarily edited the mentioned page (com_jdownloads\site\views\category\tmpl\default.php) to check the content/properties of the '$files[$i]' object.
And there when printing/dumping the object I noticed that the required 'jcfields' property is not present.

If there is anything I can test and/or provide additional information, please let me know.

Regards, Mart
  •