MAKALE (KATEGORİ SIRA NUMARASINA GÖRE)

Kategori altına eklenen makaleleri, kategori sıra numarasına göre listeler.

@{
    int card21Col = 3;
    int card21TotalRow = 1;
    int card21CategoryOrderNumber = 2;

    if (Partial.isCategoryOrderNumber(card21CategoryOrderNumber))
    {
        IEnumerable<Post> card21PostsID = Partial.PostsID(card21CategoryOrderNumber, 0, card21Col * card21TotalRow, Partial.Order.ID, true);
        Category categorytitle = Partial.Category(card21CategoryOrderNumber);
        int card21CountID = Convert.ToInt32(Math.Ceiling(card21PostsID.Count() / Convert.ToDouble(card21Col)));
        <div class="container-fluid bg-white p-5">
            <h3 class="text-center">@categorytitle.CategoryTitle.HtmlEncode()</h3>
            <div class="container">
                @for (int componen = 0; componen < card21CountID; componen++)
                {
                    <div class="row">
                        @foreach (Post comPost in card21PostsID.Skip(componen * card21Col).Take(card21Col))
                        {
                            <div class="col-md-@(12 / card21Col)">
                                <div class="card mt-4">
                                    <img class="card-img-top" src="@comPost.PostThumbnail" alt="Card image cap">
                                    <div class="card-body text-center">
                                        <h5 class="card-title">@comPost.PostTitle.HtmlEncode()</h5>
                                        <p class="card-text">@Partial.PostShortContent(comPost.PostID, 170)</p>


                                        <div class="discus-btn text-center">
                                            <a href="@Partial.PostLink(comPost.PostID)" class="btn btn-success">@Partial.Translate("Devami", lang)<i class="fa fa-arrow-circle-right"></i></a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        }
                    </div>
                }
            </div>
        </div>
    }
}

ALT KATEGORİ ( KATEGORİ SIRA NUMARASINA GÖRE )

@{
    int card20Col = 3;
    int card20TotalRow = 1;
    int card20CategoryOrderNumber = 3;

    if (Partial.isCategoryOrderNumber(card20CategoryOrderNumber))
    {
        IEnumerable<Category>
        card20Category = Partial.CategorySubID(card20CategoryOrderNumber);
        Category categoryidno = Partial.Category(card20CategoryOrderNumber);
        int card2Count = Convert.ToInt32(Math.Ceiling(card20Category.Count() / Convert.ToDouble(card20Col)));
        <div class="container-fluid bg-white p-5">
            <h3 class="text-center">@categoryidno.CategoryTitle.HtmlEncode()</h3>
            <div class="container">
                @for (int componen = 0; componen < card20TotalRow; componen++)
                {
                    <div class="row">
                        @foreach (Category comCategory in card20Category.Skip(componen * card20Col).Take(card20Col))
                        {
                            <div class="col-md-@(12 / card20Col)">
                                <div class="card mt-4">
                                    <img class="card-img-top" src="@comCategory.CategoryThumbnail" alt="Card image cap">
                                    <div class="card-body text-center">
                                        <h5 class="card-title">@comCategory.CategoryTitle.HtmlEncode()</h5>
                                        <p class="card-text">@Partial.CategoryShortContent(comCategory.CategoryID, 170)</p>


                                        <div class="discus-btn text-center">
                                            <a href="@Partial.CategoryLink(comCategory.CategoryID)" class="btn btn-success">@Partial.Translate("Devami", lang)<i class="fa fa-arrow-circle-right"></i></a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        }
                    </div>
                }
            </div>
        </div>
    }
}

www.yapraktarim.com.tr