You have no items in your shopping cart.

Profile: steveembry66@gmail.com

Avatar
Statistics

    Hello again-

    On our website, in the left column, we have a Widget with a slider. I am wanting that same slider widget to appear on our Articles pages (List.cshtml, Search.cshtml, ArticlePost.cshtml).

    On the /ArticleRead/List.cshtml, I tried just adding the same widget reference from the  _ColumnsTwo.cshtml, like this:

    @section left {
        @Html.Action("ArticleGroupNavigation", "ArticleRead",new { currentGroupId = currentGroupId, currentArticleId = currentArticleId })

    @Html.Widget("left_side_column_after")

    }


    But I get an error in log saying:

    c:\inetpub\wwwroot\mysite\Plugins\FoxNetSoft.Articles\Views\ArticleRead\List.cshtml(56): error CS1061: 'System.Web.Mvc.HtmlHelper<FoxNetSoft.Plugin.Misc.Articles.Models.ArticleReadListModel>' does not contain a definition for 'Widget' and no extension method 'Widget' accepting a first argument of type 'System.Web.Mvc.HtmlHelper<FoxNetSoft.Plugin.Misc.Articles.Models.ArticleReadListModel>' could be found (are you missing a using directive or an assembly reference?)


    I am also wanting to add a Jcarousel to my Articles home page (List.cshtml), but it seems like there is currently no support for Widgets on this view.

    Is it possible to add the correct assembly reference or directive to these views?
    If so, can you please explain how?

    Thanks!
    Steve
    9 years ago

    I also changed to show smaller thumbnails and limited the number characters in the plugin configuration, until it was optimal in browsers and mobile devices. If you do visit that other post, click the link in the first post and if you squish your browser into mobile device size, you can see what the list looks like with the changes I posted in the forum.

    9 years ago

    syky27 wrote:

    I am running newest version of nopcommerce I believe that it is 3.40

    https://www.dropbox.com/s/y0ikljir0ryofqq/IMG_0083.png?dl=0

    So, you are saying that I cant get any responsive theme since this version, but the theme I am using looks fine on iPhone.


    The articles plugin inherits whatever theme you have applied, so if it is a responsive theme you are using, the articles will be responsive also. Only the descriptions in List.cshtml and (I think) _ArticlesBlock.cshtml do not format well in mobile devices.

    1 or 2 versions ago (I think 3.2, maybe 3.3) I also needed for the description in the Lists to be styled better for mobile devices:

    http://wwww.foxnetsoft.com/boards/topic/82/help-with-responsive-styling

    Try adjusting the foxnetsoft.articles stylesheet as I did and see if your boss is happier.

    /Plugins/FoxNetSoft.Articles/Styles/styles.css

    Steve


    9 years ago

    I think this is the right solution, but for people with more than 2 stores, you would need to use if/elseif logic, or in the case of more than 5, maybe a case/switch for better readability.

    Maybe at some point, the option for having a separate stylesheet could be added into the plugin configuration as a feature?

    ..this would at least allow for simple design differences to the List.cshtml, Search.cshtml, and ArticlePost.cshtml views for each store. For most users of the plugin, this would be sufficient.

    The "Printer-friendly" version (ArticlePostPrint.cshtml) is different, and already requires manual customization for most people anyway to make it more or less "friendly". (e.g: removing related product-box's and adding their company logo)

    Anyway...we love the plugin and appreciate your continued efforts to provide needed functionality!

    Steve

    9 years ago

    Problem solved. This is the code I used on ArticlePostPrint.cshtml:

    I changed this:

    <link href="/Plugins/FoxNetSoft.Articles/Styles/styles-print.css" rel="stylesheet" type="text/css" />


    ...to this:

    @{
    string currentstore=HttpContext.Current.Request.ServerVariables["HTTP_HOST"];
    string imgsrc="";
    string alttag="";

    if (currentstore == "www.mydomain.com")
    {
    <link href="/Plugins/FoxNetSoft.Articles/Styles/styles-store1-print.css" rel="stylesheet" type="text/css" />
    imgsrc="/content/images/uploaded/store1_logo.jpg";
    alttag="Store 1 Name";
    }
    else
    {
    <link href="/Plugins/FoxNetSoft.Articles/Styles/styles-store2-print.css" rel="stylesheet" type="text/css" />
    imgsrc="/content/images/uploaded/store2_logo.jpg";
    alttag="Store 2 Name";
    }

    }



    Then, below that, I changed this:

    <a href="@Url.RouteUrl("HomePage")" class="logo"><img  alt="Store 1 Name" src="/path/to/my/images/store1_logo.jpg"></a>


    ...to this:

    <a href="@Url.RouteUrl("HomePage")" class="logo"><img  alt="@alttag" src="@imgsrc"></a>

    Works perfectly-

    Steve
    9 years ago

    Actually, only the imgsrc variable I create is the problem, because the error is further down the page, where I call it:

    <a href="@Url.RouteUrl("HomePage")" class="logo"><img  alt="" src="@imgsrc"></a>

    9 years ago

    I forgot about the ArticlePostPrint.cshtml

    I also need for it to have it's own styling, and the second store's logo to appear on it.

    I have written this code for that view, but it is not working:

    @{
    string currentstore=HttpContext.Current.Request.ServerVariables["HTTP_HOST"];


    if (currentstore == "www.mydomain.com")
    {
    <link href="/Plugins/FoxNetSoft.Articles/Styles/styles-print.css" rel="stylesheet" type="text/css" />

    string imgsrc="/content/images/uploaded/store1_Logo_Print_Friendly.jpg";
    }
    else
    {
    <link href="/Plugins/FoxNetSoft.Articles/Styles/styles-NATURALS-print.css" rel="stylesheet" type="text/css" />
    string imgsrc="/content/images/uploaded/store2_Logo_print_friendly.gif";
    }

    }


    But I get this error in log:

    error CS0103: The name 'imgsrc' does not exist in the current context

    I suppose it is because that "imgsrc" string is defined inside of a code block, and it doesn't see it further down the page??

    Can this be done?

    Thanks,
    Steve
    9 years ago

    OK...nevermind....I finally figured out a solution:


    I replaced this line on those two views:

      

      Html.AddCssFileParts("~/Plugins/FoxNetSoft.Articles/Styles/styles.css"); 



    ...with this code:


    string currentstore=HttpContext.Current.Request.ServerVariables["HTTP_HOST"];


    if (currentstore == "www.mydomain.com")
    {
            Html.AddCssFileParts("~/Plugins/FoxNetSoft.Articles/Styles/styles1.css");
    }
    else
    {
            Html.AddCssFileParts("~/Plugins/FoxNetSoft.Articles/Styles/styles2.css");
    }




    9 years ago

    steveembry66@gmail.com wrote:

    Or maybe it is best to just use host headers to determine which stylesheet to use?

    Something like this?

    currentstore = Page.Context.Request.Headers.GetValues("Host");

    if (currentstore == 'OriginalStoreDomainName.com')
    {
            Html.AddCssFileParts("~/Plugins/FoxNetSoft.Articles/Styles/store1-styles.css");
    }
    else
    {
            Html.AddCssFileParts("~/Plugins/FoxNetSoft.Articles/Styles/store2-styles.css");
    }

    Thanks for your help!
    Steve


    I tried this, but it did not work...I got this error in log:

    c:\inetpub\wwwroot\mywebsite\Plugins\FoxNetSoft.Articles\Views\ArticleRead\List.cshtml(11): error CS1012: Too many characters in character literal

    The details for the log entry.Full message:  System.Web.HttpCompileException (0x80004005): c:\inetpub\wwwroot\mywebsite\Plugins\FoxNetSoft.Articles\Views\ArticleRead\List.cshtml(11): error CS1012: Too many characters in character literal at System.Web.Compilation.AssemblyBuilder.Compile() at System.Web.Compilation.BuildProvidersCompiler.PerformBuild() at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound) at System.Web.Compilation.BuildManager.GetCompiledType(VirtualPath virtualPath) at System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext cont
    9 years ago

    Or maybe it is best to just use host headers to determine which stylesheet to use?

    Something like this?

    currentstore = Page.Context.Request.Headers.GetValues("Host");

    if (currentstore == 'OriginalStoreDomainName.com')
    {
            Html.AddCssFileParts("~/Plugins/FoxNetSoft.Articles/Styles/store1-styles.css");
    }
    else
    {
            Html.AddCssFileParts("~/Plugins/FoxNetSoft.Articles/Styles/store2-styles.css");
    }

    Thanks for your help!
    Steve

    9 years ago

    Powered by nopCommerce

    Copyright © 2023 FoxNetSoft. All rights reserved