Calling custom forum field
I have created a custom forum field. However I am unable to find a way to call this field using +START,IF
Any assistance with this would be appreciated.
Similar to: https://composr.app/forum/topicview/browse/designing/custom-fields.htm but for forums
Any assistance with this would be appreciated.
Similar to: https://composr.app/forum/topicview/browse/designing/custom-fields.htm but for forums
Last edit: by Paul Flavel
I haven't used custom forum fields myself so I'm not sure what, if anything, is possible with tempcode. If you want to see if these custom forum fields are made available as tempcode parameters in a template, try adding this to the template you are working with:
{+START,IF,{$IS_ADMIN}}{+START,PARAM_INFO}{+END}{+END}
This will show a table of parameter names and their values. The above code will only display this table for admins (good if working on a live site), so be sure you are logged in as admin. If you working on a test site or need to test against non-admins, remove the first +START block and last +END block and just use {+START,PARAM_INFO}{+END}.
{+START,IF,{$IS_ADMIN}}{+START,PARAM_INFO}{+END}{+END}
This will show a table of parameter names and their values. The above code will only display this table for admins (good if working on a live site), so be sure you are logged in as admin. If you working on a test site or need to test against non-admins, remove the first +START block and last +END block and just use {+START,PARAM_INFO}{+END}.
Tried that. Unfortunately that seems quite limited. It doesn't show custom fields, which I thought was quite odd.
Even in: https://compo.sr/forum/topicview/browse/designing/custom-fields.htm it didn't show the custom fields.
Even in: https://compo.sr/forum/topicview/browse/designing/custom-fields.htm it didn't show the custom fields.
Found it. Bit of code digging.
Code
{+START,IF_NON_EMPTY,{$CATALOGUE_ENTRY_FOR,forum,{ID}}}{$CATALOGUE_ENTRY_ALL_FIELD_VALUES,{$CATALOGUE_ENTRY_FOR,forum,{ID}}}{+END}
Sorry, missed that in the first post
Nice find! Gotta love the flexibility of Composr Tempcode
Nice find! Gotta love the flexibility of Composr Tempcode
Once you start getting your head around it, it's amazing.
I am doing a template edit, using a custom field and conditions. This will allow custom icons for the forums, and when there is no custom icon it will fallback to the default forum icon.
Once I have this finished I will share in the design forum.
I am doing a template edit, using a custom field and conditions. This will allow custom icons for the forums, and when there is no custom icon it will fallback to the default forum icon.
Once I have this finished I will share in the design forum.
5 guests and 0 members have recently viewed this.
