Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Christina 78 posts 257 karma points notactivated
    1 week ago
    Christina
    0

    Portofolio categories not working

    Hi have created portofolio page but my categories aren't working insted of the pageId I get this line 87 sectionPortofolio

    System.Collections.Generic.List`1[Umbraco.Core.Models.IPublishedContent]
    

    /Christina

  • Alex Skrypnyk 4539 posts 16232 karma points MVP 2x admin
    1 week ago
    Alex Skrypnyk
    0

    Hi Christina

    Can you show all the code?

    Alex

  • Christina 78 posts 257 karma points notactivated
    5 days ago
    Christina
    0

    Hi Alex Many Thanks for helping me In Umazel starterkit SectionPortfolio.cshtml @itemCategoriesNoCommas -> error above

        //Get the ids and drop commas - those will be in the class attribute for script to work
                        string itemCategories = item.Categories;
                        string itemCategoriesNoCommas = itemCategories.Replace(" ", "").Replace(",", " "); 
    
       <div class="nf-item @itemCategoriesNoCommas @spacingClass">
                        <div class="item-box">
                            <a href="@item.Url" title="@item.GetPageTitleForMenu()">
                                <img class="item-container" src="@imageThumb" alt="@counter" />
                                <div class="item-mask">
                                    <div class="item-caption">
                                        <h5 class="white">@item.GetPageTitleForMenu()</h5>
    
                                        @if (!currSection.DoNotDisplayCategories && !hideCategories)
                                        {
                                            <p class="white">@categoryNames</p>
                                        }
    
                                    </div>
                                </div>
                            </a>
                        </div>
                    </div>
    

    Helper class portfolio helper

      public IEnumerable<DGenericCategoryItem> GetCategories()
        {
    
            IEnumerable<DGenericCategoryItem> categories = null;
    
            if (_hasCategories)
            {
                //Check if category is contained in at least one portfolio item's picker. If not, don't add to list since it's an empty category.
                categories = _categoryItems.AsEnumerable();
            }
            return (categories);
        }
    
  • Christina 78 posts 257 karma points notactivated
    5 days ago
    Christina
    0

    Hi Again I know whats wrong Its the obsolte MultiNode Picker, when i changed I got this error String "1521" is not a valid udi. line 87 /C

Please Sign in or register to post replies

Write your reply to:

Draft