Bricks very usefully allows querying multiple post types with the query loop. To compliment this, could a condition of Post Type be added to the choices when setting up an element condition?
In my use case I want to add an extra image to a card for posts of type A, but not type B.
I need to be able to use condition to show some element when a session variable has a certain value.
E.g. $_SESSION[āLoggedā] != āNOā.
how can I implement it?
Mmmmh, what kind of application can you think of?
I was unsure for a moment (and the condition is not there, youāre right), because in general you define the structure of the post type via the template and in it you can define further elements (but the condition post type is already fulfilled).
I can also define sections as template and define the custom posttype as condition.
I just canāt think of an area of application right now. What was your idea?
Hey Sebastian, as I said in the OP, this request came about because I had a query loop querying two post types and I wanted to show an element for one type but not for the other. So itās not relating to a page template but a query loop querying more than one post type.
Then I got you wrong. My bad!
A very specific request but yes it would be nice if that would be possible!
I have no idea how to build something like this ui based, because the conditions in general are above the query loops and apart from the taxonomy filters this would be a whole level lower.
Is it that specific? Iām making a Search Results template for a site that has both blog posts and products. It would be great to have buttons for āRead moreā or āAdd to cartā only appear for the relevant post type instead of both.
This seems like something would be a fairly common occurrence so Iām surprised itās not easily doable.
Itās weird but that way is not working for me now (Iām using it inside a listing template from jet engine)
Even if a put that fuction inside a basic text I donāt see nothing.
Because Iāve a clean and seo friendly permalink config Iām using post link or post url to see which CPT is
Not āPHP Functionā nor anything similar appears in the condition menu for an element. Perhaps it does if Code Execution is enabled? If that is the case, should not need that in order to display elements based on post type.