Skip to content
Snippets Groups Projects
Commit 873b0af0 authored by pabois's avatar pabois
Browse files

generated path for pages

parent b3acac2c
No related branches found
No related tags found
No related merge requests found
......@@ -84,7 +84,7 @@ class Communication::Website::Page < ApplicationRecord
scope :recent, -> { order(updated_at: :desc).limit(5) }
def generated_path
"#{parent&.path}/#{slug}".gsub(/\/+/, '/')
"#{language_prefix}#{parent&.path}/#{slug}".gsub(/\/+/, '/')
end
def git_path(website)
......@@ -121,6 +121,10 @@ class Communication::Website::Page < ApplicationRecord
"#{website.url}#{path}"
end
def language_prefix
"/#{language.iso_code}" if website.languages.any? && language_id
end
def to_s
"#{title}"
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment