5

enter image description hereI have to style the view title and print it in the unformatted twig. how can i achieve this ?

2 Answers 2

8

As per @Clive's comment

{{ view.getTitle() }} 
3
  • 1
    Why the extra bit getting the route title? It seems $view->getTitle() is all you need, see for example views_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
    Commented 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
    – GiorgosK
    Commented Mar 7, 2018 at 8:47
  • I applied your answer and the result was great..!! thank you so much Commented Mar 7, 2018 at 15:00
0

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>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.