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
$type = node_type_load('marketing_tool'); | |
$type->type = 'download_library_item'; | |
$type->old_type = $type->orig_type; // This will be 'example'. | |
node_type_save($type); | |
node_type_update_nodes('marketing_tool', 'download_library_item'); | |
node_types_rebuild(); | |
node_access_rebuild(); |
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 (variable_get('site_default_country') == 'US') { | |
// change weight views for specific country. | |
} |
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
/** | |
* Implements hook_replicate_entity_ENTITY_TYPE(). | |
*/ | |
function replicate_replicate_entity_node(&$entity) { | |
$entity->nid = NULL; | |
$entity->tnid = NULL; | |
$entity->vid = NULL; | |
$entity->created = NULL; | |
$entity->changed = NULL; | |
$entity->path = NULL; |
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
import React from 'react'; | |
export default class DestinationItem extends React.Component { | |
render() { | |
return ( | |
<div> | |
<h2>Travel Destination Title</h2> | |
<div>Travel Destination Description goes here</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
import React from 'react'; | |
import DestinationItem from "./DestinationItem"; | |
export default class DestinationList extends React.Component { | |
render() { | |
return ( | |
<div> | |
<h1>Here are your best Travel Destinations</h1> | |
<DestinationItem/> |
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
import React, { Component } from 'react'; | |
import logo from './logo.svg'; | |
import './App.css'; | |
import DestinationList from "./Components/Destination/DestinationList"; | |
class App extends Component { | |
render() { | |
return ( | |
<div className="App"> | |
<DestinationList/> |
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
constructor() { | |
super(); | |
this.state = { data: null }; | |
this.loadDestinations = this.loadDestinations.bind(this); | |
this.updateData = this.updateData.bind(this); | |
} |
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
const LIST_URL = 'http://td-drupal.local:80/jsonapi/node/destination'; |
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
loadDestinations() { | |
// Fetch Destinations. | |
fetch(LIST_URL, {mode:'cors'}) | |
.then(function (response) { | |
return response.json(); | |
}) | |
.then((data) => this.updateData(data)) | |
.catch(err => console.log('Fetching Destinations Failed', err)); | |
} |
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
updateData(responseData) { | |
this.setState({data: responseData.data}); | |
} |
OlderNewer