Close

How can I customize a new page in Pavilion theme

abdulwahe
6 years ago
#13998 Quote
Avatar
  • 10
I want to add a page where I can list my Black Friday products. Is this something I can have? I want to list my Black Friday products just like I have listed products on homepage Smart Product Collection.

I tried doing this by Custom Product Collection in Smart Product Collection plugin but it asks for Widget Zone which I don't know from where to get this? I know, I can add additional Widget Zones by editing SupportedWidgetZones.xml inside Smart Product Collection plugin but I don't know what is the widget zone of my new page.

Kindly help me to get this thing done.
abdulwahe
SDobrev
6 years ago
#14000 Quote
Avatar
  • Moderator
  • 283
Hi,

First of all, you should decide where you want to show the collection and then add manually the widget zone in the source code of the page.
Here is the code you can use to add a new widget zone in any of the .cshtml files:
@Html.Widget("your_widget_zone_name")
Best Regards,
Stoyan Dobrev
Nop-Templates.com
abdulwahe
6 years ago
#14001 Quote
Avatar
  • 10
I want to show the collection on a new page e.g. Black-Friday.cshtml. Can I create a new page from admin area which gives me the access to .cshtml page?

My requirement is to have a new page and show products on it through Smart Product Collection. Just like I used collection on my home page.

https://www.onlineoutlet.pk
abdulwahe
SDobrev
6 years ago
#14005 Quote
Avatar
  • Moderator
  • 283
Hi,

You can create a new page from the admin area. However, you can create a new topic. Find the TopicDetails.cshtml file and add the widget zone for the smart product collections where you want to see it.

Use the Topic System Name in the conditional statement. This is necessary because you want to show the collection only "Black Friday" topic.

    @if(Model.SystemName.Equals("TopicSystemName"))
    {
        @Html.Widget("WidgetZoneName")
    }
Best Regards,
Stoyan Dobrev
Nop-Templates.com
abdulwahe
6 years ago
#14014 Quote
Avatar
  • 10
Can you please tell me the exact area where I can place this 'if clause'. I tried placing it after the script tags and also at the end of the page but it has not shown me my Custom Product Collection.


@model TopicModel
@using Nop.Core.Domain.Seo
@using Nop.Core.Infrastructure
@using Nop.Web.Models.Topics;
@{
    var isPopup = ViewBag.IsPopup;
    if (isPopup == null || isPopup == false)
    {
        Layout = "~/Views/Shared/_ColumnsOne.cshtml";
    }

    if (!Model.IsPasswordProtected)
    {
        //title
        Html.AddTitleParts(!String.IsNullOrEmpty(Model.MetaTitle) ? Model.MetaTitle : Model.Title);
        //meta
        Html.AddMetaDescriptionParts(Model.MetaDescription);
        Html.AddMetaKeywordParts(Model.MetaKeywords);
    }

    var canonicalUrlsEnabled = EngineContext.Current.Resolve<SeoSettings>().CanonicalUrlsEnabled;
    if (canonicalUrlsEnabled)
    {
        var topicUrl = Url.RouteUrl("Topic", new { SeName = Model.SeName }, this.Request.Url.Scheme);
        Html.AddCanonicalUrlParts(topicUrl);
    }

    //page class
    Html.AppendPageCssClassParts("html-topic-page");

}
@if (Model.IsPasswordProtected)
{
    <script type="text/javascript">
        $(document).ready(function () {
            $('#button-password').click(function () {
                var postData = {
                    id: $("#@Html.FieldIdFor(model => model.Id)").val(),
                    password: $('#password').val()
                };
                addAntiForgeryToken(postData);


                $.ajax({
                    cache: false,
                    type: 'POST',
                    url: '@Url.RouteUrl("TopicAuthenticate")',
                    data: postData,
                    dataType: 'json',
                    success: function (data) {
                        if (data.Authenticated) {
                            $('#ph-topic #ph-title h1').html(data.Title);
                            if ($('#ph-topic #ph-title h1').text().length == 0) {
                                $('#ph-title').hide();
                            }
                            $('#ph-topic .page-body').html(data.Body);
                            $('#ph-password').hide();
                            $('#ph-topic').show();
                        }
                        else {
                            $('#password-error').text(data.Error).fadeIn("slow");
                            $('#ph-password #password').select().focus();
                        }
                    }
                });
                return false;
            });
        });

        $(document).ready(function () {
            $('#ph-topic').hide();
            $('#ph-password #password').select().focus();
        });
    </script>

    <div class="topic-password" id="ph-password">
        @using (Html.BeginRouteForm("TopicAuthenticate"))
        {
            @Html.AntiForgeryToken()
            @Html.HiddenFor(model => model.Id)
            <div class="enter-password-title">
                @T("Topic.EnterPassword")
            </div>
            <div class="enter-password-form">
                @Html.Password("password")
                <input type="submit" id="button-password" value="@T("Topic.Button")" class="button-1 topic-password-button" />
            </div>
            <div class="password-error" id="password-error" style="display: none;"></div>

        }

    </div>
}
<div class="page topic-page" id="ph-topic">
    <div class="page-title" id="ph-title">
        <h1>@Model.Title</h1>
    </div>
    <div class="page-body">
        @Html.Raw(Model.Body)
    </div>
</div>

@if(Model.SystemName.Equals("black-friday1"))
    {
        @Html.Widget("BlackFridayWidgetZone")
    }

======
After making my Topic changes I have to create a Custom Product Collection and configure it to be shown on 'BlackFridayWidgetZone' right? Will it be able to iden
abdulwahe
SDobrev
6 years ago
#14015 Quote
Avatar
  • Moderator
  • 283
Hi,

Please submit a ticket with FTP and admin access to your site so we can check what is wrong.
Best Regards,
Stoyan Dobrev
Nop-Templates.com