Sha256: b1d45237e465983621b1f3f894985750104b30a8022433240b83489eb86ed51c

Contents?: true

Size: 562 Bytes

Versions: 52

Compression:

Stored size: 562 Bytes

Contents

# frozen_string_literal: true

module Alchemy
  module Ingredients
    # A link to a menu node
    #
    # Assign Alchemy::Node to this ingredient
    #
    class Node < Alchemy::Ingredient
      related_object_alias :node, class_name: "Alchemy::Node"

      allow_settings %i[query_params]

      # The first 30 characters of node name
      #
      # Used by the Element#preview_text method.
      #
      # @param [Integer] max_length (30)
      #
      def preview_text(max_length = 30)
        node&.name.to_s[0..max_length - 1]
      end
    end
  end
end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
alchemy_cms-7.0.7 app/models/alchemy/ingredients/node.rb
alchemy_cms-7.0.6 app/models/alchemy/ingredients/node.rb
alchemy_cms-7.0.5 app/models/alchemy/ingredients/node.rb
alchemy_cms-7.0.4 app/models/alchemy/ingredients/node.rb
alchemy_cms-7.0.3 app/models/alchemy/ingredients/node.rb
alchemy_cms-7.0.2 app/models/alchemy/ingredients/node.rb
alchemy_cms-7.0.1 app/models/alchemy/ingredients/node.rb
alchemy_cms-7.0.0 app/models/alchemy/ingredients/node.rb
alchemy_cms-7.0.0.pre.rc1 app/models/alchemy/ingredients/node.rb
alchemy_cms-7.0.0.pre.c app/models/alchemy/ingredients/node.rb
alchemy_cms-7.0.0.pre.b app/models/alchemy/ingredients/node.rb
alchemy_cms-7.0.0.pre.a app/models/alchemy/ingredients/node.rb