Hello,
I am struggling with this tutorial. (https://our.umbraco.com/Documentation/Tutorials/Starter-kit/Lessons/3-Add-Open-Graph/step-1) On step 3 it states to add the following code.
@if(Model.Content is IOpenGraph){
@Html.Partial("openGraph")
}
I have added this to my master.cshtml and created to partial. For some reason I get the following error.
IPublishedContent' does not contain a definition for 'Content'
Open Graph following Umbraco Tutorial
Hello, I am struggling with this tutorial. (https://our.umbraco.com/Documentation/Tutorials/Starter-kit/Lessons/3-Add-Open-Graph/step-1) On step 3 it states to add the following code.
I have added this to my master.cshtml and created to partial. For some reason I get the following error.
Can anyone tell me what I am doing wrong?
Hi Heather
Try this code:
Thanks Alex, this code got me working again. :)
You are always welcome, Heather!
Seems it is an answer :)
Your model has no
Content
property.Which view model do you use? What is in your
@inherits
at start of the razor view?Hi guys,
I am also struggling with this error.
The type or namespace name 'IOpenGraph' could not be found (are you missing a using directive or an assembly reference
After adding this code to my Partial View openGraph.cshtml following the tutorial.
is working on a reply...