This file contains hidden or 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
What you could do is create an entity reference list from a view and populate your widget with the view. | |
Create a new view Untick Create a block and Create a page Then click continue and edit. That should get you to the master view. | |
Click Add to add a new display and choose entity reference. Give your display a easily recognisable name. Add your fields/ filters etc and order them as required. I usually change the items to display under pager to display all items, but I'm not sure how required this is. | |
Under the Format heading beside Format, click settings and set your field(s) that are to be searched when auto-completing. Under the Format heading beside Show, click settings and set your fields to be inline. Save your view. | |
Now head over to edit your entity reference field. Assuming you already have your field pretty much set up the only bit you might need to change is under: Entity selection mode Choose: "Views: Filter by an entity reference view" Assuming your field reference target type and view list ma |
This file contains hidden or 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
<meta name="viewport" content="width=device-width, initial-scale=1"> |
This file contains hidden or 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
$levels_value = variable_get('levels_text', array('value' => '', 'format' => NULL)); | |
$form['levels']['levels_text'] = array( | |
'#type' => 'text_format', | |
'#title' => t('Levels Text'), | |
'#size' => 30, | |
'#required' => FALSE, | |
'#default_value' => $levels_value['value'], |
This file contains hidden or 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 | |
/** | |
* Variables preprocess function for the "page" theming hook. | |
*/ | |
function THEME_NAME_preprocess_page(&$vars) { | |
// Do we have a node? | |
if (isset($vars['node'])) { | |
// Ref suggestions cuz it's stupid long. |
This file contains hidden or 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
$originalDate = "2010-03-21"; | |
$newDate = date("d-m-Y", strtotime($originalDate)); |
This file contains hidden or 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
<img src="<?php | |
$url = file_create_url($node->field_newsletter_cover['und'][0]['uri']); | |
$url = parse_url($url); | |
$path = $url['path']; | |
print $path; ?>"> |
This file contains hidden or 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 | |
$apikey = 'insert_your_api_key_here'; | |
$q = urlencode('Toy Story'); // make sure to url encode an query parameters | |
// construct the query with our apikey and the query we want to make | |
$endpoint = 'http://api.rottentomatoes.com/api/public/v1.0/movies.json?apikey=' . $apikey . '&q=' . $q; | |
// setup curl to make a call to the endpoint | |
$session = curl_init($endpoint); |
This file contains hidden or 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
<div class="featured-video-wrap" style="display:none;"> | |
<div class="close-video">Close</div> | |
<?php if (strpos($video_url, 'vimeo') !== FALSE) { | |
$id = substr($video_url, strrpos($video_url, '/') + 1);?> | |
<iframe src="https://player.vimeo.com/video/<?php print $id; ?>" width="560" height="315" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> | |
<?php } elseif(strpos($video_url, 'watch') !== FALSE) { | |
$id = substr($video_url, strrpos($video_url, '=') + 1);?> | |
<iframe width="560" height="315" src="https://www.youtube.com/embed/<?php print $id; ?>" frameborder="0" allowfullscreen></iframe> | |
<?php } elseif(strpos($video_url, 'youtu.be') !== FALSE) { | |
$id = substr($video_url, strrpos($video_url, '/') + 1);?> |
This file contains hidden or 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
$('.mailchimp-signup-subscribe-form div:first-of-type').contents().filter(function() { | |
return this.nodeType === 3; | |
}).wrap('<p class="description"></p>').end().filter( "br" ).remove(); |
This file contains hidden or 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
drupal_add_js(drupal_get_path('theme', 'YOUR-THEME-NAME-HERE') .'/library/js/mailchimp.js') |