feat: Enhance specialty handling and navigation across doctor and specialty pages
This commit is contained in:
@@ -7,6 +7,7 @@ import { getEntityOrigin } from "@/lib/getCanonicalUrl";
|
||||
import { extractEntityCityId, findCityById } from "@/lib/domainHelpers";
|
||||
import { buildDoctorFaq } from "@/lib/specialtyContent";
|
||||
import { isNoindexDoctor } from "@/lib/entityQuality";
|
||||
import { splitSpecialties } from "@/lib/specialtyDisplay";
|
||||
import specialtiesData from "@/data/specialties.json";
|
||||
import { safeJsonLd } from "@/lib/sanitize";
|
||||
import { imageUrl, doctorTitle } from "@/helper";
|
||||
@@ -246,7 +247,10 @@ async function Doctor({ params }) {
|
||||
}
|
||||
: null;
|
||||
|
||||
const specialtyLabel = doctor?.specialties?.[0]?.name || "پزشکان";
|
||||
// همان تخصصی که سربرگ صفحه نشان میدهد؛ اگر اینجا اولین آیتم آرایه میماند،
|
||||
// BreadcrumbList و نمای صفحه دو چیز متفاوت میگفتند.
|
||||
const specialtyLabel =
|
||||
splitSpecialties(doctor?.specialties).primary?.name || "پزشکان";
|
||||
// مقصد تمیز صفحهٔ فرود تخصص؛ اگر تخصص slug نداشت، به لیست پزشکان برمیگردیم.
|
||||
const specialtySlug = specialtiesData.find(
|
||||
(item) => item.name === specialtyLabel && item.status === 1
|
||||
|
||||
@@ -135,6 +135,7 @@ async function SpecialtyDetail({ params }) {
|
||||
/>
|
||||
<Layout name="/specialties">
|
||||
<SpecialtyDetailPage
|
||||
specialty={specialty}
|
||||
specialtyName={specialty.name}
|
||||
cityName={cityName}
|
||||
doctors={doctors}
|
||||
|
||||
Reference in New Issue
Block a user