Attention:

Support Rules and Guidelines
Before you post your support topic, please remember to:
  • Read the support forum rules.
  • Check the wiki and use search to see if your problem can be answered there first.
  • Link your board please, and make sure that the problem on your board is visible to guests or provide a test account.
  • Do not post Board Wrappers and CSS unless requested. With a board link, this is not necessary.
  • Be as descriptive as you can and use as many details as possible when describing your problem.
  • Please briefly mark any links to forums that may not be work-safe.
This will help ensure your support issue will be attended to in a quick and efficient manner.

  Add ReplyNew TopicNew Poll

 empty custom field link color
#
some of my custom fields are links to development/shippers/etc and i was wondering how to change the color of the icon (link) if a custom field is empty? specific to nine fields wrapped in the same div. i was using this but it's obviously not working:

CODE
$('.minipro-dvmt:contains("N/A")').css("color","#f1f1f1");


any help would be much appreciated!

This post has been edited by coop: Nov 14 2017, 05:44 PM
PM
#
No need to use JS here. Just add the profile field include tag to the element as a secondary class (with a prefix), and set the CSS for the class without the tag.

eg:
CODE
<div class="minipro-dvmt isEmpty<% FIELD_1 %>"></div>

.isEmpty { color: #f1f1f1 }


I think the profile fields dump no content if they're not filled, so if they aren't filled, the classname will be .isEmpty, but if they are filled, it'll be .isEmpty{field1 data} and the default color won't apply. Granted, someone could break that by leaving a whitespace at the front of the entry, but that's a quick fix with a stern warning.
PM
#
that's good to know! though the class is a container for all nine divs that are in a table rather than every single field, so it's more like this:

CODE
<div class='minipro-dvmt'>
<table>
<td><div style='margin-top: -3px;'><a href='<!-- |field_14| -->'><span class='ion-ios-laptop'></span></a></div></td>
<td><div style='margin-top: -2px;'><a href='<!-- |field_14| -->'><span class='ion-ios-pulse'></span></a></div></td>
</table>
</div>




PM
#
bumping because i'm still not exactly sure how to apply this
PM
#
Oh, sorry, thought you had.

I'd actually recommend doubling back, and using the include tag as an unrelated attribute.
CODE
<div class='minipro-dvmt' state='<!-- |field_14| -->'>
<table>
<td><div style='margin-top: -3px;'><a href='<!-- |field_14| -->'><span class='ion-ios-laptop'></span></a></div></td>
<td><div style='margin-top: -2px;'><a href='<!-- |field_14| -->'><span class='ion-ios-pulse'></span></a></div></td>
</table>
</div>


And then you can just use regular child selectors

CODE
.minipro-dvmt[state=''] table a {
 color: #f1f1f1;
}
PM
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
Share this topic:
« Next Oldest | General Support | Next Newest »

Options Add ReplyNew TopicNew Poll