Web Technology Kitchen

Submitted by barnettech on Thu, 09/06/2018 - 14:48

We provide website and other technology services. We'll create new great websites, maintain them, do security for them, and we also do automation and any other workflow you need. Websites, Drupal, Python, C#, Unity, security, automation, APIs, VR/AR, gaming, mobile, responsive design, please be in touch for a consultation at jbarnett@barnettech.com. Feel free to peruse our blog postings below. If you're not a tech, the tech below is open sourced knowledge share and you don't need to read a lick of it, just email us to setup an initial phone consultation and let us take care of you and your tech business needs

Passing variables in lua

Submitted by barnettech on Sat, 07/13/2019 - 22:11

Here is an example of passing variables in lua:

gStateMachine:change('begin-game', {
            level = self.level,
            score = self.score,
            matchispossible = false

then on the receiving end in the BeginGameState.lua

function BeginGameState:enter(def)
    -- grab level # from the def we're passed
    self.level = def.level
    self.score = def.score

Create a bootstrap subtheme in Drupal 8

Submitted by barnettech on Wed, 07/03/2019 - 09:17

composer require drupal/bootstrap

copy the THEMENAME folder in the bootstrap starterkit folder to your themes/custom directory

Change all the filenames in the newly created directory

Create a yournewthemename.info.yml file (see the attached example file)

Make sure content in webtechkitchen.libraries.yml is named with the new themename


JSX with React within a Drupal application

Submitted by barnettech on Wed, 06/26/2019 - 14:39

"Tip: To be able to use JSX you would have to use Webpack first to compile your JavaScript file and then add it to Drupal. A good approach then would be to use the create-react-app repo to start and then just copy over the resulting js file created after transpilation and embed that. You would then not need to embed react.js separately because it is already bundled in transpilation. Setting this up, however, so that auto refresh would work and the file would be copied to Drupal, is a bit more complicated and therefore we are skipping it."