display variable value in another view

Support MB Views display variable value in another viewResolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #20955
    sofdesignesofdesigne
    Participant

    Hi, i am just declaring a variable in a view, and want to display it in another view, any idea how to do it ?

    view one:

    {% set val = 0 %}
    {{ val }} displays ok

    view two:
    {{ val }} nothing displayed

    thanks

    #20960
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Each view is a template, you can include to another view then use the declared variable in that view.

    {% include 'view-name' %}

    Please follow this article for more information https://metabox.io/mb-views-creating-including-template-parts/.

    #20963
    sofdesignesofdesigne
    Participant

    thanks

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.