Dim. and electricity not to appear on the contract when 0

isabelle A. shared this question 18 months ago
Answered

Hello

I would like the information about dimension and electricity not to appear on my contract when there is no information. See exemple in lead 11757581

daa5e5c68f22f12dd7d521869c189804

Comments (18)

photo
1

There is a way to do it using some code, but I'm not able to give you the answer. I have my website set up this way. If we don't have dimension, or the entries are "0", that whole section on the website does not display. Someone (Cody) at IO should be able to do this for you pretty quickly. Chad can probably figure it out too. I need to do this to my contract as well. Here's how mine looks on my website4ad50517532d7ad85f54a40dbd56790e

photo
1

This works on the website, but I'm not 100% it will on a contract. UNLESS you put those variables in a container with the class similar to the website. Which could work

photo
1

Wouldn't you just add something like style="~~*rental_dims* is empty~ ~display:none~~;"

I don't know how to say "is empty", so I just wrote that out. I think if that part were correct, this has a chance of working. That's the code I use in my contract to get other sections to not display.

photo
1

You know more than I do. I forgot about that part of the code.

photo
1

I'm really close to getting it! All we need to know is how to write the "empty" part. I put this code in, and it works as expected:


<span style="~~*deliverytype*==Delivery Full Staff~ ~display:none~~;">Item dimensions</span>


All we need to do is edit this part "~~*deliverytype*==Delivery Full Staff~ ~" to say "*rental_dims* is empty"

That must be so easy!

photo
1

I keep coming back to this, trying to figure it out. I think this is closer, but it's not quite right. I'm piecing this together from info Cody has sent me over the years. I have these little bits of code he has sent me, with explanations of what they do. Nothing is a perfect match for this situation though.


<span style="~~empty(*rental_dims*)~display:none~~;">Item dimensions</span>


or this...


<span style="empty(*rental_dims*) display: none;">Item dimensions</span>

photo
photo
1

I give up... Can someone at IO answer this? What is the correct way to write "If the variable *rental_dims* is empty, do not display the word "Dim" on this contract"?

photo
1

We already have developers working on this in another thread...in this case she already has items being hidden in the rental loop so we need some clarification.

photo
1

Chad and I would both like to do this to our contracts as well. We have been trying to figure it out for a couple of days, but we can't quite get it. I really just want the words "Item Dimensions" and Required Space" to not display if there is no information in those fields. I already have my website set up this way (Cody sent me the code for that). I just need the code for the contract template and I can slug it in there.


1f56bbc58baf69cab4c04e0511919f98

photo
photo
1

Are you needing clarification from me ? if so, let me know which one

photo
1

We are waiting on the developers for this

photo
1

I GOT IT!!!


I'll probably butcher explaining but here it goes. At the very least Susan can maybe help add this for Isabella

Use "style="~~:empty(*variable*)~display:none~display:inline~~;" so it will look something like this:


<span style="~~:empty(*rental_ac*)~display:none~display:inline~~;">Elec Required: *rental_ac*</span>


This will hide any <span> that has an empty variable

photo
1

Amazing! Nice work, Chad! I've installed the code on my contract template and it works perfectly.

photo
1

Can someone help me ? I added Chad's code in my contract but added it twice to include dimension as well

So it works this way. If an item has both a dimension and electr. ; it display both

If an item as only dimension; it displays it BUT, if an item has only electricity; it does not display.

See, last item should show: Elec. 1 x 15 amp.....

44bcbf009b669b21dd2ac5a438ee01e6

Here is the code:

<span style="~~empty(*rental_dims*)~display:none~ ~~;"><strong> Dim:</strong> *rental_dims*  <span style="~~empty(*rental_ac*)~display:none~ ~~;"><strong>Elec</strong>: *rental_ac*x 15 amp

photo
1

Your code is incorrect there. You're missing the "display: inline" part

photo
1

I could be wrong but the "display:inline;" may not be necessary with the space between ~ ~. It's that way in a lot of areas but adding the "display:inline;" is a comfort thing for me.

photo
2

I'm 99% sure I tried this and it didn't work until you came up with "display: inline"

photo
photo
1

wait...I believe the developers already added the necessary code...

photo
1

I have reverted it back...see if it's currently working for you...

photo
1

Not working: See now:

9a63457dd72570db5c29d4669cd4cd1d

photo
2

Make sure you're not looking at a signed contract. This won't update if it's been signed.

photo
1

IF the developers haven't fixe it. Here's how the code should look:


<span style="~~empty(*rental_dims*)~display:none~ ~~;"><strong> Dim:</strong> *rental_dims* </span><span style="~~empty(*rental_ac*)~display:none~ ~~;"><strong>Elec</strong>: *rental_ac*x 15 amp</span>


You don't have the </span> so it doesn't know where to stop the code at.

photo
1

I just tested this version and it works perfectly.

photo
photo
1

what lead #?

photo
1

not signed; lead #11950343

photo
1

Try again...let's make sure we have the correct version

photo
1

Getting there. Elec 0 x 15 amp should not show (see in yellow)

fab4c76172fbe6f01dcaeca4007d048e

photo
1

for fun, replace this style="~~*rental_ac*=0~display:none;~display:inline;~~"

My guess is that you're manually adding a "0" in the electric for each rental that doesn't need electricity. Which populates the field and isn't empty. SO replacing the code with this will mean you need to add a ) to everything that doesn't have electric. You can't leave it empty...in the inventory settings.

photo
photo
1

The request for the dimensions...I forgot to even ask about the electric because I was seeing the 15 amps. back the the drawing board.

photo
1

Ok, I got it to work for the elec: as well

photo
1

Here's what it ended up looking like...I failed because I was trying to combine. that doesn't work :)

<div class="divTableRow" id="repeat_start_rentals" style=" ~~empty(*rentalcategoryI)~display:none~ ~~;">

<div class="divTableCell">

*rentalimage* <strong>*rentalname*</strong>  *fullrentaltime*   <span style="~~empty(*rental_dims*)~display:none~ ~~;"><strong> Dim:</strong> *rental_dims*  </span><span style="~~empty(*rental_ac*)~display:none~ ~~;"><strong>Elec</strong>: *rental_ac*x 15 amp *rental_notes*</span></div>

<div class="divTableCell center">

photo
1

My Contrat FR for the quebec location is working now

Can you update the Contrat FR for the Montreal location please ? that one still show the Elect. See lead #11956349

photo
1

Should be fixed there too

photo
1

yes , thank you

Leave a Comment
 
Attach a file