![]() |
Quote:
Thank you :) |
In vBulletin 4.2.1 - <vb:if> conditionals with this - how do we handle that syntax?
We have alot of custom fields in postbit, and they have IF conditionals, but if the field isn't filled in by the user the box still shows, but is empty. See screenies: When the user leaves the custom fields blank: https://vborg.vbsupport.ru/external/2014/06/5.jpg When he does not: https://vborg.vbsupport.ru/external/2014/06/6.jpg Here is the entire postbit_legacy code: PHP Code:
When i try to put the DIVs inside the IFs, it breaks the template. |
There is a conditional for custom fields that you should wrap around each div element which contains a custom field.
Try Code:
<vb:if condition="$post['field5']"></vb:if> So for example IF the join date was a custom field, your code would look as follows: Code:
<vb:if condition="$post['field5']"> PS - Mark as installed! :) |
Quote:
Wait. I am not clear on the bolded. What does this mean? |
The code in your example shows that you didn't use the code exactly as provided.
You have the vb:if conditionals inside the div containers, it should be the other way around, you should have the div containers inside the if conditionals. That way the div only displays if the conditional is true. Check my example above again to see what I mean. Your divs need to be INSIDE your conditionals, not vice versa. For example where you have: Code:
<div class="postbitboxes"><vb:if condition="$post['field14']"><dt>Ideology</dt> <dd>{vb:raw post.field14}</dd></vb:if></div> Code:
<vb:if condition="$post['field14']"><div class="postbitboxes"><dt>Ideology</dt> <dd>{vb:raw post.field14}</dd></div></vb:if> |
Quote:
|
Quote:
Code:
{vb:raw template_hook.postbit_start} |
The code you provided me in your example was incorrect, my response was based on the code errors i saw in what you showed. So if your reply is "i know", then please provide the broken code so I can have another look.
One of your entries, you had half a div inside an if, and the other half of the div outside the if. Then you had other entries with the entire if is inside the div. You should go back through and try again. Unless the postbit legacy code you provided isn't the actual code that you're using, because what you provided a couple posts back definitely has errors.. The conditionals cannot break the template, all they do is show the div or not show the div, depending on if the user has entered any value. I recommend going through each entry for your custom fields and double check your code making sure it is done exactly as instructed. See post 12 on the previous page |
Quote:
However, only marginally better than i had, as seen in my screengrab in post 12. Here's what we get now using your provided code: https://vborg.vbsupport.ru/external/2014/06/4.jpg A couple of the boxes are still showing when nothing is entered in the custom fields. |
Also, trying to support the rounded corners for safari, using the webkit definition, and having zero luck. Trying it this way:
HTML Code:
{ |
All times are GMT. The time now is 08:17 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|