Roscoe  Batz

Roscoe Batz

1656532800

TOP 10 WordPress Gutenberg Block Editor Tips That Save You Time

Save Time with this WordPress Gutenberg Block Editor tutorial

Timeline
0:00 - Intro
0:10 - Turn of pre publish check list
0:40 - Drag and drop photos into WordPress pages
1:00 - Duplication
1:25 - Keyboard shortcuts
1:55 - A quicker way to embed youtube videos
2:05 - Turn off WordPress full screen mode
2:25 - Dynamically inject Blocks in Multiple posts
3:25 - Delete multiple Blocks using List View
3:50 - Reuse your Layouts
6:30 - The forward slash trick
7:00 - Emoji shortcuts
7:35 - Cat cameo


Gutenberg Keyboard Shortcut for Mac users:
Enter = Add a new block
/ = Change the block type after adding a new paragraph
Command + Shift + d = Duplicate the selected block(s)
Control + Option + z = Remove the selected block(s)
Command + Option + t = Insert a new block before the selected block(s)
Command + Option + y = Insert a new block after the selected block(s)
Esc = Clear selection
Command+ Shift + z = Redo your last undo
Command + Shift + , = Show or hide the settings bar
Option + Control + o = Open the block navigation menu
Option + Control + n = Navigate to the next part of the editor
Option + Control + p = Navigate to the previous part of the editor
fn + Option + F10 = Navigate to the nearest toolbar
Command + Option + Shift + m = Switch between Visual and Code Editor

#wordpress 

What is GEEK

Buddha Community

TOP 10 WordPress Gutenberg Block Editor Tips That Save You Time
Sasha  Roberts

Sasha Roberts

1659500100

Reform: Form Objects Decoupled From Models In Ruby

Reform

Form objects decoupled from your models.

Reform gives you a form object with validations and nested setup of models. It is completely framework-agnostic and doesn't care about your database.

Although reform can be used in any Ruby framework, it comes with Rails support, works with simple_form and other form gems, allows nesting forms to implement has_one and has_many relationships, can compose a form from multiple objects and gives you coercion.

Full Documentation

Reform is part of the Trailblazer framework. Full documentation is available on the project site.

Reform 2.2

Temporary note: Reform 2.2 does not automatically load Rails files anymore (e.g. ActiveModel::Validations). You need the reform-rails gem, see Installation.

Defining Forms

Forms are defined in separate classes. Often, these classes partially map to a model.

class AlbumForm < Reform::Form
  property :title
  validates :title, presence: true
end

Fields are declared using ::property. Validations work exactly as you know it from Rails or other frameworks. Note that validations no longer go into the model.

The API

Forms have a ridiculously simple API with only a handful of public methods.

  1. #initialize always requires a model that the form represents.
  2. #validate(params) updates the form's fields with the input data (only the form, not the model) and then runs all validations. The return value is the boolean result of the validations.
  3. #errors returns validation messages in a classic ActiveModel style.
  4. #sync writes form data back to the model. This will only use setter methods on the model(s).
  5. #save (optional) will call #save on the model and nested models. Note that this implies a #sync call.
  6. #prepopulate! (optional) will run pre-population hooks to "fill out" your form before rendering.

In addition to the main API, forms expose accessors to the defined properties. This is used for rendering or manual operations.

Setup

In your controller or operation you create a form instance and pass in the models you want to work on.

class AlbumsController
  def new
    @form = AlbumForm.new(Album.new)
  end

This will also work as an editing form with an existing album.

def edit
  @form = AlbumForm.new(Album.find(1))
end

Reform will read property values from the model in setup. In our example, the AlbumForm will call album.title to populate the title field.

Rendering Forms

Your @form is now ready to be rendered, either do it yourself or use something like Rails' #form_for, simple_form or formtastic.

= form_for @form do |f|
  = f.input :title

Nested forms and collections can be easily rendered with fields_for, etc. Note that you no longer pass the model to the form builder, but the Reform instance.

Optionally, you might want to use the #prepopulate! method to pre-populate fields and prepare the form for rendering.

Validation

After form submission, you need to validate the input.

class SongsController
  def create
    @form = SongForm.new(Song.new)

    #=> params: {song: {title: "Rio", length: "366"}}

    if @form.validate(params[:song])

The #validate method first updates the values of the form - the underlying model is still treated as immutuable and remains unchanged. It then runs all validations you provided in the form.

It's the only entry point for updating the form. This is per design, as separating writing and validation doesn't make sense for a form.

This allows rendering the form after validate with the data that has been submitted. However, don't get confused, the model's values are still the old, original values and are only changed after a #save or #sync operation.

Syncing Back

After validation, you have two choices: either call #save and let Reform sort out the rest. Or call #sync, which will write all the properties back to the model. In a nested form, this works recursively, of course.

It's then up to you what to do with the updated models - they're still unsaved.

Saving Forms

The easiest way to save the data is to call #save on the form.

if @form.validate(params[:song])
  @form.save  #=> populates album with incoming data
              #   by calling @form.album.title=.
else
  # handle validation errors.
end

This will sync the data to the model and then call album.save.

Sometimes, you need to do saving manually.

Default values

Reform allows default values to be provided for properties.

class AlbumForm < Reform::Form
  property :price_in_cents, default: 9_95
end

Saving Forms Manually

Calling #save with a block will provide a nested hash of the form's properties and values. This does not call #save on the models and allows you to implement the saving yourself.

The block parameter is a nested hash of the form input.

  @form.save do |hash|
    hash      #=> {title: "Greatest Hits"}
    Album.create(hash)
  end

You can always access the form's model. This is helpful when you were using populators to set up objects when validating.

  @form.save do |hash|
    album = @form.model

    album.update_attributes(hash[:album])
  end

Nesting

Reform provides support for nested objects. Let's say the Album model keeps some associations.

class Album < ActiveRecord::Base
  has_one  :artist
  has_many :songs
end

The implementation details do not really matter here, as long as your album exposes readers and writes like Album#artist and Album#songs, this allows you to define nested forms.

class AlbumForm < Reform::Form
  property :title
  validates :title, presence: true

  property :artist do
    property :full_name
    validates :full_name, presence: true
  end

  collection :songs do
    property :name
  end
end

You can also reuse an existing form from elsewhere using :form.

property :artist, form: ArtistForm

Nested Setup

Reform will wrap defined nested objects in their own forms. This happens automatically when instantiating the form.

album.songs #=> [<Song name:"Run To The Hills">]

form = AlbumForm.new(album)
form.songs[0] #=> <SongForm model: <Song name:"Run To The Hills">>
form.songs[0].name #=> "Run To The Hills"

Nested Rendering

When rendering a nested form you can use the form's readers to access the nested forms.

= text_field :title,         @form.title
= text_field "artist[name]", @form.artist.name

Or use something like #fields_for in a Rails environment.

= form_for @form do |f|
  = f.text_field :title

  = f.fields_for :artist do |a|
    = a.text_field :name

Nested Processing

validate will assign values to the nested forms. sync and save work analogue to the non-nested form, just in a recursive way.

The block form of #save would give you the following data.

@form.save do |nested|
  nested #=> {title:  "Greatest Hits",
         #    artist: {name: "Duran Duran"},
         #    songs: [{title: "Hungry Like The Wolf"},
         #            {title: "Last Chance On The Stairways"}]
         #   }
  end

The manual saving with block is not encouraged. You should rather check the Disposable docs to find out how to implement your manual tweak with the official API.

Populating Forms

Very often, you need to give Reform some information how to create or find nested objects when validateing. This directive is called populator and documented here.

Installation

Add this line to your Gemfile:

gem "reform"

Reform works fine with Rails 3.1-5.0. However, inheritance of validations with ActiveModel::Validations is broken in Rails 3.2 and 4.0.

Since Reform 2.2, you have to add the reform-rails gem to your Gemfile to automatically load ActiveModel/Rails files.

gem "reform-rails"

Since Reform 2.0 you need to specify which validation backend you want to use (unless you're in a Rails environment where ActiveModel will be used).

To use ActiveModel (not recommended because very out-dated).

require "reform/form/active_model/validations"
Reform::Form.class_eval do
  include Reform::Form::ActiveModel::Validations
end

To use dry-validation (recommended).

require "reform/form/dry"
Reform::Form.class_eval do
  feature Reform::Form::Dry
end

Put this in an initializer or on top of your script.

Compositions

Reform allows to map multiple models to one form. The complete documentation is here, however, this is how it works.

class AlbumForm < Reform::Form
  include Composition

  property :id,    on: :album
  property :title, on: :album
  property :songs, on: :cd
  property :cd_id, on: :cd, from: :id
end

When initializing a composition, you have to pass a hash that contains the composees.

AlbumForm.new(album: album, cd: CD.find(1))

More

Reform comes many more optional features, like hash fields, coercion, virtual fields, and so on. Check the full documentation here.

Reform is part of the Trailblazer project. Please buy my book to support the development and learn everything about Reform - there's two chapters dedicated to Reform!

Security And Strong_parameters

By explicitly defining the form layout using ::property there is no more need for protecting from unwanted input. strong_parameter or attr_accessible become obsolete. Reform will simply ignore undefined incoming parameters.

This is not Reform 1.x!

Temporary note: This is the README and API for Reform 2. On the public API, only a few tiny things have changed. Here are the Reform 1.2 docs.

Anyway, please upgrade and report problems and do not simply assume that we will magically find out what needs to get fixed. When in trouble, join us on Gitter.

Full documentation for Reform is available online, or support us and grab the Trailblazer book. There is an Upgrading Guide to help you migrate through versions.

Attributions!!!

Great thanks to Blake Education for giving us the freedom and time to develop this project in 2013 while working on their project.


Author: trailblazer
Source code: https://github.com/trailblazer/reform
License:  MIT license

#ruby  #ruby-on-rails

How to Custom Color Palette to Gutenberg Block in WordPress

[ Gutenberg ] team doing a great job of making the editor more flexible for user’s and developer’s points of view. We can extend it by creating custom blocks or extend the existing blocks.

Default Theme Color Palettes

Gutenberg comes with some random color palettes as you can see below screenshot. But if we think from a designer’s point of view then we don’t require these random color palettes to the WordPress site.

Every design must have some unique color palette set as per their design. For example, take a look at a custom color palette that we are going to use in the Gutenberg color settings section.

#wordpress #gutenberg #custom color palette #wordpress's gutenberg block #block

Callum  Owen

Callum Owen

1625650620

WordPress Gutenberg Tutorial: How to Easily Work With the Block Editor

Are you looking for an easy tutorial on how to use WordPress Gutenberg editor? We’ll show you how to use Gutenberg to create your posts in WordPress.

And we’ll cover some of the most popular blocks like the paragraph, image, and link block. We’ll also highlight a few Gutenberg blocks like the Cover page and the Gallery block.

And did you know that many plugins like WPForms use blocks to easily integrate their plugins with your post or pages.

This video is brought to you by WPForms, the easiest to use drag and drop form builder on the market.

Head over to to get the best discount on WPForms

====================================
https://wpforms.com/wpbeginner/

You can read more about the Gutenberg block editor from our written article here:
https://www.wpbeginner.com/beginners-guide/how-to-use-the-new-wordpress-block-editor/

0:00 Intro
0:28 Difference between Gutenberg block editor and Classic Editor
1:21 How to add a block in Gutenberg
2:13 Working with blocks in the editor
5:50 Saving and reusing blocks in Gutenberg
7:38 Publishing and managing options in Gutenberg block editor
9:06 Plugin options in Gutenberg
10:30 Adding an image in WordPress block editor
10:44 How to add a link in Gutenberg block editor
11:16 How to add an image gallery using Gutenberg
12:18 Exploring new content blocks in WordPress block editor
14:55 Create a table with Gutenberg block editor in WordPress
16:09 Adding columns to the block editor
16:40 Bonus tips on using Gutenberg like a Pro
18:46 Can I still use the classic editor in WordPress?
20:25 What is your favorite block to use with Gutenberg?

And if you’r looking to grow your website, then make sure you watch this video where we show you 11 ways to grow your traffic.
https://www.youtube.com/watch?v=etFpn5HohUg&list=PLOmYFHk0WYaseFFmK6tLbKSiPgNwS6t6t

If you liked this video, then please Like and consider subscribing to our channel here for more WordPress videos.
https://www.youtube.com/subscription_center?add_user=wpbeginner

— Related Content —

-WordPress Tutorial [UPDATED] - How to Make a WordPress Website for Beginners https://www.youtube.com/watch?v=DvbFBxKcORA

Join our group on Facebook
https://www.facebook.com/groups/wpbeginner

Follow us on Twitter
http://twitter.com/wpbeginner

Check out our website for more WordPress Tutorials
http://www.wpbeginner.com
#WordPress #WordPressTutorial #WPBeginner

#wordpress #wpbeginner #wordpresstutorial #wordpress gutenberg tutorial #block editor #easily work

Roscoe  Batz

Roscoe Batz

1656532800

TOP 10 WordPress Gutenberg Block Editor Tips That Save You Time

Save Time with this WordPress Gutenberg Block Editor tutorial

Timeline
0:00 - Intro
0:10 - Turn of pre publish check list
0:40 - Drag and drop photos into WordPress pages
1:00 - Duplication
1:25 - Keyboard shortcuts
1:55 - A quicker way to embed youtube videos
2:05 - Turn off WordPress full screen mode
2:25 - Dynamically inject Blocks in Multiple posts
3:25 - Delete multiple Blocks using List View
3:50 - Reuse your Layouts
6:30 - The forward slash trick
7:00 - Emoji shortcuts
7:35 - Cat cameo


Gutenberg Keyboard Shortcut for Mac users:
Enter = Add a new block
/ = Change the block type after adding a new paragraph
Command + Shift + d = Duplicate the selected block(s)
Control + Option + z = Remove the selected block(s)
Command + Option + t = Insert a new block before the selected block(s)
Command + Option + y = Insert a new block after the selected block(s)
Esc = Clear selection
Command+ Shift + z = Redo your last undo
Command + Shift + , = Show or hide the settings bar
Option + Control + o = Open the block navigation menu
Option + Control + n = Navigate to the next part of the editor
Option + Control + p = Navigate to the previous part of the editor
fn + Option + F10 = Navigate to the nearest toolbar
Command + Option + Shift + m = Switch between Visual and Code Editor

#wordpress 

Lokesh Kumar

1603438098

Top 10 Trending Technologies Must Learn in 2021 | igmGuru

Technology has taken a place of more productiveness and give the best to the world. In the current situation, everything is done through the technical process, you don’t have to bother about doing task, everything will be done automatically.This is an article which has some important technologies which are new in the market are explained according to the career preferences. So let’s have a look into the top trending technologies followed in 2021 and its impression in the coming future in the world.

  1. Data Science
    First in the list of newest technologies is surprisingly Data Science. Data Science is the automation that helps to be reasonable for complicated data. The data is produces in a very large amount every day by several companies which comprise sales data, customer profile information, server data, business data, and financial structures. Almost all of the data which is in the form of big data is very indeterminate. The character of a data scientist is to convert the indeterminate datasets into determinate datasets. Then these structured data will examine to recognize trends and patterns. These trends and patterns are beneficial to understand the company’s business performance, customer retention, and how they can be enhanced.

  2. DevOps
    Next one is DevOps, This technology is a mixture of two different things and they are development (Dev) and operations (Ops). This process and technology provide value to their customers in a continuous manner. This technology plays an important role in different aspects and they can be- IT operations, development, security, quality, and engineering to synchronize and cooperate to develop the best and more definitive products. By embracing a culture of DevOps with creative tools and techniques, because through that company will gain the capacity to preferable comeback to consumer requirement, expand the confidence in the request they construct, and accomplish business goals faster. This makes DevOps come into the top 10 trending technologies.

  3. Machine learning
    Next one is Machine learning which is constantly established in all the categories of companies or industries, generating a high command for skilled professionals. The machine learning retailing business is looking forward to enlarging to $8.81 billion by 2022. Machine learning practices is basically use for data mining, data analytics, and pattern recognition. In today’s scenario, Machine learning has its own reputed place in the industry. This makes machine learning come into the top 10 trending technologies. Get the best machine learning course and make yourself future-ready.

To want to know more click on Top 10 Trending Technologies in 2021

You may also read more blogs mentioned below

How to Become a Salesforce Developer

Python VS R Programming

The Scope of Hadoop and Big Data in 2021

#top trending technologies #top 10 trending technologies #top 10 trending technologies in 2021 #top trending technologies in 2021 #top 5 trending technologies in 2021 #top 5 trending technologies