You have no items in your shopping cart.

Saturday, April 20, 2024 1:43:48 PM

General Discussion

Posted: 9 years ago

#475 Quote
Hello-

I am trying to add MedicalWebPage microdata to our articles pages, and wondering how I can edit the body tag on the ArticlePost view. I need to make it look like this:

<body itemscope itemtype="http://schema.org/MedicalWebPage">


I don't see the body tag..the first code after head is @section left, and within it is ArticleGroupNavigation view, but it also has no body tag..I don't understand where it comes from.

Thanks,
Steve

Posted: 9 years ago

#476 Quote

Support

Posted: 9 years ago

#476 Quote
NopCommerce uses
Layout = "~/Views/Shared/_ColumnsTwo.cshtml";

_ColumnsTwo.cshtm uses
Layout = "~/Views/Shared/_Root.cshtml";

_Root.cshtml uses
Layout = "~/Views/Shared/_Root.Head.cshtml";

_Root.Head.cshtml  has
<body>

I you will change _Root.Head.cshtml than you will see new tag on all your page. It's not good.

I recommend you to make copy
_ColumnsTwo.cshtml  => _ColumnsTwoArticle.cshtml
_Root.cshtml  => _RootArticle.cshtml
_Root.Head.cshtml   => _Root.Head.Article.cshtml

in _Root.Head.Article.cshtml add new tag.
and change Layout in new files

Don't forget to change Layout in ArticleTemplate.Default.cshtml
Example
old
    Layout = "~/Views/Shared/_ColumnsTwo.cshtml";
new
    Layout = "~/Views/Shared/_ColumnsTwoArticle.cshtml";

Posted: 9 years ago

#484 Quote
OK, now I understand.
That should work for me. I will try it tonight.

Thank you for the suggestion!

Steve

Posted: 9 years ago

#485 Quote

Support

Posted: 9 years ago

#485 Quote
If you will have the problem write me (send me files). I'll do it.

Posted: 9 years ago

#486 Quote
This worked, however it is causing a problem with my header-menu plugin, and I can't see the reason.

When I change layout on ArticleTemplate.Default.cshtml to this:
 Layout = "~/Views/Shared/_ColumnsTwoArticle.cshtml";


This is how my source looks:

<div class="header-menu">
<input type="hidden" value="false" id="isRtlEnabled" />
<div class="menu-title">
    <span>Menu</span>
</div>
<ul class="top-menu">
     <li>
                <a href="/shoe-insoles-and-arch-supports">Insoles-arch supports</a>
                <div class="plus-button"></div>
                <ul class="sublist">
etc...



When I do not change the layout in ArticleTemplate.Default.cshtml, my source looks like this (and is what I want):

<div class="header-menu">
<input type="hidden" value="false" id="isRtlEnabled" />
<ul class="mega-menu">
   <li><a href="#">Shop</a>
        <div class="dropdown categories fullWidth">
etc......


I think the mega-menu plugin from 7spikes has the problem, but I don't see how to fix it.

Posted: 9 years ago

#487 Quote
further clarification:

on _Root.cshtml, this

<div class="header-menu">
            @Html.Action("TopMenu", "Catalog")
</div>


properly renders the mega-menu plugin.

But on _RootArticle.cshtml, it does not.
My _RootArticle.cshtml is an exact copy of _Root.cshtml, except layout is changed to  _Root.Head.Article.cshtml

Posted: 9 years ago

#488 Quote

Support

Posted: 9 years ago

#488 Quote
Do as it was before. I try tomorrow to do in one cs-html file. We can read controller name and try to load another Layout.

Posted: 9 years ago

#489 Quote

Support

Posted: 9 years ago

#489 Quote
Create/Copy  new file _Root.Head.Article.cshtml

Change
_Root.cshtml
old code
@{
    Layout = "~/Views/Shared/_Root.Head.cshtml";
}

new code
@{
    if (Url.RequestContext.RouteData.Values["controller"].ToString().Equals("articleread", StringComparison.InvariantCultureIgnoreCase) &&
        (Url.RequestContext.RouteData.Values["action"].ToString().Equals("articlepost", StringComparison.InvariantCultureIgnoreCase)
    || Url.RequestContext.RouteData.Values["action"].ToString().Equals("articlepostslug", StringComparison.InvariantCultureIgnoreCase)))

  {
      Layout = "~/Views/Shared/_Root.Head.Article.cshtml";
  }
  else
  {
      Layout = "~/Views/Shared/_Root.Head.cshtml";
  }
}

Posted: 8 years ago

#496 Quote
OK, thank you. This worked!
Now my body tag includes microdata on articles pages only.

I have discovered a problem with the rich text editor in the articles plugin which makes it impossible to mark up the body content with microdata.

All schema item references are automatically removed from the article body content when you click back from source view to normal view.

Example:
I input marked up data like this:

<li><span itemprop="signOrSymptom" itemscope itemtype="http://schema.org/MedicalSymptom">
<span itemprop="name">Well defined, circumscribed lesions varying in size and number</span></li>
<li><span itemprop="name">Pain with direct pressure, particularly in weight bearing areas of the <span itemprop="associatedAnatomy" itemscope itemtype="http://schema.org/AnatomicalStructure">
<span itemprop="name">foot</span></span></span></li>
<li><span itemprop="name">Pinpoint bleeding with debridement</span>
</span></li>


and it changes to this:

<li>Well defined, circumscribed lesions varying in size and number</li>
<li>Pain with direct pressure, particularly in weight bearing areas of the foot</li>
<li>Pinpoint bleeding with debridement</li>


I can copy/paste my marked-up content directly into the record in the database table using SSMS, but when I open the article back up in admin to edit the source, it has just changed again...

Posted: 8 years ago

#497 Quote

Support

Posted: 8 years ago

#497 Quote
Our plugin and NopCommece uses TinyMCE.
Try to add microdata in view source mode.

Posted: 7 years ago

#1775 Quote

NetPotential

Posted: 7 years ago

#1775 Quote
Hi!

Is there a way either to

a) Separate by groups in a list view
or
b) Know which groups an article belongs to (in the _ArticlesBlock)

Thanks!

Posted: 7 years ago

#1776 Quote

Support

Posted: 7 years ago

#1776 Quote
I think I understand you.

1. a) Separate by groups in a list view
Open this URL. This is our test site (for development)
http://demo370.foxnetsoft.com/articles/List/10
You can select one article group and you will see only articles from this group.
You can change the type of list too. One mode - Simple tree, Second mode - each root group has own subtree.

b) Know which groups an article belongs to (in the _ArticlesBlock)
Open this URL
http://demo370.foxnetsoft.com/article/iphone-5c-review

You will see the full group path (Breadcrumb) under the article body.

Posted: 7 years ago

#1777 Quote
NetPotential wrote:
Hi!

Is there a way either to

a) Separate by groups in a list view
or
b) Know which groups an article belongs to (in the _ArticlesBlock)

Thanks!


Yes, you can create separate groups and there will be a list page for each..

This is a link to my articles plugin pages:
http://www.myfootshop.com/Articles/

I have two groups..Knowledgebase and Anatomy...and you can see each subgroup in navigation

When you go to any subgroup, and have breadcrumb enabled, you will see breadcrumb at top of page, which will show you the direct link to the group..
example:
http://www.myfootshop.com/articles/List/10

Posted: 7 years ago

#2813 Quote

NetPotential

Posted: 7 years ago

#2813 Quote
Hi!
Thank you for your reply. What I'm actually trying to achieve is, in a product page, show all the linked articles separated by group. For example:

Group 1

- article
- article
- article

Group 2

- article
- article

I looked into the links you've provided but it's different from what I need, and I've been trying to edit the code but couldn't achieve it.

Thank you!

Posted: 7 years ago

#2814 Quote

Support

Posted: 7 years ago

#2814 Quote
Do you want to see all articles as links in navigation panel?

Open plugin configure page and check "Show articles in Navigation panel"

Posted: 7 years ago

#2815 Quote
NetPotential wrote:
Hi!
Thank you for your reply. What I'm actually trying to achieve is, in a product page, show all the linked articles separated by group. For example:

Group 1

- article
- article
- article

Group 2

- article
- article

I looked into the links you've provided but it's different from what I need, and I've been trying to edit the code but couldn't achieve it.

Thank you!


Do you want it just as you described, with titles only..or do you want the list to include images and descriptions??

Alex, I think he means on the product page (Content_Widget_Article.cshtml) he wants to change the order and layout of the returned articles to be like his example above.

Posted: 7 years ago

#2817 Quote

Support

Posted: 7 years ago

#2817 Quote
Do you want to have a new parameter "Default sort of the list of the articles"?

Powered by nopCommerce

Copyright © 2023 FoxNetSoft. All rights reserved