I would like to use the blog function of the standard template in my template. And although I use the exact same code, it does not work in my template.
I always get this error message:
"Compiler Error Message: CS1061: 'Umbraco.Web.PublishedContentModels.Blog' does not contain a definition for 'howManyPostsShouldBeShown' and no extension method 'howManyPostsShouldBeShown' accepting a first argument of type 'Umbraco.Web.PublishedContentModels.Blog' could be found (are you missing a using directive or an assembly reference?)"
The code is:
@Umbraco.RenderMacro("latestBlogposts",
Line 13: new
Line 14: {
Line 15: numberOfPosts = Model.Content.howManyPostsShouldBeShown,
Line 16: startNodeId = Model.Content.Id
Line 17: })
Yes, I'm sure. At least, I hope. I have two document types: "blog" and "blogpost". "blogpost" is a child of "blog". In "blog" I have the field. No typos or anything..
Blog function of standard template
Hey guys,
I would like to use the blog function of the standard template in my template. And although I use the exact same code, it does not work in my template.
I always get this error message: "Compiler Error Message: CS1061: 'Umbraco.Web.PublishedContentModels.Blog' does not contain a definition for 'howManyPostsShouldBeShown' and no extension method 'howManyPostsShouldBeShown' accepting a first argument of type 'Umbraco.Web.PublishedContentModels.Blog' could be found (are you missing a using directive or an assembly reference?)"
The code is:
Unfortunately I'm lost at this point.
Does anyone havean idea? Thanks a lot! Simeon
Hi Simeon
Do you have a property "howManyPostsShouldBeShown" in the node?
Alex
Hi Alex,
Yes, built exactly like in the standard template with a slider.
Simeon
First of all, rename it to "HowManyPostsShouldBeShown"
And try to rebuild Models builder models
First is done. How do I rebuild Models builder models?
At Developer => Models Builder I can only see the settings and have a "Reload" button.
Then change settings in web.config -> appSettings -> Umbraco.ModelsBuilder.ModelsMode set to Dll
And go to At Developer => Models Builder
This doesn't exist in the web.config.
Hi Simeon,
What version of Umbraco are you using?
Thanks,
Nik
Hi Nik,
We run on 7.9.2.
Simeon
One more thing: If I take this
out and replace it with a defined number, like so
it works.
Does this help?
Simeon
The issue is with "Model.Content.HowManyPostsShouldBeShown" field, I think it's not presented in Model.Content
Are you sure that current page has this field?
Hi Alex,
Yes, I'm sure. At least, I hope. I have two document types: "blog" and "blogpost". "blogpost" is a child of "blog". In "blog" I have the field. No typos or anything..
Simeon
is working on a reply...