Template Visibility Conditions doesn't work

I created a page with a template.
I set a visibility condition to the template:

Whatewer I change (show if / do not show if | equals / doesn’t equal) the page and its content (template content) is always displayed for a user with role “fan”. The user owns only one role: “fan”.

Environment info

  • WordPress version: 6.0.2
  • Gutenberg Plugin version: N/A
  • Cwicly Plugin version: 1.2.2.4
  • Cwicly Theme version: 1.0.3

Hi @weedor,

Sorry to hear about this. Indeed this does seem strange.

Unfortunately, I don’t seem to be able to reproduce this on my end.

Would it be possible for you to provide support@cwicly.com with a temporary access to this installation? This way we can better see what’s going on.

Thank you.

1 Like

I will ASAP
Thank you @Araminta

1 Like

Hello @weedor,

Was @Araminta able to help you out on this or are you still experiencing problems using conditions for the User Role?

Thanks.

Hi @Louis
Thanks for digging up this topic.
I gave the admin access to support but, in fact, we didn’t finalize this issue.
I will check again and keep you posted ASAP.

Hi @Louis
I made a test a few minuts ago and the issue remains.

I created a template named: Fan-1-mois
I created a page (also named Fan-1-mois) linked to link to template fan-1-mois.
I set up a visibility condition to the template (in Themer):
Do not show if > User Role > doesn’t equal > fan1mois

I logout so I don’t have any role.
The page displayed.

I changed the condition to:
Do not show if > User Role > equals > fan1mois
The page is displayed again.

I logged in with a user with role = fan1mois → same issues.

Hope that these details help.
If it is not enough, you are welcome to check as admin in my Wordpress. I will transfer a new access as soon as request.

Hi @weedor,

Bringing this one back up.

I think that you had a conversation with @Araminta who confirmed that the issue wasn’t with the visibility conditions themselves.

You were applying the template directly from the page editor, which trumps any set of rules set in the conditions modal.

In any case, you can now set templates for specific pages from the Cwicly Themer with 1.2.5.2, which in turn will allow you to specify which pages you don’t want to apply the template.

If there is anything else you need, please don’t hesitate.

Cheers,

Hi @Louis,

I’m facing the same issue where my maintenance template cannot override post template setting in editor, even with priority set.

Do you mean that we can’t use template setting in editor at all? Looks like a huge limitation to me, and template condition should be able to override this setting with some high priority or dedicated setting.

In the meantime, using visibility conditions instead of editor setting is OK, but I have some sites with lots of different in-editor template settings, so my maintenance template half works.

Hi @yankiara,

Just wondering whether you are using the “Override Page Template” setting in the visibility conditions yet or not.

Screenshot 2023-08-25 at 09.38.32

Yes I tried everything.

In the meantime, here is a little snippet to display pages in editor template settings, in case anyone needs to find their manual settings:

/**
 * Display pages in-editor template setting in admin pages list
 */
 add_filter( 'manage_pages_columns', function( $columns ) {
   $columns['template'] = __('Template');
   return $columns;
} );
add_action( 'manage_pages_custom_column', function( $column_name, $post_id ) {
	if ( $column_name === 'template' ) {
		$editor_template = get_post_meta( $post_id, '_wp_page_template', true );
		if ( $editor_template == 'default' )
			echo 'Default';
		else
			echo array_search( $editor_template, get_page_templates() );
	}
}, 5, 2 );

Hello @yankiara,

Apologies for the trouble here.
There does seem to be an issue with the override template toggle.
We’re investigating and will issue a fix in the next update.

Cheers,

Hi,

We have fixed this issue in 1.3.0.2.

Please let us know if you are still experiencing issues once updated.

Best regards,
Johnny