Copied to clipboard

Flag this post as spam?

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


  • Christina 127 posts 390 karma points notactivated
    Jun 13, 2018 @ 21:04
    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 6175 posts 24186 karma points MVP 8x admin c-trib
    Jun 14, 2018 @ 09:00
    Alex Skrypnyk
    0

    Hi Christina

    Can you show all the code?

    Alex

  • Christina 127 posts 390 karma points notactivated
    Jun 19, 2018 @ 14:02
    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 127 posts 390 karma points notactivated
    Jun 19, 2018 @ 15:34
    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