Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted September 29, 20213 yr 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?
September 30, 20213 yr 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?
September 30, 20213 yr Author 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.
September 30, 20213 yr Solution 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.
September 30, 20213 yr Author 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.
September 30, 20213 yr 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.
September 30, 20213 yr Author 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 😄
September 30, 20213 yr Community Expert Management 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.