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
let charts = { | |
curationstate: "Curation State", | |
modellingapproach: "Modelling Approach", | |
organism: "Organism", | |
journal: "Journal" | |
}; | |
// Note: the three equal signs so that null won't be equal to undefined | |
if (charts["curationstate"] === undefined) { | |
// do something |
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
$("#classdemo-about img").click(function(){ | |
//console.log('yes'); | |
$('.btn-primary').attr('href', function() { | |
var vpar = '?vid=1'; | |
if (this.href.indexOf(vpar) == -1) { | |
return this.href + vpar; | |
} | |
}); | |
}) |
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 | |
// Start Session | |
session_start(); | |
// Show banner | |
echo '<b>Session Support Checker</b><hr />'; | |
// Check if the page has been reloaded | |
if(!isset($_GET['reload']) OR $_GET['reload'] != 'true') { | |
// Set the message | |
$_SESSION['MESSAGE'] = 'Session support enabled!<br />'; | |
// Give user link to check |
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
#301 Redirects for .htaccess | |
#Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
#Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
#Redirect an entire site to a sub folder | |
Redirect 301 / http://www.domain.com/subfolder/ |
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 | |
use Drupal\node\Entity\Node; | |
function YOURTHEME_preprocess_page(&$variables) { | |
if (isset($node) && $node instanceof Node) { | |
// Create variable out of the current node type | |
$node_type = $node->getType(); | |
// Remove page title block. | |
if (($node_type == 'you_content_type_system_name') || ($node_type == 'you_other_content_type_system_name')) { | |
unset($variables['page']['content']['YOURTHEME_page_title']); |
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
<rss xmlns:g="http://base.google.com/ns/1.0" version="2.0"> | |
<channel> | |
<title> | |
<![CDATA[ Data feed Title ]]> | |
</title> | |
<link> | |
<![CDATA[ http://www.website.com ]]> | |
</link> | |
<description> | |
<![CDATA[ Data feed description. ]]> |
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
Create a new content based block view - Related Items (or something) add fields to it. We will need to use 2 contextual filters. Id and Has taxonomy term id. | |
Configure Id filter as following: | |
Provide default value: Content ID from URL | |
Under More tab - Check next to Exclude | |
Configure Has taxonomy term id as following: | |
Provide default value: Taxonomy term ID from URL |
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
@if ($products->count()) | |
@foreach($products as $product) | |
<div @if ($loop->name) class="foo-class" @endif> | |
//$loop was auto added ($loop->first, $loop->last, $loop->odd, $loop->even, $loop->interation, $loop->index) | |
somethinh | |
</div> | |
@if ($product->price > 2000) @breake @endif | |
@endforeach | |
@else | |
No products found |