But for the life of me, I am struggling to find where the problem is. It's an Umbraco Cloud starter package. If I comment the following line out, then the page loads up and the hardcoded HTML in my view is rendered.
The partial view 'BlockList/Components/richTextCenteredContent.cshtml' was not found or no view engine supports the searched locations. The following locations were searched: ~/Views/RenderMvc/BlockList/Components/richTextCenteredContent.cshtml.aspx
The alias is also correct for the block list item. Here is the Alias for that block: https://prnt.sc/MLWIjrPP5Zjj
When I comment it out and just add plain HTML with some random text, that is being rendered on the frontend, so it is definitely hitting the correct file.
Syntax Error: Rendering Block List Component
Hello,
I am trying to render my block list component on the frontend but I'm keep getting the following error;
So this is my content page view;
I've tried using both of the following;
AND
But for the life of me, I am struggling to find where the problem is. It's an Umbraco Cloud starter package. If I comment the following line out, then the page loads up and the hardcoded HTML in my view is rendered.
This is the content properties that I have set up as a composition so I can reuse this on every page. https://prnt.sc/kv4Z1PMrav38
Here is the page builder data type I've created: https://prnt.sc/D3VlDZmdQpMa
Any help would be massively appreciated.
Thank you,
Javed
Hi Javed
What is in \Views\Partials\BlockList\Default.cshtml line 11 and around?
Hi Soren
This is the code in that file, it was there by default and I've not tinkered with it.
And this is the line that it's complaining about;
Do I need to make any changes to this code file?
Thanks,
Javed
Try add
+".cshtml"
And make sure you have PartialViews with names that match the docTypeAlias for each blocklist item.
Ok - now that is some progress.
The next error I am getting is;
The alias is also correct for the block list item. Here is the Alias for that block: https://prnt.sc/MLWIjrPP5Zjj
The partial view: https://prnt.sc/sLXGNDEdmE7s
Thanks,
Javed
Try using the full path
~/Views/Partials/...
so
So I've done that now;
It still doesn't like it.
First I'd clean / rebuild. Then look into the partial view itself. It seems to have found the correct partial view now.
It's a site that is on Umbraco Cloud (Starter package) - how would I go about rebuilding the project?
I can go to Settings > Models and click on Reload.
You should be able to clone locally and work on your local machine.
But, what's in this file: richtextcenteredcontent.cshtml
This is what is in that file, but the name of the file is the alias richTextCenteredContent.cshtml
remove
</strong>
and this also looks weird but shouldn't break it
<u style="width:92.4498%"></u>
Actually, why not use
for now and see what happens
I've removed that HTML and it's complaining about a syntax error and is looking at the /View/ContentPage.cshtml
Here is the ContentPage.cshtml view.
My Data Type: https://prnt.sc/P_ymL6Nxuou9
Composition: https://prnt.sc/lNsG_e7vjD6V
I believe the problem is with this line of code;
When I comment it out and just add plain HTML with some random text, that is being rendered on the frontend, so it is definitely hitting the correct file.
Hi Mohammad!
You can also try setting the type of the blocklist model directly in the "inherits":
and if you also had a custom Settings model, it would be something like this:
Then, you can access properties like:
Wow, that actually worked flawlessly.
I'm in the process of gaining proper admin rights to the cloud project so I can clone it locally and debug using the correct tools.
Many thanks again to everyone that has contributed. I can now knuckle down and crack on with this project.
is working on a reply...