From 08b817557460c2dbd56a5baf06ce6dd8fcecbd2e Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Fri, 11 Jul 2025 09:41:27 +0200 Subject: [PATCH] dont display special LD data on services for now --- hub/services/templatetags/json_ld_tags.py | 55 ++++++++++++----------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/hub/services/templatetags/json_ld_tags.py b/hub/services/templatetags/json_ld_tags.py index d215703..138f13e 100644 --- a/hub/services/templatetags/json_ld_tags.py +++ b/hub/services/templatetags/json_ld_tags.py @@ -106,37 +106,38 @@ def json_ld_structured_data(context): } elif view_name == "service_detail" and "service" in context: - service = context["service"] - service_url = request.build_absolute_uri() + data = organization_data - # Check if service has offerings with pricing - has_offerings = hasattr(service, "offerings") and service.offerings.exists() + # service = context["service"] + # service_url = request.build_absolute_uri() + # # Check if service has offerings with pricing + # has_offerings = hasattr(service, "offerings") and service.offerings.exists() - if has_offerings: - # Use Product type when we have offerings (which provide the required offers data) - data = { - "@context": "https://schema.org", - "@type": "Product", - "name": service.name, - "description": service.description, - "url": service_url, - "category": "Cloud Service", - } + # if has_offerings: + # # Use Product type when we have offerings (which provide the required offers data) + # data = { + # "@context": "https://schema.org", + # "@type": "Product", + # "name": service.name, + # "description": service.description, + # "url": service_url, + # "category": "Cloud Service", + # } - # Add image if available - if hasattr(service, "get_logo") and service.get_logo: - data["image"] = request.build_absolute_uri(service.get_logo.url) + # # Add image if available + # if hasattr(service, "get_logo") and service.get_logo: + # data["image"] = request.build_absolute_uri(service.get_logo.url) - # Add offerings - data["offers"] = { - "@type": "AggregateOffer", - "availability": "https://schema.org/InStock", - "offerCount": service.offerings.count(), - } - else: - # Use Organization data when no offerings are available - # This avoids Google Search Console errors for Product without required fields - data = organization_data + # # Add offerings + # data["offers"] = { + # "@type": "AggregateOffer", + # "availability": "https://schema.org/InStock", + # "offerCount": service.offerings.count(), + # } + # else: + # # Use Organization data when no offerings are available + # # This avoids Google Search Console errors for Product without required fields + # data = organization_data elif view_name == "provider_detail" and "provider" in context: provider = context["provider"]