Sha256: 5c41e0f1d00f7bf61b86b608b0daa3c568d38dc8bfe1f0f6f39fc5505e039eb7

Contents?: true

Size: 557 Bytes

Versions: 48

Compression:

Stored size: 557 Bytes

Contents

# frozen_string_literal: true

module Alchemy
  module Ingredients
    # A link to a page
    #
    # Assign Alchemy::Page to this ingredient
    #
    class Page < Alchemy::Ingredient
      related_object_alias :page, class_name: "Alchemy::Page"

      allow_settings %i[query_params]

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

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
alchemy_cms-7.3.4 app/models/alchemy/ingredients/page.rb
alchemy_cms-7.3.3 app/models/alchemy/ingredients/page.rb
alchemy_cms-7.3.2 app/models/alchemy/ingredients/page.rb
alchemy_cms-7.2.7 app/models/alchemy/ingredients/page.rb
alchemy_cms-7.3.1 app/models/alchemy/ingredients/page.rb
alchemy_cms-7.3.0 app/models/alchemy/ingredients/page.rb
alchemy_cms-7.2.6 app/models/alchemy/ingredients/page.rb
alchemy_cms-7.2.5 app/models/alchemy/ingredients/page.rb
alchemy_cms-7.1.12 app/models/alchemy/ingredients/page.rb
alchemy_cms-7.0.15 app/models/alchemy/ingredients/page.rb
alchemy_cms-7.2.4 app/models/alchemy/ingredients/page.rb
alchemy_cms-7.1.11 app/models/alchemy/ingredients/page.rb
alchemy_cms-7.2.3 app/models/alchemy/ingredients/page.rb
alchemy_cms-7.1.10 app/models/alchemy/ingredients/page.rb
alchemy_cms-7.2.2 app/models/alchemy/ingredients/page.rb
alchemy_cms-7.1.9 app/models/alchemy/ingredients/page.rb
alchemy_cms-7.0.14 app/models/alchemy/ingredients/page.rb
alchemy_cms-7.2.1 app/models/alchemy/ingredients/page.rb
alchemy_cms-7.0.13 app/models/alchemy/ingredients/page.rb
alchemy_cms-7.1.8 app/models/alchemy/ingredients/page.rb