Skip Navigation

[Resolved] Layouts in Access error templates not showing footer correctly

This support ticket is created 5 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Our next available supporter will start replying to tickets in about 0.29 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 12 replies, has 2 voices.

Last updated by daveG-7 5 years, 10 months ago.

Assisted by: Luo Yang.

Author
Posts
#874094

I've had a lot of trouble getting my error layout to show for roles that don't have access to the content in an Access Post Group. At first, they wouldn't show at all, until I found this bug: https://toolset.com/errata/error-layout-not-applied-yoast-active/

Then, when I applied that fix, the layout is calling, but then it's calling again in the footer - you can see the same content but with CSS applied by the footer. You can see this here: hidden link

When I call the same layout on a page, it works fine: hidden link

Any idea what's going on?

#875450

Hello,

The problem you mentioned above is abnormal,
Is there any different setting between those two pages: "member-only-sample-event" and "layout-test"

in case it is a compatibility problem, please try this:
1) deactivate other plugins and switch to wordpress default theme, and test again
2) If the problem still persists, please provide a database dump file (ZIP file) of your website in below private detail box, also point out the problem page URL, I need to test and debug it in my localhost, thanks

#881955

As you mentioned above, it is a compatibility problem between other plugins/theme and Toolset plugins, so I will not be able to duplicate the same problem with only your database dump file.

Please provide a copy of your website:
https://toolset.com/faq/provide-supporters-copy-site/
You can put it into your own google drive disk, and share the link in the "private detail box", I need to duplicate same problem and debug it in my localhost, thanks

#886374

Thanks for the details, I am downloading the files, will feedback if there is anything found

#886454

It seems to be a compatibility problem between Layouts plugin and the "Pagesections by Develoved" plugin, two options, you can try one of below options:
1) Deactivate the "Pagesections by Develoved" plugin, use Layouts plugin to design your web pages
https://toolset.com/documentation/user-guides/#layouts

2) If you don't need the Layouts plugin, you can deactivate "Layouts" plugin, Dashboard-> Toolset-> Access Control
find "Guest" user, click edit button, choose a content template, and test again.

#901142

Hm, ok. Neither of those options really work for me. I already developed a complicated footer with that Pagesections plugin, and I need Layouts to show a custom error message for pages controlled by Access Groups for when someone doesn't have access.

The really strange thing is that it is working with that plugin on the development site which is almost identical. I guess I'll go back to trying to troubleshoot it myself to see what the differences are.

#901458

It works fine in my localhost, if you still need assistance for it, please provide a test site with the same problem, and fill below private detail box with login details, I need a live website to test and debug.

#901792

I figured out why it was working on my development site and not on the live site - the fix you have for the Yoast errata issue (https://toolset.com/errata/error-layout-not-applied-yoast-active/) was causing the problem. With that file restored and yoast deleted, it's now working. Though I hope you can figure out what was causing the error in that patch in conjunction with the Page Sections plugin, because I don't want the final fix in the next version of Access to have the same issue, since I would like to use Yoast on this site.

#901832

Thanks for the details, I am trying to duplicate same problem in my localhost, will feedback if there is anything found

#901937

There isn't any relationship with the errata you mentioned above, the problem is that:
1) You are using Pagesections plugin to add posts
2) In the problem page, the Pagesections plugin display the above post content as page footer
So it conducts the problem, access don't allow the visitor to see the post content, or the post content created with Pagesections plugin, so it display the 404 error layout twice.

Hope it is clear.

#902133

That's incorrect. After having removed that fix, here is a page where the error layout (for when someone doesn't have access) is displayed correctly, and the footer, (which is created with Page Sections, and is the only part of the page created with that plugin), also displays correctly: hidden link

The only thing I changed from when the error layout was displaying in the footer to when it was working was replacing the helper.php file from the errata with an un-updated version and deleting Yoast (which breaks the layout differently, as mentioned in the errata).

#902282

That errata is for access and Yoast plugin, your case is the problem of Pagesections plugin, and yes, you are right, the errata is not compatible with Pagesections plugin, there is a workaround, you can use wordpress filter hook the_content to override the footer displaying when it is from Pagesections plugin, for example, you can add below codes into your theme/functions.php:


add_filter('the_content', 'my_func_1', 999);

function my_func_1($content){
	if(get_post_type() == 'pagesections'){ // when it is  from Pagesections plugin
		remove_filter('the_content', 'my_func_1', 999);
		$content = do_shortcode(get_the_content()); // display the post content directly!
	}
	return $content;
}

More help:
https://developer.wordpress.org/reference/hooks/the_content/
https://codex.wordpress.org/Function_Reference/get_the_content

#907597

Thanks. For now I'm just using a different plugin than Yoast, but this should work when I want to go back to Yoast.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.