Umbraco MVC: Repeating same pattern content - asp.net-mvc

I am new to Umbraco Mvc. A page consists of repeating content -heading and body text. User can be able to add or remove any number of such type of content panel.
How can i implement this?
For this page i added a document type, template and content. I am not sure what to do next?
Please help,
Thanks.

This is an old question but I thought I'd leave a note here.
Umbraco 7
Both Nested Content and Archetype are both great packages for creating repeating content on a page/node in Umbraco. Nested Content is actually so good, as of version 7.7.0, it is included in Umbraco!
Another way to create repeating content is to create the content as nodes/pages in Umbraco, then picking it (using a multinode picker) node/page where you want the data to show.
Umbraco 6
Checkout uComponents as it allows for repeating content too.
Self promotion
My old blog post The best Umbraco packages of 2017 contains a little more information about these specific packages.

Related

what does the model.generated.cs file do in Umbraco?

Exploring Umbraco 8 and playing around building a test site etc.
Building document types and content pages via the back office interface, and looking in the code itself I've noticed a files called models.generated.cs.
looking inside, it contains partial classes like public partial class AndyTestPage : PublishedContentModel { } and properties I've given it like
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder", "8.5.5")]
[ImplementPropertyType("andyProperty1")]
public string AndyProperty1 => this.Value<string>("andyProperty1");
my question is, what exactly is the point of this file? what does is do and how are these properties and classes created in here via the backoffice cms.
second question is, how would I go about creating a document type, and properties from code? my noob assumption is to simply add the classes in the this file, but that doesnt seem right?
Thanks,
Andy
It belongs to modelbuilder.
It depends on how you build your umbraco solution. If you use visual studio you can use something called strongly type, it helps building templates with VS.
By default, modelsbuilder is set to "PureLive", which is for users who builds within the umbraco backoffice system.
You can set modelsbuilder to different options, depending on how you build.
You should not edit the file, it is created and maintained by the system.
https://umbraco.tv/videos/umbraco-v7/implementor/working-with-umbraco-data/working-with-models-builder/
https://our.umbraco.com/documentation/reference/templating/modelsbuilder/
elitenet.dk has answered the first question
With regards to your second question Umbraco is database/content first so unfortunately you cant write documenttypes etc. from code first... not that i know of.
I beleive this is because Umbraco was designed to be used by almost anyone with a little html/css knowledge. E.g. You can create templates and views from the cms without having to know anything about serverside development.
Just a little tip if youre starting with Umbraco and plan on using multiple environments take a look at Kevin Jumps Usync package, essentually the package allows for document types/properties etc. to be pushed from environment to environment.Usync

How to find unused items in the Content folder in Umbraco

I'm setting up a new Umbraco site to replace an older ASP.Net site.
The old site is riddled with old content that isn't linked to anymore. I want to prevent the same thing from happening on the new Umbraco site.
Is there a good way of finding unused items in Umbraco's Content folder (not Templates or Document Types)?
If that's not feasible, is there a way to keep content owners from creating a bunch of content pages and abandoning them instead of deleting them?
It's an interesting question, but from an SEO point of view an old page of content has plenty of power & I wouldn't delete it if possible.
I don't know of an umbraco package that will tell you which pages don't have links - but Google will tell you. If you want to know what links to www.example.com/oldpage.html then type the following into Google:
link:www.example.com/oldpage.html
(https://support.google.com/webmasters/answer/55281?hl=en)
I wouldn't delete old content (unless it is now plainly wrong) I'd keep all the old content & tidy it away:
Create a folder under home called something like 'archive'
Move all your dead content there
Use a 301 redirection package or change urlrewriting.config in case there are any external links to these dead pages as the old urls will now return 404 errors
Make sure that the sitemap contains links to these new archive pages
You will now have cleaned up the structure, but without losing any SEO value.

How to map shared Content Blocks to Templated in Sitefinity 5.2?

I just Migrated my 3.7 website to 5.2 Website, but I noticed that the Generic Content in 3.7 Project have been converted to Shared Content blocks in 5.2. And most importantly not all (only few are likned to pages, i.e., Used in pages column has "Not used" value).
I searched a lot but couldn't find any way to map these blocks to the pages as they were in 3.7 Project.
However, I was trying to follow tutorial:
http://www.sitefinity.com/documentation/documentationarticles/user-guide/widgets/content-widgets-group/configuring-the-content-block-widget
But I didn't see any option such as "Select from existing shared content button" in Edit Template mode, I get this option in Edit page mode & when I set the Content by selecting the existing Content it's not displayed in View mode, but it's displayed in edit mode.
Any ideas how to do this?
Thanks
With the introduction of Sitefinity v4, shared content is no longer available for templates, just for pages. They removed that ability unfortunately due to architectual reasons and performance issues.
The official comment on how to solve it at the moment, is by using inherited templates, where you drop a normal content block on a 'parent' template and thus its child templates inherit it while keeping a single point of edit.
As a non-recommendation 'hack', you can activate it, as described here. But keep in mind the response from Telerik:
it will lead to performance problems. This is why this feature is
disabled by default, and we do not recommend using it.
But there is also good news when you read the Sitefinity 5.3 roadmap which is scheduled for release end december 2012:
The 5.3 release includes the below improvements:
Shared content is now available to use inside page templates
Hope this helps,
Jochem.

Umbraco - working with document types

I've started working with Umbraco yesterday and my vision of working with it was as follows:
add document types
create a basic content tree
create templates
edit document types & templates adding what I need and replacing "lorem ipsum" with the content from Umbraco
The problem is that I added two properties to a Client document type. Then I got this while trying to edit content:
Object reference not set to an instance of an object.
This is hard to understand for me, because:
Umbraco is supposed to be friendly ('the friendliest...')
Database structure is organized in a way that this should not be the problem
Even using Fluent NHibernate Migrator adding a field to a database just creates another field without throwing any exceptions - and here?
So what's the idea here? Document types are once and for all and you can't edit them?
First of all it would be helpful to know which version of Umbraco you are using as there are minor differences in the versions 4.x and now with v5 it's a completely different game with a complete new codebase on ASP.NET MVC.
In some versions of v4 there had been a bug where you get the error message you posted when you have added two document types with the same alias or two properties with the same alias to one document type.
So that you cannot edit the content is not the intention of umbraco ;-)

Adding html form and input tags into Symfony static pages

I inherited the management of a Symfony site and need to add some HTMl form tags to one of the "static" pages via the CMS. The scenario I have is:
/index.php/splash/welcome pulls up the welcome screen.
We want to be able to add a subscription button on that page.
The HTML has been supplied for us by the company that handles the subscriptions.
The form post method has an action that references a script on a remote site (no lectures on the security implications please ;-).
When I add the <form... and <input... tags via the CMS admin panel, the tags get removed automatically by Symfony.
Is there a way to tell Symfony to allow these tags?
Thanks in advance,
Marty.
This is goign to depend completely on how the developer set up the CMS. Youre using a rich text editor in source mode i would take a look at that editor's config file and documentation because its probably the one responsible for stripping the tags.
If its just a plain text area i would check the submit action for the edit form and take a look at the code... he may be using something to strip them in there.
If youre using one of the Symfony CMS plugins (Diem, Apostrophe, Sympal) i might be able to help further if i know which one youre using. If its something custom we would need to see the code. This isnt really indiciative of the Symfony core, but rather the CMS youre using.

Resources