Closed (fixed)
Project:
Private Message
Version:
8.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
12 Dec 2019 at 16:35 UTC
Updated:
28 Mar 2020 at 19:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
anmolgoyal74 commentedYou have to override the template for the messages. If you enable to debug mode, you can see the template file name suggestion. Create the file in your custom theme.
Comment #3
zenimagine commented@anmolgoyal74 I have several models. Which model should I use ? Thank you
Comment #4
anmolgoyal74 commentedYou can use the highlighted field template file.

Comment #5
zenimagine commented@anmolgoyal74 It does not work. I test with this templates :
private-message--inbox.html.twigBut how do you display false fields ?
The following code does not work. I want to display the fields in the screenshot :
Comment #6
anmolgoyal74 commentedCreate the template file with name "field--private-message--message--private-message.html.twig" and place it under template folder in your theme.
and add the following code in it.
Comment #7
zenimagine commented@anmolgoyal74
Thanks but it changes the conversation and the inbox. I'm looking to modify only the inbox. See the screen capture.
Comment #8
anmolgoyal74 commentedFor this requirement, You might have to create the template file for the block.
Comment #9
zenimagine commentedIs it possible to add a parameter in "manage the display" to customize the class ?
Comment #10
anmolgoyal74 commentedI don't think it is possible. Even it is, Then it will be added to both block and the conversion.
What you can do is that you can target the block using block's classes and then implement custom CSS for the block if it solves the problem.
Comment #11
zenimagine commentedIs it possible to do this in the
.themefile ?To add the class to
Comment #12
anmolgoyal74 commentedWith "this", what are you referring to?
Comment #13
zenimagine commentedI have the following file in my theme. is there a code to add in to add a class to the
tag in the inbox ?
bootstrap_subtheme_front_office_old.themeComment #14
anmolgoyal74 commentedI don't think you have to add any code in the .theme file for this. Just create the template file, you might have all the variables available in the template file already.
Comment #15
zenimagine commentedThe model closest to the
tag is as follows :
https://git.drupalcode.org/project/private_message/blob/8.x-2.x/template...
The name suggest is
private-message--inbox.html.twigBut I don't know how to add the class. Is it possible to add TWIG code in the model to customize the fields ?
Currently we cannot customize anything for private message with this TWIG file.
Comment #16
anmolgoyal74 commentedzenimagine,
Is this issue resolved?
Comment #17
zenimagine commentedI solved a problem by adding the style directly to my CSS file, but I would have preferred to use the class in TWIG
Comment #18
anmolgoyal74 commented