Can someone help me?

I have trouble conection with CMS, and the same adding RichText i json



You have a missing closing } in your app settings

Yep as Huw mentions, missing closing }.
I also replied to this here where you also posted the question, would suggest to try and use one place to post your question then in multiple places.

Im sorry I write tw


o places. Im new to Umbraco. Can you take a look at to things for me? Social links and fault on package Umbraco.Web.

No problem at all and hope you are finding it OK to learn Umbraco.
This error you seem to be having is perhaps something slightly misspelt wrong.

You can see the red squiggly line under, indicating an error in the file, which is under the word InvertefIconColour.

If you have build the C# models with ModelsBuilder in Umbraco then Visual Studio should be helpful and try to do auto completions for you and avoid cases with slight typos.

I assume the name of this property that you want to use in this razor view for the social links is called

InvertedIconColour and not InvertefIconColour

I have used Umbraco for 3 years now, but not the hard coding. only as customer from another IT company in Norway. But they take 1600NOK each hour. So I want to try this by my self. You can see melhuscatering.no and pettersenco.no, this two sites I bought

That’s fab to hear you are coming from the customer side and trying to get your hands dirty with the code side :smiling_face:

WOW at 1600NOK an hour, I clearly need to move to Norway ! :laughing:

Yeah you can say. But they are very good with Umbraco. Do you have any soulution for this marks?

Well I need to reconsider my rates then :joy:

I reckon it maybe some left over HTML markup in your Razor Views.
It could be an additional < that you may have mistyped.

What a day… I only get faults today…

@inherits UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockGridItem<ContentModels.SocialLinks>>

<h4 class="text-uppercase mb-4">@Model.Content.Title</h4>

@if(Model.Content.Links?.Count > 0)
{
    foreach(BlockListItem<ContentModels.SocialLink> item in Model.Content.Links)
    {
        if (item.Content.Link is null || item.Content.Icon is null 
        || item.Content.IconColour is null || item.Content.InvertedIconColour is null) continue;

        var iconKey = item.Content.Icon.Key.ToString("N")

        <style>
            .svg-iconKey {
                fill: @($"#{item.Content.IconColour}")
            }
        </style>

        <a class="btn btn-outline-light btn-social mx-1" href="@item.Content.Link.Url" title="@item.Content.Link.Name" target="@item.Content.Link.Target">
            <our-svg media-item="item.Content.Icon" class="svg-inline--fa fade-fw"></our-svg>
            </a>
    }
}
* ### Encountered end tag "style" with no matching start tag. Are your start/end tags properly balanced?


VS dont recognize <style> </style>
+

  18. </style>

You are missing a semicolon on line 12 :slight_smile:

This makes the compiler think your <style tag is part of the .net code in line 12.

In Visual Studio its also visible by the fact that <style> has the wrong color:

Yep Soren beat me to it…

1 Like

Are curly brackets { } not required for if-statements in razor views?

Sorry the screenshot, but now you see what comes up when I write <style

Yes, you need to add a semicolon after .ToString("N") else the compiler will think you are writing C# code.

Your original code

Fixed code (spot the difference)

@inherits UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockGridItem<ContentModels.SocialLinks>>

<h4 class="text-uppercase mb-4">@Model.Content.Title</h4>

@if(Model.Content.Links?.Count > 0)
{
    foreach(BlockListItem<ContentModels.SocialLink> item in Model.Content.Links)
    {
        if (item.Content.Link is null || item.Content.Icon is null 
        || item.Content.IconColour is null || item.Content.InvertedIconColour is null) continue;

        var iconKey = item.Content.Icon.Key.ToString("N");

        <style>
            .svg-iconKey {
                fill: @($"#{item.Content.IconColour}")
            }
        </style>

        <a class="btn btn-outline-light btn-social mx-1" href="@item.Content.Link.Url" title="@item.Content.Link.Name" target="@item.Content.Link.Target">
            <our-svg media-item="item.Content.Icon" class="svg-inline--fa fade-fw"></our-svg>
        </a>
    }
}

Change

The change is this one line, as Soren mentions its missing the semicolon. C# needs to be told that this is the end of the line and is done with a ;

 var iconKey = item.Content.Icon.Key.ToString("N");

Hello guys:) I fck up, is it some way to change Main and Header?

Instead of “guys”, may we suggest, for example: “folks", “Umbracians”, “all”, or “everyone”? We use gender inclusive language in this forum :grinning_face: (read more)

1 Like

I assume you mean the sort order, so that header is first before the property named main.

If so click the reorder property top right and then drag and drop to change the order and save the change to the document type.