Way to exclude a widget on a subset of profiles?

I have a set of profiles that all have a few blurb widgets embedded within their details template.
I am however looking for a way to exclude one of those widgets within a particular subset of the profiles.

Examples:

The “sequoia” accordion is not necessary on example 2; so I’d like to have it not display.

(I tried wrapping the widget in the template with a set up, but it actually hid the widget on all profiles, rather than the subset.)

Hey Morgan,

Sure thing, I think some XPHP logic in your profile details template would likely do the trick. Tagged items get a has_tag_TagName variable set you could check against, or you could do something like checking against the profile type (tid) to do it for certain types. Some XPHP details examples are on this page. Hope this helps!

Karl

1 Like

Oops. I notice that in my post, my code in the last sentence was deleted. In other words, I tried that and it fails…

See these new test examples (and code below now I remembered how to post code here):

				  	<xphp content="true">
					  <if var="has_tag_WFR" not_matches="1"/>
						  <content>
						<xphp random="5,10"/>
					  </content>
					  </xphp>

Both examples act the same. I am assuming it is something super minor I am missing?

Ah, it looks like the core code that sets the has_tag_ variables (a) replaces spaces with underlines and (b) puts the tag in lowercase – does it work if you check for has_tag_wfr ?

1 Like

@Grether Can you try this with the following?

<if var="has_tag_wfr" not_matches="1"/>

Note the lowercase tag. I did some testing, and I think that works

2 Likes

The uppercase was indeed the issue, yep! Lowercase (even though the editor has an uppercase tag) saves the day.

1 Like