Display custom field in day view
Brought to you by:
jberanek
Hi,
I'm trying to add a custom field to my day view, I have found how to add the full description, but I can't get my head around how to add a custom field.
I did the following in functions_table_inc, I assume I have to call my database before I can add the line, but how/where can I find this (Still a beginner :))
else // if it is booked then show the booking { $html .= "<div data-id=\"$id\" data-type=\"$color\" class=\"celldiv slots" . (($times_along_top) ? "1" : $slots) . "\">\n"; $html .= "<a href=\"view_entry.php?id=$id&". $query_strings['booking'] . "\" title=\"$long_descr\">"; $html .= "<a href=\"view_entry.php?id=$id&". $query_strings['booking'] . "\" title=\"$sleutel\">"; // I added this aswell (I actually copied every line which stated 'long_descr' and copied it under that line and replaced it with 'sleutel' (sleutel is my custom field) $html .= ($is_repeat) ? "<img class=\"repeat_symbol $c\" src=\"images/repeat.png\" alt=\"" . get_vocab("series") . "\" title=\"" . get_vocab("series") . "\" width=\"10\" height=\"10\">" : ''; $html .= "$descr</a>\n"; $html .= "$long_descr</a>\n"; $html .= "$sleutel</a>\n"; // Simply adding this doesn't work, that's why I assume I have to collect the data somewhere from the database? $html .= "</div>\n"; } $html .= "</td>\n"; } } return $html; } // end function draw_cell
The easiest thing to is to modify the function
map_add_booking()
in functions_table.inc and modify$entry['name']
, egLast edit: Campbell Morrison 2022-11-15
Hi,
When I edit the field all my entries disappear.
In the attachment you can find what I tried to edit, not sure if I did entirely what you meant.
Regards,
Jonas Dekeyser
Related
Support Requests: #1300
Last edit: Campbell Morrison 2017-08-24
Hi,
First of all, sorry for the spam :).
In addition to my previous mail (below this one)
I typed something wrong and that’s why my entries disappeared…
Can you add more then 2 lines (data and long_descr are already showing)
But I’d like to add a third and maybe a fourth line (data coming from custom fields)
So, I’d like to display
- Short description (bold)
- Long description
- Custom field one
- Custom field two
Kind regards,
Jonas Dekeyser
Last edit: Campbell Morrison 2017-08-24
Something like:
You’re my hero!
Thanks for the help mate ;)
I did add . “\n” . to create a new line, but that doesn't work :p
Kind regards,
Jonas
Last edit: Campbell Morrison 2017-08-24