隐藏的HTML code碱基对页面元素部分 [英] Hide parts of html code base on page elements

查看:165
本文介绍了隐藏的HTML code碱基对页面元素部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用CMS有时可以在颈部疼痛,你做一些修改工作,并通过你完成你得到一个警报更新是可用的时候,你更新你的CMS ...和哦野应,所有的努力工作得到的覆盖,你必须从头再来......

Using a CMS sometime can be a pain in the neck, you work on making some modifications and by the time you finish you get an alert Update is Available... you update your CMS... and ohh noo, all your hard work get's override and you have to start all over again...

下面code是,我需要工作的一项: 我需要隐藏此code碱基的某些部分上一些参数

The following code is the one that I need to work on: I need to hide certain parts of this code base on few "parameters"

所以这里是code:

<section class="grid-block" id="content">
<div id="system-message-container">
</div>
<div class="redshop" id="redshopcomponent"><form onsubmit="return CheckCardNumber(this);" enctype="multipart/form-data" id="adminForm" name="adminForm" method="post" action="/component/redshop/checkout.html"><div id="divOnestepCheckout"><table width="100%" cellspacing="2" cellpadding="2" border="0">
<tbody>
<tr>
<td>
<fieldset class="adminform">
<legend>Dirección de Facturación</legend>
<a rel="{handler: 'iframe', size: {x: 800, y: 550}}" href="/store/account_billto.html?tmpl=component&amp;for=true&amp;return=checkout&amp;Itemid=1" class="modal"> Editar</a> <br>Nombre : Tardoss<br>Apellidos : Notengo<br>Dirección : Lejos del Prado #32<br> Código postal : 51000<br>Ciudad : Mexico<br> País : Mexico<br>Provincia : México (Estado de)<br>Teléfono : 5565478963<br>E-mail : 
<script type="text/javascript">
<!--
var prefix = '&amp;#109;a' + 'i&amp;#108;' + '&amp;#116;o';
var path = 'hr' + 'ef' + '=';
var addy80186 = 't&amp;#97;rd&amp;#111;ss' + '&amp;#64;';
addy80186 = addy80186 + 'h&amp;#111;tm&amp;#97;&amp;#105;l' + '&amp;#46;' + 'c&amp;#111;m';
document.write('&lt;a ' + path + '\'' + prefix + ':' + addy80186 + '\'&gt;');
document.write(addy80186);
document.write('&lt;\/a&gt;');
//--&gt;\n </script><a href="mailto:example@hotmail.com">example@hotmail.com</a><script type="text/javascript">
<!--
document.write('&lt;span style=\'display: none;\'&gt;');
//--&gt;
</script><span style="display: none;">Esta dirección de correo electrónico está siendo protegida contra los robots de spam. Necesita tener JavaScript habilitado para poder verlo.
<script type="text/javascript">
<!--
document.write('&lt;/');
document.write('span&gt;');
//--&gt;
</script></span><br>
</fieldset>
</td>
</tr>
<tr>
<td>
<fieldset class="adminform">
<legend>Dirección de envío</legend>
<div><input type="radio" value="2" name="users_info_id" onclick="javascript:onestepCheckoutProcess(this.name,'');">Por defecto (Igual que la de facturación)</div><div><input type="radio" checked="checked" value="3" name="users_info_id" onclick="javascript:onestepCheckoutProcess(this.name,'');">Tardoss Notengos <a rel="{handler: 'iframe', size: {x: 570, y: 470}}" href="/store/addshipping/3.html?tmpl=component&amp;for=true&amp;return=checkout&amp;Itemid=1" class="modal">(Editar)</a> <a title="" href="http://www.forium.mx/index.php?option=c&amp;view=apto&amp;return=checkout&amp;tmpl=coent&amp;task=remove&amp;infoid=3&amp;Itemid=1">(Borrar)</a></div><a rel="{handler: 'iframe', size: {x: 570, y: 470}}" href="/component/redshop/account_shipto/addshipping.html?tmpl=cnt&amp;for=true&amp;return=checkout&amp;Itemid=1&amp;is_company=0" class="modal"> Añadir dirección</a>
</fieldset>
</td>
</tr>
<tr>
<td>
<table border="0">
<tbody>
<tr>
<td><div style="display:none;"><fieldset class="adminform">
<legend><strong>Envase para envío</strong></legend>
<div><input type="radio" value="1" \');'="" onclick="javascript:onestepCheckoutProcess(this.name,\" name="shipping_box_id" id="shipping_box_id1" checked=""><label for="shipping_box_id1">Box1</label><br></div>
</fieldset>
</div></td>
</tr>
<tr>
<td><div id="divShippingRate"><fieldset>
<legend><strong>Métodos de envío</strong></legend>
<div>
<h3>Envios con Bordado</h3>

<div>
<div><input type="radio" onclick="javascript:onestepCheckoutProcess(this.name,'default_shipping');" checked="" value="m8=" name="shipping_rate_id" id="shipping_rate_id_10025_0"><label for="shipping_rate_id_10025_0">De 10 a 15 dias apartir de la autorización</label> ($ 300 )</div>

<div><input type="radio" onclick="javascript:onestepCheckoutProcess(this.name,'default_shipping');" value="8cXI " name="shipping_rate_id" id="shipping_rate_id_10025_1"><label for="shipping_rate_id_10025_1">Envio Express de 3 a 5 dias apartir de la prueba de bordado</label> ($ 500 )</div>

<div><input type="radio" onclick="javascript:onestepCheckoutProcess(this.name,'default_shipping');" value="LA==" name="shipping_rate_id" id="shipping_rate_id_10025_2"><label for="shipping_rate_id_10025_2">Recojer en la tienda</label></div>

</div>

<h3>Envios sin Bordado</h3>

<div>
<div><input type="radio" onclick="javascript:onestepCheckoutProcess(this.name,'shipper');" value="It4g==" name="shipping_rate_id" id="shipping_rate_id_10040_0"><label for="shipping_rate_id_10040_0">De 5 a 15 Dias</label> ($ 300 )</div>

<div><input type="radio" onclick="javascript:onestepCheckoutProcess(this.name,'shipper');" value="JA=" name="shipping_rate_id" id="shipping_rate_id_10040_1"><label for="shipping_rate_id_10040_1">Express de 3 a 5 dias</label> ($ 500 )</div>

</div>

</div>
</fieldset>
</div><div style="display:none" id="divShippingRateTemplateId">354</div></td>
</tr>
<tr>
<td><div id="divPaymentMethod"><fieldset class="adminform">
<legend><strong>Método de pago</strong></legend>
<div></div>
<div>
<div><div class="paymentgtwchecked" id="rs_payment_banktransfer"><input type="radio" onclick="javascript:onestepCheckoutProcess(this.name,'');" checked="" value="rs_payment_banktransfer" id="rs_payment_banktransfer0" name="payment_method_id"><label for="rs_payment_banktransfer0">Forium - Bank Transfer Payment</label></div></div>
<div></div>

<div><div class="" id="rs_payment_paypal"><input type="radio" onclick="javascript:onestepCheckoutProcess(this.name,'');" value="rs_payment_paypal" id="rs_payment_paypal1" name="payment_method_id"><label for="rs_payment_paypal1">Forium - Paypal Payments</label></div></div>
<div></div>

</div>
</fieldset>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="0">
<tbody>
<tr>
<td><div id="divRedshopCart"><h1>Mi carro</h1>
<div class="category_print"></div>
<div class="category_print"></div><div class="category_print"></div><div class="category_print"></div><table cellspacing="0" cellpadding="0" border="0" style="width: 100%;" class="tdborder">
<thead>
<tr>
<th>Nombre de producto</th>
<th></th>
<th>Precio de producto excluido</th>
<th>Cantidad</th>
<th>Precio total excluido precio</th>
</tr>
</thead>
<tbody>
<!--  -->

<tr class="tdborder">
<td>
<div class="cartproducttitle"><div class="product_name"><a href="/store/15/1/playeras-polo/caballero/playeras-polo-combinadas/p530/P-playera-polo-blanca-cuello-mil-rayas.html?Itemid=1">Playera Polo Blanca Cuello Mil Rayas</a></div></div>
<div class="cartproducttitle">$ 191</div>
<div class="cartattribut"><div class="checkout_attribute_static">Atributo(s):</div><div class="checkout_attribute_title">Posición:</div><div class="checkout_attribute_wrapper"><div class="checkout_attribute_price">B. Frente Derecho</div></div><div class="checkout_attribute_wrapper"><div class="checkout_attribute_price">C. Manga Derecha</div></div><div class="checkout_attribute_wrapper"><div class="checkout_attribute_price">F. Espalda Alta</div></div></div>
<div class="cartaccessory"></div>
<div class="cartwrapper"></div>
<div class="cartuserfields"></div>
</td>
<td><div class="product_image">IMAGE.JPG</div></td>
<td>$ 191</td>
<td><label>70</label></td>
<td>$ 13,370</td>
</tr>
<!--  -->

<tr class="tdborder">
<td>
<div class="cartproducttitle"><div class="product_name"><a href="/component/redshop/88/1/tallas/tm-p530-1/P-m.html?Itemid=1">M</a></div></div>
<div class="cartproducttitle">$ 0</div>
<div class="cartattribut"></div>
<div class="cartaccessory"></div>
<div class="cartwrapper"></div>
<div class="cartuserfields"></div>
</td>
<td><div class="product_image">NOIMAGE.JPG</div></td>
<td>$ 0</td>
<td><label>25</label></td>
<td>$ 0</td>
</tr>
<!--  -->

<tr class="tdborder">
<td>
<div class="cartproducttitle"><div class="product_name"><a href="/component/redshop/89/1/tallas/tg-p530-1/P-g.html?Itemid=1">G</a></div></div>
<div class="cartproducttitle">$ 0</div>
<div class="cartattribut"></div>
<div class="cartaccessory"></div>
<div class="cartwrapper"></div>
<div class="cartuserfields"></div>
</td>
<td><div class="product_image">NOIMAGE.JPG</div></td>
<td>$ 0</td>
<td><label>32</label></td>
<td>$ 0</td>
</tr>
<!--  -->
</tbody>
</table>
<table cellspacing="0" cellpadding="0" border="0" style="width: 100%;">
<tbody>
<tr>
<td width="50%" valign="top">
<table border="0">
<tbody>
<tr>
<td colspan="2" class="cart_customer_note">Observaciones del cliente<br><textarea id="customer_note" name="customer_note"></textarea></td>
</tr>
<tr>
<td colspan="2" class="cart_requisition_number">Su referencia de pedido<br><input value="" id="requisition_number" name="requisition_number">
</td>
</tr>
</tbody>
</table>
<br></td>
<td width="50%" valign="top" align="right"><br><br>
<table width="100%" border="0" class="cart_calculations">
<tbody>
<tr class="tdborder">
<td><b>Producto sin IVA Subtotal</b></td>
<td width="100">$ 13,370</td>
</tr>
<!-- -->
<tr>
<td><b>Envío con IVA</b></td>
<td width="100"><span id="spnShippingrate">$ 300</span></td>
</tr>
<!--  -->
<!-- -->
<tr>
<td>
<div class="singleline"><strong>Total:</strong></div>
</td>
<td width="100">
<div class="singleline"><span id="spnTotal">$ 13,670</span></div>
</td>
</tr>
</tbody>
</table>
<div>Recibir ofertas y otros boletines de noticias. <input type="checkbox" ''="" value="1" name="newsletter_signup"></div>
<div></div>
<div><div style="float: right;" id="checkoutfinal"><input type="button" onclick="if(chkvalidaion()){checkout_disable('checkout_final');}" value="Pedido: Paso final" class="greenbutton" name="checkout_final" id="checkout_final"><input type="hidden" value="checkoutfinal" name="task"><input type="hidden" value="checkout" name="view"><input type="hidden" value="com_redshop" name="option"><input type="hidden" value="1" id="onestepItemid" name="Itemid"><input type="hidden" value="3" name="users_info_id"><input type="hidden" value="" name="order_id"></div><input type="button" onclick="javascript:document.location='/component/redshop/1/?Itemid=1'" value="Continar" class="blackbutton"></div>
</td>
</tr>
</tbody>
</table></div><div style="display:none" id="divRedshopCartTemplateId">360</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div><div id="responceonestep" style="display:none"></div></form><script type="text/javascript">
function chkvalidaion() {
if (document.getElementById('termscondition')) {
var termscondition = document.getElementById('termscondition').checked;

if (!termscondition) {
alert("Por favor, seleccione los términos y condiciones como correctos.");
return false;
}
}
return true;
}
function checkout_disable(val) {
document.adminForm.submit();
document.getElementById(val).disabled = true;
var op = document.getElementById(val);
op.setAttribute("style", "opacity:0.3;");

if (op.style.setAttribute) //For IE
op.style.setAttribute("filter", "alpha(opacity=30);");

}
</script></div></section>

这code显示2团体,但只有1需要被显示:

This code display 2 "groups" but only 1 need to be show:

Envios con Bordado
De 10 a 15 dias apartir de la autorización ($ 300 )
Envio Express de 3 a 5 dias apartir de la prueba de bordado ($ 500 )
Recojer en la tienda

Envios sin Bordado
De 5 a 15 Dias ($ 300 )
Express de 3 a 5 dias ($ 500 )

目前,code,我可以工作,使这项工作如下:

now, the code that I can work with to make this work is the following:

<div class="cartattribut">

<div class="checkout_attribute_wrapper">
   <div class="checkout_attribute_price">B. Frente Derecho</div>
</div>

<div class="checkout_attribute_wrapper">
   <div class="checkout_attribute_price">C. Manga Derecha</div>
</div>

<div class="checkout_attribute_wrapper">
   <div class="checkout_attribute_price">F. Espalda Alta</div>
</div>

</div>

<div class="cartaccessory"></div>
<div class="cartwrapper"></div>
<div class="cartuserfields"></div>

如果存在的页面类=checkout_attribute_price 然后隐藏

if class="checkout_attribute_price" exist in the page then hide

Envios sin Bordado
[]De 5 a 15 Dias ($ 300 )
[]Express de 3 a 5 dias ($ 500 )

如果类=checkout_attribute_price不是网页上present 然后隐藏

if class="checkout_attribute_price" is not present on page then hide

Envios con Bordado
[]De 10 a 15 dias apartir de la autorización ($ 300 )
[]Envio Express de 3 a 5 dias apartir de la prueba de bordado ($ 500 )
[]Recojer en la tienda

在code这两个块是:

The code for both blocks is:

<div id="divShippingRate"><fieldset>
<legend><strong>Métodos de envío</strong></legend>
<div>
<h3>Envios con Bordado</h3>

<div>
<div><input type="radio" onclick="javascript:onestepCheckoutProcess(this.name,'default_shipping');" checked="" value="Cs" name="shipping_rate_id" id="shipping_rate_id_10025_0"><label for="shipping_rate_id_10025_0">De 10 a 15 dias apartir de la autorización</label> ($ 300 )</div>

<div><input type="radio" onclick="javascript:onestepCheckoutProcess(this.name,'default_shipping');" value="ss" name="shipping_rate_id" id="shipping_rate_id_10025_1"><label for="shipping_rate_id_10025_1">Envio Express de 3 a 5 dias apartir de la prueba de bordado</label> ($ 500 )</div>

<div><input type="radio" onclick="javascript:onestepCheckoutProcess(this.name,'default_shipping');" value="dd" name="shipping_rate_id" id="shipping_rate_id_10025_2"><label for="shipping_rate_id_10025_2">Recojer en la tienda</label></div>

</div>

<h3>Envios sin Bordado</h3>
<div>
<div><input type="radio" onclick="javascript:onestepCheckoutProcess(this.name,'shipper');" value="ff" name="shipping_rate_id" id="shipping_rate_id_10040_0"><label for="shipping_rate_id_10040_0">De 5 a 15 Dias</label> ($ 300 )</div>
<div><input type="radio" onclick="javascript:onestepCheckoutProcess(this.name,'shipper');" value="gg" name="shipping_rate_id" id="shipping_rate_id_10040_1"><label for="shipping_rate_id_10040_1">Express de 3 a 5 dias</label> ($ 500 )</div>
</div>

</div>
</fieldset>
</div>

我已经做到了这一点使用PHP和改变源$ C ​​$下此CMS大约3个月前,但随后的更新必须这样做,我失去了我所有的变化......然后我一遍做到了。以及上又有更新...所以这一次我想做的事,这不会更改源$ C ​​$ C为CMS ...

I have done this using PHP and changing the source code for this CMS about 3 months ago, but then an update had to be done and I lost all my changes... then I did it all over again.. and again another update... so this time I wanna do it without changing the source code for the cms...

正如我以前说过我知道的,veerrryyy一点关于Java的,任何帮助将是巨大的AP preciated。

As I have said before I know very, veerrryyy little about java, any help will be great appreciated.

感谢你。

推荐答案

您永远不应该砍CMS或事实上任何开源$ C ​​$ C。您应该有助于它们或覆盖它们。

You should never hack CMS or in fact any open source code. You should either contribute them or override them.

  1. 在redSHOP而言,你可以用它的模板系统重写视图和模板文件。您可以按照本指南的http://wiki.redcomponent.com/index.php?title=redSHOP:Working_with_redSHOP_Templates
  2. redSHOP也有插件架构改变核心行为,不破坏升级。下面是它的指导 http://wiki.redcomponent.com/index.php ?标题= redSHOP:Product_Plugin
  3. 您可以覆盖的Joomla!使用MVC以下指南 https://docs.joomla.org/How_to_override_the_component_mvc_from_the_Joomla!_core 。请使用 https://github.com/redCOMPONENT-COM/mvcOverride 版本的MVC覆盖,成为它具有改进原来的插件,同时还支持的Joomla 3.x的
  4. 在本指南将帮助你学习输出覆盖的Joomla是如何工作的
  1. In terms of redSHOP, you can use it's template system to override view and template files. You may follow this guide http://wiki.redcomponent.com/index.php?title=redSHOP:Working_with_redSHOP_Templates
  2. redSHOP also has plugin architecture to change the core behaviour without breaking upgrades. Here is a guide for it http://wiki.redcomponent.com/index.php?title=redSHOP:Product_Plugin
  3. You can override Joomla! MVC using following guide https://docs.joomla.org/How_to_override_the_component_mvc_from_the_Joomla!_core. Please use https://github.com/redCOMPONENT-COM/mvcOverride version of MVC override, as it has improvements in original plugin and also support joomla 3.x
  4. This guide will help you to learn how output overrides work in joomla
    • https://docs.joomla.org/Understanding_Output_Overrides
    • https://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core
    • https://docs.joomla.org/Layout_Overrides_in_Joomla

这篇关于隐藏的HTML code碱基对页面元素部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆