Sonya* Posted September 29, 2021 Posted September 29, 2021 I have a database with a field defined as title. I would like to have some characters before and after the title. I have tried **{$formValue}** as Listing Custom Format and Display View Format. The formats seem to be ignored for title fields. It works for all other fields. Does it work as desired?
TDBF Posted September 30, 2021 Posted September 30, 2021 3 hours ago, Sonya* said: I have a database with a field defined as title. I would like to have some characters before and after the title. I have tried **{$formValue}** as Listing Custom Format and Display View Format. The formats seem to be ignored for title fields. It works for all other fields. Does it work as desired? I have just checked and this doesn't work for Title fields. My suggestion would be to edit the templates and add your prefix and suffix to the Title there?
Sonya* Posted September 30, 2021 Author Posted September 30, 2021 5 hours ago, TDBF said: My suggestion would be to edit the templates and add your prefix and suffix to the Title there? I do. But this works only for display and listing. It is not system-wide. Notifications and activity stream use title as is. This is not critical, but I wonder why title and content cannot use format options. Even in templates. The options are there, but they are just ignored. TDBF 1
Solution opentype Posted September 30, 2021 Solution Posted September 30, 2021 Yeah, the title and body field are “special fields”. You can’t edit them this way. Just like changing the order in the ACP doesn’t do anything. Jimi Wikman 1
Sonya* Posted September 30, 2021 Author Posted September 30, 2021 7 minutes ago, opentype said: Yeah, the title and body field are “special fields”. You can’t edit them this way. Just like changing the order in the ACP doesn’t do anything. I can understand, that they do not want special formatting anywhere else. So that one cannot break activity stream, notifications, blocks or any other area where title and content is used. But I do not understand why they suppress formatting even in database templates. I mean, we can format every other field via format options without touching template. However, for title and content, we have to do it in template. Ridiculous. TDBF 1
TDBF Posted September 30, 2021 Posted September 30, 2021 1 hour ago, Sonya* said: I do. But this works only for display and listing. It is not system-wide. Notifications and activity stream use title as is. This is not critical, but I wonder why title and content cannot use format options. Even in templates. The options are there, but they are just ignored. Yeah, if the option to edited these fields for the title and content really should be removed or should work as that would remove a lot of ambiguity when editing these settings. Sonya* 1
Sonya* Posted September 30, 2021 Author Posted September 30, 2021 While the topic is marked as solved. The real solution is to use: {$record->customFieldDisplayByKey('title', 'listing')} in template instead of $record->_title. This way the formatting works as for every other field. Also different output with second parameter "display", "listing", "raw" - everything you want 😄 WP V0RT3X and TDBF 1 1
Management Matt Posted September 30, 2021 Management Posted September 30, 2021 I'll make a note to clear up this confusion in the user interface. The title and content fields are special because they fit into the Node\Model framework which underpins this feature. Marc and Jimi Wikman 2
Recommended Posts