Getting 403 error with page builder

Rakhi Khare asked on November 3, 2021 12:37

Hi, I have created a pagetype with pagebuider option enabled and when I am trying to open it in admin I am getting error as


"An error occurred while attempting to retrieve page templates. Contact your system administrator and check that the page builder feature is registered correctly in the MVC project."

when I am checking in developer tools on browser, below error is shown

"VM1120 GetResource.ashx:14 GET http://localhost:56908/cmsctx/pv/6415b8ce-8072-4bcd-8e48-9d7178b826b7/culture/en-US/wg/eb4fd497-ed49-47d3-b735-ddba33789a05/readonly/0/h/4806f16f8190e7f4adb4a19d121d9b4de8370f71ce02133d4c068424d350de00/-/Kentico.PageBuilder/PageTemplates/GetFiltered?uh=6b5e737f4b598de4b38abac23ccd76686a78f71551032033b187a242e3cb6756&pagetype=MedioClinic.LandingPage&culture=en-US 403 (Forbidden)"

Please help me to figure it out

Recent Answers


Brenden Kehren answered on November 3, 2021 12:59

Is your preview url set up with the proper domain? Looks like your domain is http://localhost:56908

Did you create a controller and a view for the page?

Have you registered the net repository for the data access for the page type?

0 votesVote for this answer Mark as a Correct answer

Rakhi Khare answered on November 3, 2021 13:07 (last edited on November 3, 2021 13:09)

This is my first application to learn Xperience 13 i.e. MedioClinic and I read about the pre requisite that both should be on same domain, so both are working on localhost and both are on http only. I created the controller and the view.

Please suggest how to registered the net repository for the data access for the page type?

I tried creating one sample page in another instance where I created only one page. that is working fine but when I am restoring the medioclinic database I am facing this issue.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on November 3, 2021 17:05

If you're working with localhost that's fine, the problem is your using a port with the domain which Xperience considers to be a different domain so you need to make sure your presentation URL has that port on it as well. On top of that, you'll also need a license key for that localhost:

0 votesVote for this answer Mark as a Correct answer

Rakhi Khare answered on November 3, 2021 17:26

I have used localhost license. Also it is working if i just follow https://docs.xperience.io/13tutorial/developer-tutorial/asp-net-core-development-tutorial. i just need to update the presentation URL.

if I follow "https://xperience.training.kentico.com/index" here we restore the database with continuous integration command. but after restoring it gives the same error

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on November 4, 2021 06:24

I would recommend checking the suggestions from this post. We often see this error when somebody has content tree-based routing enabled, and they try to visit a page for a page type which either

Does not have a view in the MVC project
or
Has a view with a misspelling or improper name that somehow violates the convention that the system uses to automatically find it

When the content tree based router does not find a view for the page type, according to the convention described in step 1 from this documentation it tries to load a page template. Then, if no template has been implemented yet, it throws this error.

Could this be the case for you? Do you have a view at ~/Views/Shared/PageTypes/< your page type namespace >_< your pagetype codename >.cshtml for the page type which is throwing this error?

0 votesVote for this answer Mark as a Correct answer

Rakhi Khare answered on November 9, 2021 06:50

I have landingpages controller and an index.cshtml for the same. do I need to create the pagetype folder inside view or it can work with controller like home page controller difference between home and landingpages , pagebuider not enabled for home i.e just a datasource but landingpages is pagebuider enabled . is there any different approach I need to take for pagebuider if i want to run it with controller?

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.