I have to style the view title
and print it in the unformatted twig. how can i achieve this ?
2 Answers
As per @Clive's comment
{{ view.getTitle() }}
-
1Why the extra bit getting the route title? It seems
$view->getTitle()
is all you need, see for exampleviews_ui_preprocess_views_view
. In the twig template that would translate to a simple{{ view.getTitle() }}
(you know the View is already in$vars
right? No need to load it again)– Clive ♦Mar 7, 2018 at 8:38 -
I would swear I had tried it !! but I guess my installation was messed up ... on a new installation it works !!! Thanks– GiorgosKMar 7, 2018 at 8:47
-
I applied your answer and the result was great..!! thank you so much Mar 7, 2018 at 15:00
How do I get the URL value in the views-view-unformatted--domains_devs.html.twig? I'm using D10.
<a href="[My_Link]"/>Go to Link</a>