Skip to content

Instantly share code, notes, and snippets.

@danjstern
danjstern / 00 Explanation
Created March 6, 2013 20:26
Add Help Center TOC
This is a quick example of how to insert a Table of Contents compromised of your topics on each page.
This is an interim solution, we have for pending enhancement to allow the "topics" liquid to be used on the layout template. This would allow you to build it into the template.
This solution requires using Javascript to load the content from a separate template
Steps.
1. Create a new template
2. For the new template update the Layout and Page Index as follows
- Replace the entire Layout section of the template with "01 Topic List Template - Layout"
auth1 = "OAuth oauth_version=\"1.0\",oauth_timestamp=%d,oauth_nonce=%s,oauth_signature_method=\"PLAINTEXT\"," % (time.time(), self.__id_generator(10))
authstring = auth1 + "oauth_consumer_key=\"%s\",oauth_token=\"%s\",oauth_signature=\"%s\"" % (self.consumer_key, self.access_token, self.oauth_signature )
headers = {
"Authorization": authstring,
"custom_dexma_partner": company
}
conn = httplib.HTTPSConnection("dexma.desk.com:443")
#-X PUT -d'company="+ params + "
conn.request("PUT", "/api/v1/customers/"+ str(id) + ".json" , "" , headers )
response = conn.getresponse()
@danjstern
danjstern / Regex Example
Created December 4, 2012 02:59
remove text except for code I am looking for
Find
(?s)(.*?)({{system\.snippets\.\w*?}})
Replace with
\2\r