This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function init() | |
{ | |
craft()->users->onActivateUser = function(Event $event) { | |
$user = $event->params['user']; | |
// check salesforce for contact with that email address | |
// if exists, get contact ID and save it on user | |
// if doesnt exist create contact and account (using organization name) and save contactID on user | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Craft OAuth by Dukt | |
* | |
* @package Craft OAuth | |
* @author Benjamin David | |
* @copyright Copyright (c) 2014, Dukt | |
* @license https://dukt.net/craft/oauth/docs/license | |
* @link https://dukt.net/craft/oauth/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# for regular fields #} | |
{% if entry.fieldHandle %} | |
{{ entry.fieldHandle}} | |
{% else %} | |
{{ global.fieldHandle}} | |
{% endif %} | |
{# for array fields (entries, assets, etc) #} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% if craft.request.isAjax %} | |
{% set layout = "_ajaxLayout" %} | |
{% else %} | |
{% set layout = "_layout" %} | |
{% endif %} | |
{% extends layout %} | |
{% set limit = 10 %} | |
{% set params = { section: 'news', limit: limit} %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form method="post" action="" accept-charset="UTF-8"> | |
<input type="hidden" name="action" value="entries/saveEntry"> | |
<input type="hidden" name="redirect" value="account/jobs?added={id}"> | |
<input type="hidden" name="sectionId" value="9"> | |
<input type="hidden" name="enabled" value="0"> | |
<div class="form-group"> | |
<label for="title">Job Title</label> | |
<input id="title" type="text" class="form-control" name="title"> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% set workshops = craft.entries.section('workshops').find() %} | |
{% spaceless %} | |
{{ workshops|json_encode }} | |
{% endspaceless %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# | |
normal craft structure menu | |
------------- | |
works well in enough most of the time but limited in that it combines the content sturctures with the menu structures into a single section, making more complex navigations more complicated. | |
#} | |
{% set pages = craft.entries.section('pages') %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% set half = ceil(entry.kickstarter|length/2) %} | |
{% set leftHalf = entry.kickstarter|slice(0,half) %} | |
{% set rightHalf = entry.kickstarter|slice(half) %} | |
<div class="row"> | |
<div class="col-sm-6"> | |
{% for block in leftHalf %} | |
<div class="row"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return array( | |
'devMode' => false, | |
'environmentVariables' => array( | |
'siteUrl' => 'http://economicexperts.eu/' | |
), | |
'.dev' => array( |