How to remove tabs in NopCommerce 4.40.3 - nopcommerce

How to remove tabs in NopCommerce 4.40.3. I would like to remove these two Tabs below in NopCommerce. There is no CSS where I can display: none;
Product tags
Products specifications
Im using NopCommerce NoSource Code and Noble Theme
Thanks in advance

To modify in theme, you don't need to have the source code. Open Themes > NobleTheme > Views > Product > ProductTemplate.Grouped.cshtml (also in ProductTemplate.Simple.cshtml). Replace the code from line# 105 to 134 by this given code.
<div class="product-details-tabs">
<ul class="nav nav-tabs">
#if (!string.IsNullOrEmpty(Model.FullDescription))
{
<li class="active">#T("products.compare.fulldescription")</li>
}
#*#if (!string.IsNullOrEmpty(#Html.PartialAsync("_ProductTags", Model.ProductTags).ToString()))
{
<li>#T("Products.Tags")</li>
}
#if (!string.IsNullOrEmpty(#Html.PartialAsync("_ProductSpecifications", Model).ToString()))
{
<li>#T("Products.Specs")</li>
}*#
</ul>
<div class="tab-content">
#if (!string.IsNullOrEmpty(Model.FullDescription))
{
<div class="full-description tab-pane fade in active" id="description">
#Html.Raw(Model.FullDescription)
</div>
}
#*<div class="product-tags tab-pane fade" id="tags">
#await Html.PartialAsync("_ProductTags", Model.ProductTags)
</div>
<div class="product-specification fade tab-pane" id="specification">
#await Html.PartialAsync("_ProductSpecifications", Model.ProductSpecificationModel)
</div>*#
</div>
</div>
This will not render HTML code for product tag and specification tabs.

Related

How to target a specific label, and text, and turn it into a button which links to dialing screen on mobile

So I'd like to target a specific label class, and proceeding text, turn it into a button and have it link to dialing screen on mobile.
At the moment I can't even figure out how to target the label.
Tried using
awpcp-subtitle:nth-child(2) {background-color: #d2e03a;
color: white; text-align: center; border-radius: 2px}
.awpcp-subtitle:nth-child(odd) {background-color:
#d2e03a; color: white; text-align: center; border-radius:
2px;}
which just targets 'more information' and 'contact details'. Using 'label' targets every single label on the site.
I have this html:
<div class="awpcp-subtitle">Contact Information</div>
<a href="https://adsler.co.uk/wp-user-test-dashboard-
2/awpcp-reply-to-ad/13/madame-bovary/">Contact
Anonymous</a>
<br/><label>Phone:</label> 7576XXXXXX
<br/><label>Location:</label> London, UK
The label is 'phone' and proceeding text is the phone number, so I'd like to target this please. Turning it into button which links to dialing screen on mobile is a bonus, even if I can target just the label, that would be super.
What I'm trying to do is turn that 'phone' label, together with the text, into a button. I would like this button to link to dialing pad on a mobile phone device. It's a classifieds listing site so I want users to be able to press the button which links to the dialing pad so they can phone up and enquire without having to input the information manually. At the moment I just have a label and number which the user has to copy from the site and paste into dialling pad clipboard.
I would like some css to do all this, failing that some html or how to do it with html. Failing that, just way to to target the label 'phone' and the number after it so I can give them a background colour-one background color, so it looks like a button. Once I have that button look, I can start to figure out how to make it into a link and make it link to dialing pad on phone.
Even some html code which I can just insert into my header.php which does it all. Running WordPress.
More html
div id="main" class="container" role="main">
<div class="row">
<div id="primary" class="col-md-8 mb-xs-24 sidebar-
right">
<article id="post-1189" class="post-1189 page type-page
status-publish hentry">
<header class="entry-header">
<h1 class="entry-title"><span
class="hpt_headertitle">Awpcp Show Ad</span></h1>
</header><!-- .entry-header -->
<div class="entry-content">
<div id="classiwrapper"><ul class="awpcp-classifieds-
menu awpcp-clearfix" data-breakpoints='{"tiny": [0,400],
"small": [400,500]}' data-breakpoints-class-prefix="awpcp-
classifieds-menu">
</ul>
<div id="showawpcpadpage">
<div class="awpcp-title"><a href="https://adsler.co.uk/wp-
user-test-dashboard-2/awpcp-show-ad/13/madame-
bovary/london/uk/books/">Madame Bovary</a></div>.
<br/>
<div class="showawpcpadpage">
<div class="awpcp-ad-primary-image"><a class="awpcp-
listing-primary-image-thickbox-link thickbox thumbnail"
href="https://adsler.co.uk/wp-
content/uploads/awpcp/images/61l8teochll-a0bee4d6-
large.jpg" rel="awpcp-gallery-13"><img
class="thumbshow" src="https://adsler.co.uk/wp-
content/uploads/awpcp/thumbs/61l8teochll-a0bee4d6-
primary.jpg" alt="Thumbnail for the listing's main image"
width="200" height="200"/></a><a class="thickbox
enlarge" href="https://adsler.co.uk/wp-
content/uploads/awpcp/images/61l8teochll-a0bee4d6-
large.jpg">Click to enlarge image.</a></div>
<div class="awpcp-subtitle">Contact Information</div>
<a href="https://adsler.co.uk/wp-user-test-dashboard-
2/awpcp-reply-to-ad/13/madame-bovary/">Contact
Anonymous</a>
<br/><label>Phone:</label> 7576335122
<br/><label>Location:</label> London, UK
</div>
<div class="showawpcpadpage"><label>Price:</label>
<strong>£ 3.00</strong></div>
<div class="fixfloat"></div>
<div class="showawpcpadpage">
<div class="awpcp-subtitle">More Information</div>
This is Gustav Flaubert's most famous novel.
Cheap price.
</div>
<div class="fixfloat"></div>
<div id="displayimagethumbswrapper">
<div id="displayimagethumbs">
<ul>
</ul>
</div>
</div>
<span class="fixfloat"><div class="tw_button
awpcp_tweet_button_div"><a
href="http://twitter.com/share?
url=https%3A%2F%2Fadsler.co.uk%2Fwp-user-test-
dashboard-2%2Fawpcp-show-ad%2F13%2Fmadame-
bovary%2Flondon%2Fuk%2Fbooks%2F&text=
Madame+Bov.
ary" rel="nofollow" class="twitter-share-button"
target="_blank">Tweet This</a></div> <div
class="tw_button awpcp_tweet_button_div"><a
href="http://www.facebook.com/sharer/sharer.php?
u=https%3A%2F%2Fadsler.co.uk%2Fwp-user-test-
dashboard-2%2Fawpcp-show-ad%2F13%2Fmadame-
bovary%2Flondon%2Fuk%2Fbooks%2F" class="facebook-
share-button" title="Share on Facebook" target="_blank">.
</a></div> <a id="flag_ad_link" href="#" data-
ad="13">Flag Ad</a></span>
<a href="https://adsler.co.uk/wp-admin/admin.php?
page=awpcp-panel&action=edit&id=13"
title="Edit Madame Bovary">Edit Ad</a>
</div></div><!--close classiwrapper-->
</div><!-- .entry-content -->
<footer class="entry-footer">
<span class="edit-link"><a class="post-edit-link"
href="https://adsler.co.uk/wp-admin/post.php?
post=1189&action=edit">Edit <span class="screen-
reader-text">"<span class="hpt_headertitle">Awpcp Show
Ad</span>"</span></a></span> </footer><!-- .entry-
footer -->
</article><!-- #post-## -->
</div><!-- #primary -->
<aside id="secondary" class="widget-area col-md-4"
role="complementary">
<div id="text-3" class="widget widget_text">
<div class="textwidget"></div>
</div></aside><!-- #secondary -->
</div>
Adsler.co.uk is the site.
https://adsler.co.uk/wp-user-test-dashboard-2/awpcp-show-ad/13/madame-bovary/london/uk/books/ is an example of the page. Here you can see that 'email' link is clickable amd highlighted as button but 'phone and number isn't.
Any ideas?
Well you can't target plain text without an element container. If you can modify the HTML you should at the very least wrap the text in a span. However, even better would be to wrap each label/content block into a div with a class.
Since all you've shared is a small snippet, I have no way of knowing if this will work but in this example, you can get the "phone" with the nth-of-type selector.
<div class="awpcp-subtitle">Contact Information</div>
<a href="https://adsler.co.uk/wp-user-test-dashboard-
2/awpcp-reply-to-ad/13/madame-bovary/">Contact
Anonymous</a>
<br/><label>Phone:</label> 7576XXXXXX
<br/><label>Location:</label> London, UK
CSS
label:nth-of-type(1){
your styles
}

Need to remove WordPress author box from page

I have made new page template on the following page...
https://www.johnnycassell.com/how-to-get-a-girlfriend
I am getting the author box displayed. can anyone help with how to remove this from being displayed? We mainly want to remove it for security.
I think the code you want to remove lives in the either content.php or single.php or a custom-{slug}.php file you are using for the post. Login as admin to Wordpress, and goto Appearances->Editor. Now edit the file that is in use.
Find the .author-details css class. Just two divs above it is the ... Remove it and everything inside it to remove the author box.
<div class="row">
<div class="col-md-8 col-md-offset-2 col-sm-10 col-sm-offset-1">
<div class="author-details">
<div class="author-image">
<img alt="" src="https://secure.gravatar.com/avatar/03e29f93475b2934e049531cadd2d3ba?s=172&d=mm&r=g" srcset="https://secure.gravatar.com/avatar/03e29f93475b2934e049531cadd2d3ba?s=344&d=mm&r=g 2x" class="avatar avatar-172 photo" height="172" width="172"></div>
<h5>Johnny Cassell</h5>
<ul class="social-icons">
</ul>
</div>
</div>
</div>
try this to add in style.css in your theme
.author-details {
display: none;
}

Error in MVC View at Razor syntax

I have a sidebar item which contains a list of comments. I want this item to show only if there are any available comment in the beginning and in order for my template to work I have to put a different style to the first comment than the rest. All the comments are being passed on my Model.
Here is my approach:
#if(Model.Comments?.Count > 0) {
<div class="sidebar_item">
<div class="item_inner slider">
<h4>See what students say:</h4>
<div id="single_banner">
<ul class="slides">
#for (int i = 0; i < Model.Comments.Count; i++)
{
if (i > 0){
<li style="display:none;">
}
#if( i == 0)
{
<li>
}
#Model.Comments[i].Comment
<div class="carousal_bottom">
<div class="thumb">
<img src="img/courses/testi_thumb.png" draggable="false" alt="" />
</div>
<div class="thumb_title">
<span class="author_name">#Model.Comments[i].Student</span>
</div>
</div>
</li>
}
</ul>
</div><!--end banner-->
</div><!--slider-->
</div><!--end sidebar item-->
}
The problem is that this doesn't work and I get errors that some curly brackets are missing or that some elements haven't closed properly. Any help appreciated.
I get errors that [...] some elements haven't closed properly.
The following code isn't recommended because the engine isn't smart enough to determine start/ends for html elements in c# code:
if (i > 0){
<li style="display:none;">
}
#if( i == 0)
{
<li>
}
So I generally put the logic directly in the tag:
<li style="#(i > 0 ? "display:none;" : string.Empty)">
However I'm not really a fan of logic in my view. Additionally to make things easier IMHO, I would have a comment display template. And I personally think there is no good reason to not use classes. Eventually my code would look like:
controller:
foreach(var comment in Model.Comments)
{
comment.IsVisible = comment == Model.Comments.First();
}
view:
// Update Model with Property
// bool HasComments { get { return Comments.Any(); } }
// Then the code actually reads/documents itself
#if(Model.HasComments) {
<div class="sidebar_item">
<div class="item_inner slider">
<h4>See what students say:</h4>
<div id="single_banner">
<ul class="slides">
#Html.DisplayFor(m => m.Comments);
</ul>
</div><!--end banner-->
</div><!--slider-->
</div><!--end sidebar item-->
}
displaytemplates/comments.cshtml
#{
// View logic, it only deals with html/css/javascript
var liClass = model.IsVisible ? string.Empty : "is-not-visible";
}
<li class="#liClass">
#Model.Comments[i].Comment
<div class="carousal_bottom">
<div class="thumb">
<img src="img/courses/testi_thumb.png" draggable="false" alt="" />
</div>
<div class="thumb_title">
<span class="author_name">#Model.Student</span>
</div>
</div>
</li>
Less code and more encapsulated.
I'd also recommend reading Philip Walton - Decoupling Your HTML, CSS, and JavaScript

On-demand hide or show block in responsive view with CSS

I have always found replies to my questions here even before I asked them. Right now I am facing a problem regarding the responsive adaption of a site I created (www.cichlidae.com) that led me to post this question after several years of just reading.
In my site, when a break-point is reached, a left side menu bar seen in all pages hides. I would like this bar to be displayed over the content on demand, when a mobile device is used. I was able to make the top menu bar adapt responsively to display and the #bar to hide.
For trying to display the left bar menu (with a div labelled “bar”) I used the following CSS code:
#bar {
display:none;
}
#bar ~ .display_bar:focus {
display:block;
}
I set #bar first as that is the order in which the code for #bar loads once the page is loaded (I tried .display_bar:focus ~#bar as well). I created an icon displayed in mobile view to activate the display switch:
<div class=\"display_bar\">Some graphic</div>
I have tried all combinations and browsers, validated CSS and HTML, but the bar just won’t show when the icon is clicked on. I have tried with a single <p> tag with a class name instead of #bar but it ignores it as well. One of the example of pages could be seen in the URL:
http://www.cichlidae.com/index_catalog.php
What could I be doing wrong? I need the left bar to show on demand when in mobile view, preferably just with CSS. Thanks so much for any help you could provide me.
The relevant HTML code follows:
<!DOCTYPE html>
<html lang="en">
<head>
<title>All cichlid species - Cichlid ..</title>
<link rel="stylesheet" type="text/css" href="design/styles/indexstyle.css" title="Cichlid ...">
...
</head>
<body>
<!-- left frame -->
<div id="bar">
<img src="design/graphics/logos/logo_menu.jpg" width="200" height="165" alt="Cichlid Room Companion"><br><br>
...
<div style="padding-left:10px;">
<h3>Catalog</h3>
Classification<br>
....
</div>
</div>
<!-- right frame -->
<div id="main">
<div id="canvas" style="max-width:800px">
<!-- Menu bar -->
<ul id="menu" class="r-hide">
<li>Home
<div class="dropdown_3columns">
<h2>Welcome ...</h2>
</div>
</li>
</ul>
<div class="r-only">
<div id="r-navigation-menu">
<input type="checkbox" id="r-navigation-button">
<ul class="r-menu-items">
<h2>News</h2>
<li>What's new</li>
....
</ul>
<label for="r-navigation-button" id="r-navigation-label">
<div class="r-drop-icon">
<img src="design/graphics/icons/menu-hamburger.png" class="icon" width="32" height="32" alt="">
...
</div>
</label>
</div>
<div class="display_bar" tabindex="-1"><img src="design/graphics/icons/menu-collapse.png" class="icon" width="32" height="32" alt=""></div>
</div>

D3 Elements are invisible despite existing in DOM

I have a bootstrap tab panel and I want to display a different d3 chart for each tab.
When the document loads, the first D3 chart is present in the DOM but its elements are invisible. Here's an example: http://i.imgur.com/7ATTyhI.png
Here is the setup for my tab pane in bootstrap:
<div role="tabpanel">
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"><a href="#ghg-co2" aria-controls="ghg-co2" role="tab" data-toggle="tab">
<h4>Change in CO<sub>2</sub></h4></a>
</li>
<li role="presentation"><a href="#ghg-ch4" aria-controls="ghg-ch4" role="tab" data-toggle="tab">
<h4>Change in CH4 (Methane)</h4></a>
</li>
<li role="presentation"><a href="#ghg-nos" aria-controls="ghg-nos" role="tab" data-toggle="tab">
<h4>Change in Nitrous Oxide</h4></a>
</li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<script src="js/ghg.js"></script>
<div role="tabpanel" class="tab-pane active fade fade-in" id="ghg-co2">
<div id="chart-ghg-co2" class="d3-chart"></div>
</div>
<div role="tabpanel" class="tab-pane fade fade-in" id="ghg-ch4">
<div id="chart-ghg-ch4" class="d3-chart"></div>
</div>
<div role="tabpanel" class="tab-pane fade fade-in" id="ghg-nos">
<div id="chart-ghg-nos" class="d3-chart"></div>
</div>
</div>
</div>
I have had issues with bootstrap displaying content in the tab pane correctly. I am using this hack in my style.css to override some bootstrap properties:
/* bootstrap hack: fix content width inside hidden tabs */
.tab-content > .tab-pane,
.pill-content > .pill-pane {
display: block; /* undo display:none */
height: 0; /* height:0 is also invisible */
overflow-y: hidden; /* no-overflow */
}
.tab-content > .active,
.pill-content > .active {
height: auto; /* let the content decide it */
} /* bootstrap hack end */
I got it from this thread
My D3 function is almost identical to this example: d3 scatterplot
but with different data.
At the bottom of my HTML, I have:
<script>
// Check if DOM is ready for D3
$( document ).ready(ghgco2()); // Names of my three D3 chart functions
$( document ).ready(ghgch4());
$( document ).ready(ghgnos());
</script>
I suspect the problem is that my d3 function, ghgco2() is attempting to render before the div in which it resides, .chart-ghg-co2 is ready. For some reason, the svg has the correct dimensions, and the elements are all present, but it's completely blank. This is resolved when I switch between tabs on the bootstrap pane.
Any and all help is appreciated.

Resources