fix: Use page_title with fallback to name for portal display titles (#13719)
This commit is contained in:
@@ -68,6 +68,10 @@ class Portal < ApplicationRecord
|
|||||||
self[:color].presence || DEFAULT_COLOR
|
self[:color].presence || DEFAULT_COLOR
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def display_title
|
||||||
|
page_title.presence || name
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def config_json_format
|
def config_json_format
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ By default, it renders:
|
|||||||
<% if content_for?(:head) %>
|
<% if content_for?(:head) %>
|
||||||
<%= yield(:head) %>
|
<%= yield(:head) %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<title><%= @portal.page_title%></title>
|
<title><%= @portal.display_title %></title>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if @portal.logo.present? %>
|
<% if @portal.logo.present? %>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<% if !@is_plain_layout_enabled %>
|
<% if !@is_plain_layout_enabled %>
|
||||||
<% content_for :head do %>
|
<% content_for :head do %>
|
||||||
<title><%= @portal.name %></title>
|
<title><%= @portal.display_title %></title>
|
||||||
<meta name="title" content="<%= @portal.name %>">
|
<meta name="title" content="<%= @portal.display_title %>">
|
||||||
|
|
||||||
<% if @og_image_url.present? %>
|
<% if @og_image_url.present? %>
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
<meta name="twitter:card" content="summary_large_image">
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<% content_for :head do %>
|
<% content_for :head do %>
|
||||||
<title><%= @article.title %> | <%= @portal.name %></title>
|
<title><%= @article.title %> | <%= @portal.display_title %></title>
|
||||||
<% if @article.meta["title"].present? %>
|
<% if @article.meta["title"].present? %>
|
||||||
<meta name="title" content="<%= @article.meta["title"] %>">
|
<meta name="title" content="<%= @article.meta["title"] %>">
|
||||||
<meta property="og:title" content="<%= @article.meta["title"] %>">
|
<meta property="og:title" content="<%= @article.meta["title"] %>">
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<% content_for :head do %>
|
<% content_for :head do %>
|
||||||
<title><%= @category.name %> | <%= @portal.name %></title>
|
<title><%= @category.name %> | <%= @portal.display_title %></title>
|
||||||
<meta name="title" content="<%= @category.name %> | <%= @portal.name %>">
|
<meta name="title" content="<%= @category.name %> | <%= @portal.display_title %>">
|
||||||
<% if @category.description.present? %>
|
<% if @category.description.present? %>
|
||||||
<meta name="description" content="<%= @category.description %>">
|
<meta name="description" content="<%= @category.description %>">
|
||||||
<meta property="og:description" content="<%= @category.description %>">
|
<meta property="og:description" content="<%= @category.description %>">
|
||||||
|
|||||||
Reference in New Issue
Block a user