Quantcast
Channel: ActiveTopics
Viewing all 72689 articles
Browse latest View live

Eventhandler subscribing to deleting nested content

$
0
0

Hi,

I have an umbraco 8 solution running where i'm saving umbraco documents in a separate database and most of it is working fine. I followed the official documentation on subscribing to events and I'm using the ContentService.Trashing event handler when I want to remove the removed umbraco content from my database also - this also works.

My problem is that i want to delete some of the nested content I have stored on one of my document types, but the eventhandler is only triggered when deleting the content of a doc type and not when deleting items in the Umbraco.NestedContent

nested content

edit: here is the implementation of the trashing eventhandler so far. enter image description here

I couldnt find anything about this issue, but i'm hoping that someone has an idea how to trigger the trashing of nested content?

Thanks!


Publish and all its subpages are not getting published

$
0
0

Umbraco version - 7.15.3

We were trying to publish and all its subpages (Right click on the node and select publish) but seems my sub pages are not getting published (Sub pages are published already but some change in properties, I want to republish it again.)

Any help would be greatly appreciated

v8 Nested Content Templates

$
0
0

Scenario: Home.cshtml ncSlider.cshtml ncSlider DocType

Home.cshtml would look like this:

@inherits Umbraco.Web.Mvc.UmbracoViewPage
@{
    Layout = "Page.cshtml";
}

@if (Model.HasValue("mySlider")) { 
    @Html.Partial("ncSlider", Model.GetPropertyValue<IEnumerable<IPublishedContent>>("mySlider"))
}

My ncSlider.cshtml would look like this:

@inherits Umbraco.Web.Mvc.UmbracoViewPage<IEnumerable<IPublishedContent>>
@{
    Layout = null;
    var item = Model.FirstOrDefault();
    if (item == null)
    { return; }
}

@if (item.HasValue("ncSliderPropertyAliasHere")){

}

I used to do this ad nausea pre V8. In V8 I haven't been able to figure this out. I'm not even sure it's possible in V8. Hopefully someone can point me in the right direction! I love this style of object oriented programming. Building one slider back and font-end and reusing that everywhere I need a slider throughout the site.

I went down this road when V8 first came out. I remember someone trying to explain the issue is that DocTypes that are Element Types don't have cshtml views like they did pre V8. Wondering if that's changed or if there's a workaround. B/c I badly want back the ability to build these nested content components and re-use them throughout the sight. Almost enough to switch back to V7 if it can't be done in V8.

Any help out there?

Using UmbracoFileSystemProviders.Azure.Media does not process media files in Azure blob uploaded from Umbraco BackOffice

$
0
0

Hi guys,

I am using AzureBlob container to store Umbraco media files with UmbracoFileSystemProviders.Azure and UmbracoFileSystemProviders.Azure.Media Nuget packages, but it does not work when I upload new image in Umbraco media. I already had a list of media files, which I uploaded manually to AzureBlob and for them everything works, so I can see them in Umbraco BackOffice and my site also renders them. The issue is when I upload new image from BackOffice, it seems the image is stored in the container, but the BackOffice tries to render it using the blob url, not the CMS url.

https://[CMS]/media/q3ib0inw/building.jpg - works

https://[BlobURL]/media/q3ib0inw/building.jpg - does not work

For the manually uploaded media files Umbraco BackOffice tries to render the CMS URL and it works. For the new uploaded images (through BackOffice), it tries to render the Blob Url (instead of the CMS one) and it does not work.

Here are my configurations for security.config

<service prefix="media/" name="CloudImageService" type="ImageProcessor.Web.Services.CloudImageService, ImageProcessor.Web">
  <settings>
    <setting key="Container" value="media"/>
    <setting key="MaxBytes" value="8194304"/>
    <setting key="Timeout" value="30000"/>
    <setting key="Host" value="https://[bloburl].blob.core.windows.net/media"/>
  </settings>
</service>

<service prefix="remote.axd" name="RemoteImageService" type="ImageProcessor.Web.Services.RemoteImageService, ImageProcessor.Web">
  <settings>
    <setting key="MaxBytes" value="4194304"/>
    <setting key="Timeout" value="3000"/>
    <setting key="Protocol" value="http"/>
  </settings>
  <whitelist>
    <add url="https://[bloburl].blob.core.windows.net/" />
    <add url="https://[CMSURL].azurewebsites.net/" />
    <add url="http://localhost" />
    <add url="http://127.0.0.1" />
  </whitelist>
</service>

Urls with accent marks

$
0
0

Hello,

How can I avoid people from creating urls with accent mark?

Thanks!!

Retreive content.picker Name with Custom List View

$
0
0

Hi, we have a joblist doctype. In this type you can choose a location(content.picker). We would like to use a custom List View in umbraco to also show this location on the list. How do we need to configure the template for this location on the custom list view? When we use {{Name}} we get a usb link displayed instead of the Name.

Anyone?

Examine / nuCache / Models

$
0
0

I am working on a v8 site with a very large number (50k+) of articles It's been upgraded from a number of previous CMS versions So I'm starting a big refactor

I'm curious about two questions... 1) To be performant - is it still best to use examine to search the articles or is nuCache equally performant to examine? EG find all articles with a certain tag (or a number of tags) in a tag collection document property

I would never have done this with NodeFactory or similar but how does nuCache compare is that what it is designed for- is it more like old fashioned xslt where the effort is in the query rather than inflating that being queried. Is examine for large data sets still necessary.

2) When rendering the results of the query (imagining say 1000 results and I want to show 50 at a time), what's the most performant way to turn these back into strong models? So in the past I might have passed 50 IDs at a time into an object that returned all the summary properties I need to display. If I just get all the properties is that relatively performant or is the default still fine with relatively larger sets of nodes?

Not really important but I'm also curious if people are generally finding 8 faster / better with large sets of articles.

Factory returned model of type which does not implement IPublishedContent.

$
0
0

I am not able to save any of my content page and hence not able to publish them (refer the attached image).

Things which I have tried so far:

  1. Changing "Umbraco.ModelsBuilder.ModelsMode" to Dll, LiveDll and PureLive.
  2. Cleared nu cache.

This issue have appeared before in my project, but at that time I changed the mode to live which allowed me to save & publish the content, then switching back to Dll solved it. But this time, I have tried every combination but still not able to solve it.

enter image description here


Umbraco & PIM systems recommendations

$
0
0

Hi,

I'm looking for a Product Information Management (PIM) system that plays nicely with Umbraco.

I have multiple brand websites each with its own Umbraco but I want one central PIM to hold all the product info and feed to each website (any one product is advertised on multiple websites but the content differs for each brand website).

In an ideal scenario Umbraco would be used for my non-product related content but I also want to use a PIM to manage product info and directly expose the PIM content to front-end/websites without the need to maintain the product content in Umbraco as well.

Does anyone have any recommendations of PIMs they are using/have used with Umbraco in this way?

Thanks

Models Builder error after generating models

$
0
0

Hi guys. Umbraco v8.4, Models Builder 8.1

I get this error everytime I change some properties, generate models and rebuild the project:

Error   CS1061  'IHtmlString' does not contain a definition for 'GetContentGrid' and no accessible extension method 'GetContentGrid' accepting a first argument of type 'IHtmlString' could be found (are you missing a using directive or an assembly reference?) SimpleArticle.generated.cs

To fix it, I always have to:

  1. Change Models Builder from AppData to PureLive
  2. Exclude the models folder from the project
  3. Rebuild
  4. Start the project
  5. Change back from PureLive to AppData
  6. Generate the models again in Umbraco backoffice
  7. Include the models folder again
  8. Rebuild the project one more time.

...and the error is gone. Until the next time I wanna generate models.

Any idea what might be causing it or where I should look?

Changing Dropdown Prevalues does not update the assigned property values in BO

$
0
0

Hi Guys,

I have a dropdown datatype and this is assigned to a member type property. when I store the data from frontend, I store the Id of the selected prevalue. all works fine, until I change the data type prevalues under settings > data types.

If I do so, in the frontend, the updated prevalue appears, so it seems that the Id matching of the prevalues and stored values is working fine, but in the back office, if I navigate to the member's property, the drop down list is not selected, although it must be selected, since the correct data apears in the frontend. If I change back the prevalue under settings and data type to its initially saved prevalues, it appears again in back office.

I am working with Ids for storing and displaying the values, in order to have the flexibility of changing the prevalues texts in the future, if needed. but it seems to be a bug.

Step 1: enter image description here

Step 2: enter image description here

Step 3: enter image description here

Step 4: enter image description here

Step 5 (Frontend matches the update correctly): enter image description here

Step 6 (backend is not able to match the new prevalue text): enter image description here

Am I doing something wrong or is this a bug?

Dee

Issue with adding new property to an existing document type and put it on top of other properties (in the same tab)

$
0
0

Hi,

As the title, I'm having issue that, here's my code:

protected bool AddPropertyType(IContentType contentType, IDataTypeDefinition dataType, string alias, string name, string description, string TabName, int sortOrder = 0, bool mandatory = false)
{
    if (!contentType.PropertyTypeExists(alias))
    {                
        contentType.AddPropertyType(
            new PropertyType(dataType, alias)
            {
                Name = name,
                Description = description,
                Mandatory = mandatory,
                PropertyEditorAlias = dataType.PropertyEditorAlias,
                SortOrder = sortOrder
            },
            TabName);                
        return true;
    }
    return false;
}

protected void ReOrderPropertyTypes(IContentType contentType, string groupName, string currentPropertyTypeAlias, int currentSortOrder) 
    {
        var group = contentType.PropertyGroups[groupName];
        if(group != null)
        {
            var otherPropertyTypes = group.PropertyTypes.Where(e => e.SortOrder >= currentSortOrder && e.Alias != currentPropertyTypeAlias)
                .OrderBy(e=>e.SortOrder);
            foreach(var item in otherPropertyTypes)
            {
                item.SortOrder = item.SortOrder + 1;                    
            }                
        }
    }

AddPropertyType(abstractOpenGraphContentType, label, "nOTE", "NOTE", "", "OpenGraph", 0))
ReOrderPropertyTypes(abstractOpenGraphContentType, "OpenGraph", "nOTE", 0);

ApplicationContext.Current.Services.ContentTypeService.Save(globalConfigContentType);

The code works well but the backoffice UI didn't work as expected, the new field (named "NOTE") displays in a random position, not on the top of "OpenGraph" tab.

Does anyone have any recommendations to make it work?

Best regards, Nick

Umbraco Doc type grid layout error

$
0
0

Hello i fallow this tutorial in the the umbraco 8 https://papermoon.io/blog/creating-a-slider-in-umbraco/ but i do not know how add the grid to my template

@Html.GetGridHtml(Model, "propertyAlias")

i use this way @Html.GetGridHtml(Model, "propertyAlias") but i get an error Umbraco.Web.Mvc.ModelBindingException: Cannot bind source type Umbraco.Web.PublishedModels.Slider to model type Umbraco.Core.Models.PublishedContent.IPublishedContent.

Help with Linq Join Query

$
0
0

Hello,

I really need some help with this, please.

I have a Model called CategoryMenu. It's a checkbox list which gives an IEnumerable string

I'm using the same DataType but used inside a Portfolio model.

I am now trying to render this in a parial view and need to Join these lists to get the sequence number from the Category menu, but I'm getting errors no matter what I try.

Here are some code snippets...

//IEnumerable list
var categories = Model.PortfolioCategoryMenu.Select((name, i) => new { name, i });

// My portfolio IEnumerable list

foreach (var items in portfolio.PortfolioCategories.Select((name, i) => new { name, i }))
               {
                   var cat = from category in categories 
                             join portfolioName in items on category.name equals portfolioName.name
                             select new { portName = portfolioName, CategoryNumber = category.i };

The errors says, "IEnumerable " does not contain a definition for Join and the best extension method overload requires a receiver of type HtmlHelper

here is the entire partial...

@inherits Umbraco.Web.Mvc.UmbracoViewPage<Home>
@{
    // https://www.tutorialsteacher.com/codeeditor?cid=cs-DoAglF
    // https://www.tutorialsteacher.com/linq/linq-joining-operator-join
    var categories = Model.PortfolioCategoryMenu != null && Model.PortfolioCategoryMenu.Any() ? Model.PortfolioCategoryMenu.Select((name, i) => new { name, i }) : null;
    var portfolioItems = Model.Portfolio != null && Model.Portfolio.Any() ? Model.Portfolio : null;
}
<div id="portfolio" class="section lb">
    <div class="container">
        <div class="section-title text-left">
            <h3>@Model.PortfolioTitle</h3>
            <p>@Model.PortfolioSummary</p>
        </div>
       @if (categories != null)
        {
        <div class="gallery-menu row">
            <div class="col-md-12">
                <div class="button-group filter-button-group text-left">
                    <button class="active" data-filter="*">All</button>
                    @foreach (var item in categories){
                    <button data-filter=".gal_@(item.i)">@item.name</button>
                    }
                </div>
            </div>
        </div>
        }
        <div class="gallery-list row">
       @if (portfolioItems != null)
       {
           foreach (var portfolio in portfolioItems)
           {
               var image = portfolio.PortfolioImage != null ? portfolio.PortfolioImage : null;
               var imageUrl = image != null ? Umbraco.Media(image.Id).Url : string.Empty;

               foreach (var items in portfolio.PortfolioCategories.Select((name, i) => new { name, i }))
               {
                   var cat = from category in categories
                             join portfolioName in items on category.name equals portfolioName.name
                             select new { portName = portfolioName, CategoryNumber = category.i };

               <div class="col-md-4 col-sm-6 gallery-grid @(string.Join("gal_", cat, 0))">
                    <div class="gallery-single fix">
                        <img src="@imageUrl" class="img-fluid" alt="@(image != null ? image.Name : string.Empty)">
                        <div class="img-overlay">
                            <a href="@imageUrl" data-rel="prettyPhoto[gal]" class="hoverbutton global-radius"><i class="fa fa-picture-o"></i></a>
                        </div>
                    </div>
               </div>
               }
           }
       }
        </div>
    </div>
</div>

Really need help on this.

Cheers, Daniel

Extending Umbraco with custom controller and routing

$
0
0

Hello,

When i call a partial it complains the Model isn't IPublishedContent?

But when i tell my custom ViewModel to inherit from IPublishedContent like in the documentation, i get the following error:

Err: 'No parameterless constructor defined for this object.'

How do i fix this so i can use my partials?

Code below:

ViewModel:

public class MainViewModel : ContentModel
{
    //Constructor of MainViewModel
    public MainViewModel(IPublishedContent content) : base(content)
    {
        SiteSettings = new SiteSettingsViewModel();
        BusinessCentersData = new List<BusinessCenterDataViewModel>();
        BusinessCenterData = new BusinessCenterDataViewModel();
        SiteSettings = new SiteSettingsViewModel();
        UmbracoBusinessCenters = new UmbracoBusinessCentersViewModel();
        RawContent = RawContent;
        }

    //Independant View 
    public SiteSettingsViewModel SiteSettings { get; set; }
    public UmbracoBusinessCentersViewModel UmbracoBusinessCenters { get; set; }
    public List<BusinessCenterDataViewModel> BusinessCentersData { get; set; }
    public BusinessCenterDataViewModel BusinessCenterData { get; set; }
    public IPublishedContent RawContent {get; private set; }

    public string siteName { get; set; }
    public dynamic RootNode { get; set; }
}

Controller:

public ActionResult BusinessCenters(MainViewModel model)
    {
        try
        {

            using (var cref = _context.EnsureUmbracoContext())
            {
                //Content Cache
                //var cache = cref.UmbracoContext.Content;
                var cache = cref.UmbracoContext.Content;
                dynamic rootNode = cache.GetAtRoot();
                model.RootNode = rootNode;
                //Call Any Missing Umbraco Content
                IPublishedContent siteSettings = cache.GetSingleByXPath("//siteSettings");
                UmbracoContentBuilderClass siteSettingsModel = new UmbracoContentBuilderClass();
                model.SiteSettings = siteSettingsModel.PopulateSiteSettingsModel(siteSettings);

                IPublishedContent businessCenters = cache.GetSingleByXPath("//businessCenters");
                UmbracoContentBuilderClass businessCentersModel = new UmbracoContentBuilderClass();
                model.UmbracoBusinessCenters = businessCentersModel.PopulateBusinessCentersModel(businessCenters);



            }
                return PartialView("~/Views/thejourney/firstpage.cshtml", model);


        }
        catch (Exception e)
        {
            CustomLogger.Error($"ERROR: BusinessCenterListingsController.BusinessCenters (GET) {e}");
            throw;
        }

Partial:

@inherits UmbracoViewPage<officefreedom.AppCode.ViewModels.MainViewModel>
<div class="upper-nav-container col-xs-12 col-md-12">
@Html.Partial("~/Views/Partials/_Navigation.cshtml", Model.RawContent)


Getting composition information in navigation

$
0
0

Hello,

i have a website that runs with the igloo package. But i have an issue of how to get the composition information in the navigation

i am trying to make a true / false for whether or not to show it as a link to the page. Because some menu parts won't actually need a page behind it.

i am getting the pages like the following: var selection = site.Children().Where(x => x.IsVisible(); and then i foreach through the selection.

For each item in the selection i want to check if the setting withoutLink is available and true. However i don't have any idea how i could get this information from the current item. This setting is created inside a compositions. And the composition is applied to all the document types so that each page has this individual option.

Does anyone has any idea how i could read this information in that foreach statement?

i hope i am clear of what i am trying to do.

Struggling to index PDF using Examine in 6.1.6

$
0
0

Hi all,

Am using Examine to search through 6.1.6 site content, works great.

Now I want to search through media PDF. Added this line to ExamineSettings.config:

<add name="PDFIndexer" type="UmbracoExamine.PDF.PDFIndexer, UmbracoExamine.PDF" extensions=".pdf" umbracoFileProperty="umbracoFile"/>

The result is an error at startup:

Provider must implement the class 'Examine.Providers.BaseSearchProvider'.

It all seems a version conflict to me, but stuck right now. Any ideas?

Thank you

Johan

Custom preview URL

$
0
0

When a user presses the "preview" button, the preview iframe redirects to something like /<nodeId>.aspx?culture=<isoCode>.

Is there any way to intercept/overwrite this url? I would prefer something like /preview/<nodeId>?culture=<isoCode>, or perhaps even use the actual url to the content.

Setup Visual Studio for Existing Umbraco Site from repo on new development machine

$
0
0

I have an umbraco site (v8) developed on another machine, in Visual Studio 2017. On the old machine I have usync & usync content installed.

The site was running fine.

Usync has been used to export the site and everything has been committed to a git repo.

On my new laptop I have cloned the repo so have the code, including usync folder.

I have created a new SQL server database named the same and created a user on that database with the same user.

Web.config connection string is set (local host).

When I CTRL+F5 to run the site from visual studio I get:

Umbraco.Core.Exceptions.BootFailedException: Could not check the upgrade state.

How do I get the site running locally on the new laptop? Do I need to backup / restore the database from my old machine?

I was hoping I could get umbraco running and use usync to get everything back inline?

Upgrade Umbraco in production

$
0
0

Hello guys I am doing my first Umbraco upgrade on production server.

What I did:

I have upgraded localy my Umbraco website via nugget package, after that I run database upgrade localy and than I pushed changes to staging and production server with AzureDevops.

Now I am not sure is that all or I should upgrade production database, Because after deploying changes to staging and production and visiting www.mysite.com/Umbraco it cant see window for database upgrade.

I am confused.

Viewing all 72689 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>