Sonya* Posted September 29, 2021 Share 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? Link to comment Share on other sites More sharing options...
TDBF Posted September 30, 2021 Share 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? Link to comment Share on other sites More sharing options...
Sonya* Posted September 30, 2021 Author Share 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 Link to comment Share on other sites More sharing options...
Solution opentype Posted September 30, 2021 Solution Share 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 Link to comment Share on other sites More sharing options...
Sonya* Posted September 30, 2021 Author Share 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 Link to comment Share on other sites More sharing options...
TDBF Posted September 30, 2021 Share 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 Link to comment Share on other sites More sharing options...
Sonya* Posted September 30, 2021 Author Share 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 Link to comment Share on other sites More sharing options...
Management Matt Posted September 30, 2021 Management Share 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. Jimi Wikman and Marc 2 Link to comment Share on other sites More sharing options...
Recommended Posts