Calling custom forum field

Post

Posted
Rating:
#2863 (In Topic #559)
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

Last edit: by Paul Flavel

Post

Posted
Rating:
#2864
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}.

Post

Posted
Rating:
#2865
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.

Post

Posted
Rating:
#2866
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}

Post

Posted
Rating:
#2867
Sorry, missed that in the first post   :$

Nice find! Gotta love the flexibility of Composr Tempcode :)

Post

Posted
Rating:
Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 (Liked by Jason Verhagen)
#2868
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.
4 guests and 0 members have recently viewed this.