I'm using the Divi theme along with WC.
I have created 3 product attributes for my tea shop.
I wish to display an image on the front end rather that the name (or label) of the attribute.
For instance, instead of reading Steeping Temperature, I would like to display the image of a thermometer.
I am not a programmer / developper.
Please help
Steph
it is posible to use
after
in css for add an icon to each title of attributes.
#attribute45896{
content:" ";
background-image:url('http://rapido.ir/wp-content/uploads/2017/02/blue.png');
background-size:30px;
background-position:left center;
background-repeat:no-repeat;
padding-left:40px}
<table>
<tbody>
<tr class="alt">
<th id="attribute45896">color:</th>
<td><ul class="jcaa_attr_select jcaa_size_small jcaa_rounded_corners">
<li style="list-style:none;">red
</li>
</ul>
</td>
</tr>
</tbody>
<table>
but woocommerce do not set an auto id or random class to attributes.
Related
I'd like to make certain fields invisible/disappear when remain unfilled.
i.e. Email:
This will result in the email text field not being printed out
Here is an example of how I do that. It's a custom field, on mine, but the logic is the same. The ?has_content piece is what tests for data in the field.
<#if record.custbody_bill_to_email?has_content>
<tr>
<td style="width: 147px;"><span style="font-size:10px;"><strong>Email</strong></span></td>
<td style="width: 175px;"><span style="font-size:11px;">${record.custbody_bill_to_email}</span></td>
</tr>
</#if>
I'm trying to show results in the PDF from the netsuite database, however some results have quotation marks, so the results are incomplete, try adding "? Html" at the end of each variable, but do not It affects the column that I want.
I hope and you can help me, greetings!
Netsuite Advanced PDF template - Freemarker
<table cellmargin="5"><#list results as result><tr>
<td style="width: 150px;">
<#if result.custitem_gg_item_image?length != 0><img src="https://----com${result.custitem_gg_item_image}" style="width: 125px; height: 125px;"/><#else><img src="https:/---.com" style="width: 125px; height: 125px;"/></#if>
</td>
<td><strong style="font-size: 12pt"><u><span>${result.itemid?html}</span></u></strong><br/><br/><strong style="font-size: 10pt"><span>${result.displayname?html}</span></strong><br/><br/>
<#if result.purchasedescription?length != 0><span>${result.purchasedescription?html}</span><#else><span>${result.salesdescription?html}</span></#if></td>
</tr>
</#list>
</table>
Just having a quotation mark in the field values shouldn't cause any issues. Do you also have html in the sales and purchase descriptions? Normally you should not do that -- leave the html for the storedetaileddescription field.
If your issue is actually html in the descriptions then see this answer: Remove HTML tags in Freemarker Template
I'm using scrapy and need to extract "Gray / Gray" using xpath selectors.
Here's the html snippet:
<div class="Vehicle-Overview">
<div class="Txt-YMM">
2006 GMC Sierra 1500
</div>
<div class="Txt-Price">
Price : $8,499
</div>
<table width="100%" border="0" cellpadding="0" cellspacing="0"
class="Table-Specs">
<tr>
<td>
<strong>2006 GMC Sierra 1500 Crew Cab 143.5 WB 4WD
SLE</strong>
<strong class="text-right t-none"></strong>
</td>
</tr>
<tr>
<td>
<strong>Gray / Gray</strong><br />
<strong>209,123
Miles
/ VIN: XXXXXXXXXX
</td>
</tr>
</table>
I'm stuck trying to extract "Gray / Gray" within the "strong" tag. Any help is appreciated.
This XPath will work in Scrapy and also in Google/Firefox Developer's Console:
//div[#class='Vehicle-Overview']/table[#class='Table-Specs']//tr[2]/td[1]/strong[1]/text()
You can use this code in your spider:
color = response.xpath("//div[#class='Vehicle-Overview']/table[#class='Table-Specs']//tr[2]/td[1]/strong[1]/text()").extract_first()
You can use this XPath expression with your sample XML/HTML:
//div[#class='Vehicle-Overview']/table[#class='Table-Specs']/tr[2]/td[1]/strong[1]
A full XPath given the full file mentioned below with respect to a namespace "http://www.w3.org/1999/xhtml" can be
/html/body/div/div/div[#class='content-bg']/div/div/div[#class='Vehicle-Overview']/table[#class='Table-Specs']/tr[2]/td[1]/strong[1]
I have a tableview and I want to show an image in the first column. My problem is I can't sort the column then. My idea is to set text in the column too and hide the text so it is only for the correct sorting set. Is there a way to do that? Or what other solutions are possible for my problem?
I think this is the perfect example what you wants to do.Still let me know if you have any issue.
Check here
I would have a look at TableColumn.setCellValueFactory() and TableColumn.setCellFactory(). The further is used to provide the actual cell value (used for sorting!), the latter is used to provide the rendering.
In other words: If you need the sort order, you must not change the content, but only the Cell rendering. The methods mentioned above let you do exactly this.
Hope that helps ...
You could do it with just CSS using text-indent. You would also need to set the image as a css background. You did not provide an code of your table, but below is some example:
HTML:
<table width="100%" border="1" cellspacing="1" cellpadding="1">
<tr>
<td class="hidetext image">Text 1</td>
<td>Some text to show</td>
</tr>
<tr>
<td class="hidetext image">Text 2</td>
<td>Some text to show</td>
</tr>
<tr>
<td class="hidetext image">Text 3</td>
<td>Some text to show</td>
</tr>
<tr>
<td class="hidetext image">Text 4</td>
<td>Some text to show</td>
</tr>
</table>
CSS:
.hidetext {text-indent:-9000px}
.image {background:url(http://www.madisoncopy.com/images/jpeg.jpg) no-repeat;}
See how in the left column the text does not show (but it is actually there just indented off the screen).
See this fiddle: http://jsfiddle.net/D297P/
When you have multiple pages of data in a Footable, the column width changes as you page through the data, depending on what appears in each column at any given time. This is ugly.
I think my client's request means I will not have responsive tables, but maybe there is way out of this that I don't see.
Footable handles pagination client-side. Technically, it should be possible to "lock" the column width from the first page and force it to remain the same throughout the data. I don't think Footable has this option, though.
$(function () {
$('.footable').footable();
});
This jsfiddle illustrates the issue (the jsFiddle CSS interferes with mine a bit because it has Footable classes, too).
I could specify the width of the columns in % - that seems to work even when column are hidden as the viewport shrinks.
Does anyone have another/better suggestion?
I am not able to reproduce your problem and the jsfiddle is not paging the footable.
Still, I had a similar problem with column width when I generated the table content after an AJAX call. The solution I found was to apply a class to every cell in the nTH column and then define the width = max-width min-width.
I've added a class to your subject header and defined css for this column ...
http://jsfiddle.net/bgil2012/gHsdE/
<table class="footable" data-page-size="5">
<thead>
<tr>
<th data-toggle="true">Product</th>
<th data-hide="phone">Study Id</th>
<th class="study-title" data-hide="phone">Study Title</th>
<th class="column_condition" >Condition</th>
<th>Results</th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td>Tysabri</td>
<td>001-06-NAT</td>
<td class="study-title">ENER-G Tysabri fatigue and cognition</td>
<td class="column_condition" >Multiple Sclerosis</td>
<td>CSR Synopsis</a>
</td>
</tr>
CSS:
.study-title {
max-width: 20px;
min-width: 20px;
width: 20px;
}