Skip to content

Instantly share code, notes, and snippets.

View rruhlen's full-sized avatar

Ricky Ruhlen rruhlen

  • San Francisco, CA
View GitHub Profile
@rruhlen
rruhlen / company_theme_hack.txt
Created May 7, 2014 20:29
In the Desk.com company theme, how to hard-code a company custom field of type text but have it display as a custom field of type list. Needed if 100+ values needed for drop-down.
<div class="agent_company_section">
<div class="agent_company_section">
<span class="agent_company_section_label label_custom label_custom_company_status">Parent Company</span>
<div class="agent_company_section_data">
<select class="default custom_field_string " id="company_custom1" maxlength="100" name="company[custom1]">
{% capture current %}
<option>{{company.custom_parent_company}}</option>{% endcapture %} {% capture options %}
<option>Google</option>
@rruhlen
rruhlen / liquid_null_value.txt
Created May 7, 2014 22:13
Liquid to replace value of default item in drop-down with a NULL value. Needed if you want to make the field required with JS.
{{ ticket_custom_hardware_platform_type | replace: 'value="--Select One--"', 'value=""' }}
@rruhlen
rruhlen / textarea.txt
Created May 14, 2014 21:07
hard-coded textarea custom field. Limited to 255 characters until we create a custom field of type textarea.
<div id="topic-details">
<label for="interaction_topic_details">Topic Details <span class="muted">({{system.snippets.required}})</span></label>
<textarea class="input-block-level" id="ticket_custom_key" maxlength="255" name="ticket[custom_key]" cols="6" rows="6">{{ticket.custom_key}}</textarea>
</div>
@rruhlen
rruhlen / multiple_files.txt
Created May 14, 2014 22:51
multiple file attachment for Desk email form.
<div id="max_number_attachments">{{desk.system.max_attachments}}</div>
<div id="system-snippets-add_attachment">{{system.snippets.add_attachment}}</div>
@rruhlen
rruhlen / sso.txt
Last active August 29, 2015 14:01
display a specific topic only when a customer custom field is set with a specific value via the SSO.
{% if topics_count > 0 %}
{% for topic in topics %}
{% if current_user.customer.custom_key == 'True' %}
{% if topic.id == 393291 or topic.id == 546987 %}
div class="desk-topic desk-topic-{{ topic.id }}">
<h3>
<a href='{{ topic.public_articles_url }}'>{{ topic.name }}</a></h3>
<ul>
{% for article in topic.articles limit:5 %}
<li>
@rruhlen
rruhlen / 01 Instructions
Last active August 29, 2015 14:01
v5 responsive theme for the demo account
The latest version of the Desk.com responsive web theme can be found at https://gist.github.com/DeskWOW/6678951
@rruhlen
rruhlen / sso_custom_field.txt
Last active August 29, 2015 14:01
custom email form that detects a value in a customer custom field of the authenticated user and only displays a specific topic.
<div id="desk-external-variables-page_index" class="desk-external-variables">
<div id="system-snippets-just_moderated">{{just_moderated}}</div>
</div>
{% if site.questions_enabled_config %}
<div id="desk-support-index">
{%else%}
<div id="desk-support-index" class="no-qna">
{% endif %}
@rruhlen
rruhlen / linkify.txt
Created June 21, 2014 00:16
how to make links clickable on Desk.com Q&A pages in the new responsive theme.
1. Place Linkify.js file in header section of layout.
<script src="https://desk-customers.s3.amazonaws.com/shared/desk.linkify.js"></script>
2. Place javascript in Q&A Show section of layout.
<script type='text/javascript'>
$(function(){
$(".qna-top p").linkify();
$(".qna-reply p").linkify();
$(".qna-top p a, .qna-reply p a").attr( 'target', '_blank');
@rruhlen
rruhlen / custom_company_field.txt
Created July 3, 2014 21:54
hard-code company custom field on Desk email form.
<div id="company-field">
<label for="company_field">Company</label>
<textarea class="input-block-level" id="customer.company_custom_key" maxlength="255" name="customer.company[custom_key]" cols="6" rows="6">{{customer.company.custom_key}}</textarea>
</div>
@rruhlen
rruhlen / 01 Instructions
Created July 9, 2014 01:18
ConnectMe Office Theme
1. Create a new Template
2. Go the "Advanced Themes"
3. Select "Edit in Source Mode"
4. Replace the "Header" code from the "02 Header" code below.
5. Replace the "Body" code from the "03 Body" code below.