When Pseudo Title is used on a node page, it works great!
However, when that node is then included in a view using a view mode that includes a Pseudo Title, instead of printing the title of the node in each place, it prints the title of the view in each place. Tested on simplytest.me to ensure it wasn't related to something in my install.
I'm guessing it's just looking at the title of the current page and grabbing that value, when it should be looking at the title of the parent node.
I realize that many people who build views would use fields rather than view modes, and thus wouldn't even need Pseudo Title for this purpose. But for those who are building views with view modes, I wanted to report this bug.
Thanks for your work on this helpful module!
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | Screen Shot 2017-10-03 at 1.59.43 PM.png | 77.79 KB | rootwork |
Comments
Comment #2
rootworkComment #3
rootworkHere's an example. I purposely left the titles of the articles displayed so you can see the discrepancy. "View title" is in the spot where Pseudo Title should be printing the node title, but is actually printing the view title.
Comment #4
jcmartinezNot sure I understand your use case.
Why would you use the pseudo title field in a view when you can use the actual title?
Is this because you are building your view using FORMAT -> Show -> Content?
If this is the case try to configure the teaser view of your content type so that it doesn't include the Pseudo Title.
Another option is configuring your view to use fields under FORMAT -> Show -> Fields and selecting the actual title.
Comment #5
rootwork@jcmartinez Maybe I wasn't clear in the IS, but that's what I was trying to say in the fourth paragraph.
If you use fields in a view then, yes, you could use the real title.
But there are use cases for using a view mode (like Default, Teaser, or one you create). For instance, say you have a dozen different views which should all use the same fields in the same order using the same displays. It makes a lot more sense to create one view mode to use each time then to configure the fields in every view.
When you use Pseudo Title within a view mode, it grabs the title of the current page (e.g. the title of the view), not the node which is displaying the view mode.
This could also have implications outside of views -- other modules use view modes (Panels, for instance) and custom entities might also leverage them -- but I figured views would be the most common use case in which this would surface.
Comment #6
jcmartinezI think if you need to use the teaser in a view, while this module is enabled, you could remove the pseudo title from the teaser mode at /admin/structure/types/manage/article/display/teaser.
If someone could offer a suggestion for a different way of coding this module, I'd be happy to look into it.
Patches are also welcome.
Comment #8
jcmartinezHi @rootwork, I just committed a fix to this issue. Please test it and let me know if it works for you.
Note that I haven't had the time to add tests in code so if you test using simpletest it will likely fail.
If you or anyone would like to contribute a patch for automated testing, I'll add it.
Comment #9
jcmartinezComment #10
jcmartinez