Willkommen, Gast
Angemeldet bleiben:

THEMA:

Hide Div 6 Monate 1 Woche her #244746

  • Autor
  • mrperfectpz
  • Offline
  • Gold Breezer
  • Gold Breezer
  • Beiträge: 367
  • Dank erhalten: 0
I would like to hide a div baseed on an if statement, however everything is inside a div.

I need to hide each label div based on if statement for each
{$items["header"]["value"]  = '<div style="display: table;background-color: #fa8201;  height: 35px; color: #ffffff;">

         <div style="display: table-cell;  font-family: Arial;font-size:14px;padding-bottom: 10px;padding-top: 7px;border: 5px solid transparent;min-width: 10px;">P</div>

         <div style="display: table-cell;  font-family: Arial;font-size:14px;border: 5px solid transparent;min-width: 310px;">TEAM NAME</div>

         <div style="display: table-cell;  font-family: Arial;font-size:14px;border: 5px solid transparent;min-width: 200px;">OWNER</div>

  
                     
<div style="display: table-cell;  font-family: Arial;font-size:14px;border: 5px solid transparent;min-width: 10px;";>' .$label1 .'</div>
<div style="display: table-cell;  font-family: Arial;font-size:14px;border: 5px solid transparent;min-width: 30px;">' .$label2 .'</div>
   
<div style="display: table-cell;  font-family: Arial;font-size:14px;border: 5px solid transparent;min-width: 20px;">' .$label3 .'</div>
<div  style="display: table-cell;  font-family: Arial;font-size:14px;border: 5px solid transparent;min-width: 30px;">' .$label4 .'</div>

<div if  style="display: table-cell;  font-family: Arial;font-size:14px;border: 5px solid transparent;min-width: 10px;">' .$label5 .'</div>
<div if  style="display: table-cell;  font-family: Arial;font-size:14px;border: 5px solid transparent;min-width: 30px;">' .$label6 .'</div>




<div if  style="display: table-cell;  font-family: Arial;font-size:14px;border: 5px solid transparent;min-width: 10px;">' .$label7 .'</div>
<div if  style="display: table-cell;  font-family: Arial;font-size:14px;border: 5px solid transparent;min-width: 30px;">' .$label8 .'</div>



<div style="display: table-cell;  font-family: Arial;font-size:14px;border: 5px solid transparent;min-width: 50px;">TOTAL</div>

         </div>';

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Hide Div 6 Monate 1 Woche her #244782

  • TheMuffinMans Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Beiträge: 10064
  • Karma: 167
  • Dank erhalten: 807
@Tihana

He has a custom setup to display cross-form values. The regular filter mechanisms wouldn't work here, that's why he asks for this.

@mrperfectpz

It would look something like this
{$items["header"]["value"]  = '<div style="display: table;background-color: #fa8201;  height: 35px; color: #ffffff;">;


if($statement){ // assuming if $statement is true and the below is what you actually mean by a label
{

$items["header"]["value"]  .= '<div style="display: table-cell;  font-family: Arial;font-size:14px;padding-bottom: 10px;padding-top: 7px;border: 5px solid transparent;min-width: 10px;">P</div>';
}

// continue like this with the rest


$items["header"]["value"]  .=  '</div>';

Regards,
Markus

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Hide Div (solved) 6 Monate 1 Woche her #244800

  • Autor
  • mrperfectpz
  • Offline
  • Gold Breezer
  • Gold Breezer
  • Beiträge: 367
  • Dank erhalten: 0
Hi Markus

Thanks for your reply on this but that doesnt seem to work yet. I only need to skip certain divs inside the overall div as your can see
{$items["header"]["value"]  = '<div style="display: table;background-color: #fa8201;  height: 35px; color: #ffffff;">

         <div style="display: table-cell;  font-family: Arial;font-size:14px;padding-bottom: 10px;padding-top: 7px;border: 5px solid transparent;min-width: 10px;">P</div>

         <div style="display: table-cell;  font-family: Arial;font-size:14px;border: 5px solid transparent;min-width: 310px;">TEAM NAME</div>

         <div style="display: table-cell;  font-family: Arial;font-size:14px;border: 5px solid transparent;min-width: 200px;">OWNER</div>;

  
if ($label1 >"") {$items["header"]["value"]  .= '<div style= "display: table-cell;  font-family: Arial;font-size:14px;border: 5px solid transparent;min-width: 10px;";>' .$label1 .'</div>';}
if ($label2 >"") {$items["header"]["value"]  .= '<div style="display: table-cell;  font-family: Arial;font-size:14px;border: 5px solid transparent;min-width: 30px;">' .$label2 .'</div>';}
   
if ($label3 >"") {$items["header"]["value"]  .= '<div style="display: table-cell;  font-family: Arial;font-size:14px;border: 5px solid transparent;min-width: 20px;">' .$label3 .'</div>';}
if ($label4 >"") {$items["header"]["value"]  .= '<div  style="display: table-cell;  font-family: Arial;font-size:14px;border: 5px solid transparent;min-width: 30px;">' .$label4 .'</div>';}

if ($label5 >"") {$items["header"]["value"]  .= '<div if  style="display: table-cell;  font-family: Arial;font-size:14px;border: 5px solid transparent;min-width: 10px;">' .$label5 .'</div>';}
if ($label6 >"") {$items["header"]["value"]  .= '<div if  style="display: table-cell;  font-family: Arial;font-size:14px;border: 5px solid transparent;min-width: 30px;">' .$label6 .'</div>';}

             <div style="display: table-cell;  font-family: Arial;font-size:14px;border: 5px solid transparent;min-width: 10px;">' .$label7 .'</div>
             <div style="display: table-cell;  font-family: Arial;font-size:14px;border: 5px solid transparent;min-width: 30px;">' .$label8 .'</div>

              <div style="display: table-cell;  font-family: Arial;font-size:14px;border: 5px solid transparent;min-width: 50px;">TOTAL</div>   


</div>';}

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Letzte Änderung: Post by mrperfectpz.

Hide Div 6 Monate 1 Woche her #244805

  • TheMuffinMans Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Beiträge: 10064
  • Karma: 167
  • Dank erhalten: 807
well, you compare mathematically if a label is larger than an empty string:

if ($label3 >"")

this doesn't look right.

are you trying this maybe?

if ($label3 == "")

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Hide Div 6 Monate 1 Woche her #244812

  • Autor
  • mrperfectpz
  • Offline
  • Gold Breezer
  • Gold Breezer
  • Beiträge: 367
  • Dank erhalten: 0
Am I missing something here ?

If I remove the outside div it will work else I get this

"0 - syntax error, unexpected 'style' (T_STRING)"
$items["header"]["value"]  = '<div style="display: table;background-color: #fa8201;  height: 35px; color: #ffffff;">; 


if ($label1 >= "") {$items["header"]["value"]  .= '<div style="display: table-cell;  font-family: Arial;font-size:14px;border: 5px solid transparent;min-width: 10px;">' .$label1 .'</div>';}
if ($label2 >= "") {$items["header"]["value"]  .= '<div style="display: table-cell;  font-family: Arial;font-size:14px;border: 5px solid transparent;min-width: 30px;">' .$label2 .'</div>';}
   
if ($label3 >= "") {$items["header"]["value"]  .= '<div style="display: table-cell;  font-family: Arial;font-size:14px;border: 5px solid transparent;min-width: 20px;">' .$label3 .'</div>';}
if ($label4 >= "") {$items["header"]["value"]  .= '<div style="display: table-cell;  font-family: Arial;font-size:14px;border: 5px solid transparent;min-width: 30px;">' .$label4 .'</div>';}

if ($label5 >= "") {$items["header"]["value"]  .= '<div style="display: table-cell;  font-family: Arial;font-size:14px;border: 5px solid transparent;min-width: 10px;">' .$label5 .'</div>';}
if ($label6 >= "") {$items["header"]["value"]  .= '<div style="display: table-cell;  font-family: Arial;font-size:14px;border: 5px solid transparent;min-width: 30px;">' .$label6 .'</div>';}

$items["header"]["value"]  .= '<div style= "display: table-cell;  font-family: Arial;font-size:14px;border: 5px solid transparent;min-width: 10px;">' .$label7 .'</div>';
$items["header"]["value"]  .= '<div style= "display: table-cell;  font-family: Arial;font-size:14px;border: 5px solid transparent;min-width: 30px;">' .$label8 .'</div>';
$items["header"]["value"]  .= '<div style= "display: table-cell;  font-family: Arial;font-size:14px;border: 5px solid transparent;min-width: 50px;">TOTAL</div>';



</div>';}

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Letzte Änderung: Post by mrperfectpz.

Hide Div 6 Monate 1 Woche her #244868

  • TheMuffinMans Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Beiträge: 10064
  • Karma: 167
  • Dank erhalten: 807
You probably didn't close the string with a quote when you removed it.

A little tip to make your life easier: get yourself a PHP editor with syntax check.
Then edit your editable code there, it will show you what went wrong and at what line number.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

  • Seite:
  • 1
  • 2
Moderatoren: ForumSupport
Ladezeit der Seite: 0.055 Sekunden

Angebot

Sommer Special! Alle Mitgliedschaften zum Sonderpreis!

Prio Support, alle Extensions und alle Templates in einem Paket.

Hier geht's zur Bestellung

Crosstec hilft sparen!

Falls Sie neu bei Crosstec sind aber bereits einen Formulargenerator bei einem anderen Hersteller gekauft haben, dann bekommen sie von uns einen Rabatt von 25% auf unsere 1-Jahres und Pro-Mitgliedschaften

Wie Sie an den Rabatt kommen?

Schreiben Sie uns einfach eine kurze Email mit beigelegten Kaufbeleg (z.B. PayPal Quittung) an sales@crosstec.org.

Wir unterstützen die Joomla Community

Crosstec unterstützt weltweit alle offiziellen Joomla! User Groups und Organisatoren von Joomla! Days die bei Joomla.org registriert sind.

Falls das auf dich zutrifft und du eines unserer Produkte brauchst, schreib uns eine kurze Email an info@crosstec.org und du bekommst eine Flatrate-Mitgliedschaft geschenkt!