Marketing round: pilot banner + price feedback, simpler lead forms, journey page, trimmed home
- pricing: pilot-stage banner (pilot_label/pilot_text) on home + founders; price-range checklist on the founders page — selections fire consent-gated Umami events (price-range-*) via the new data-umami-event listener and ride the Zoho payload as price_range - forms: Zoho needs only name + email — founders form drops first/last split, stage, sector, country, heard; hubs form drops country/programme select (country deduced downstream from locale, which already rides the payload) - journey: moved to its own /journey/ page (six phases), nav entry added - home: reduced to hero + pilot banner + two audience cards linking to the value-proposition pages; verbose blocks rewritten - nav bug fix: the nav was built from the CURRENT page's alternates, so every page rendered a one-entry nav; now built from all pages of the locale - CMS: config.yml + custom preview gain the pilot banner, price checklist and card-link fields
This commit is contained in:
@@ -2,9 +2,12 @@
|
||||
// The lead form used by both audience pages. Labels come from the shared
|
||||
// per-locale strings; on submit a small fetch POSTs the payload to the
|
||||
// page's Zoho Flow webhook (token-in-URL authentication, no server code).
|
||||
// The hubs variant carries a hidden "capabilities" field the capability
|
||||
// blocks on the landing page append to when clicked — leads arrive in the
|
||||
// CRM already tagged with what interested them.
|
||||
// Deliberately minimal — the CRM only needs a name and an email; country
|
||||
// is deduced downstream from the submitted locale or the IP address.
|
||||
// The hubs variant carries a hidden "capabilities" field (set by the
|
||||
// capability checklist) and the founders variant a hidden "price_range"
|
||||
// field (set by the pricing checklist) — leads arrive in the CRM already
|
||||
// tagged with what interested them.
|
||||
const { type: pageId, locale, strings, site } = Astro.props;
|
||||
// pageId arrives as the route id ("for-founders"/"for-innovation-hubs")
|
||||
// — normalise to the form kind:
|
||||
@@ -13,32 +16,13 @@ const type = pageId === "for-founders" ? "founders" : "hubs";
|
||||
const fields =
|
||||
type === "founders"
|
||||
? [
|
||||
{ name: "first_name", label: strings.field_first_name, input: "text", required: true },
|
||||
{ name: "last_name", label: strings.field_last_name, input: "text", required: true },
|
||||
{ name: "name", label: strings.field_name, input: "text", required: true },
|
||||
{ name: "email", label: strings.field_email, input: "email", required: true },
|
||||
{ name: "stage", label: strings.field_stage, input: "select", options: [
|
||||
["idea", strings.field_stage_idea],
|
||||
["prototype", strings.field_stage_prototype],
|
||||
["launch", strings.field_stage_launch],
|
||||
] },
|
||||
{ name: "sector", label: strings.field_sector, input: "text" },
|
||||
{ name: "country", label: strings.field_country, input: "text" },
|
||||
{ name: "heard", label: strings.field_heard, input: "text" },
|
||||
]
|
||||
: [
|
||||
{ name: "organisation", label: strings.field_organisation, input: "text", required: true },
|
||||
{ name: "first_name", label: strings.field_first_name, input: "text", required: true },
|
||||
{ name: "last_name", label: strings.field_last_name, input: "text", required: true },
|
||||
{ name: "name", label: strings.field_name, input: "text", required: true },
|
||||
{ name: "email", label: strings.field_email, input: "email", required: true },
|
||||
{ name: "country", label: strings.field_country, input: "text" },
|
||||
{ name: "programme", label: strings.field_programme, input: "select", options: [
|
||||
["incubator", strings.field_programme_incubator],
|
||||
["accelerator", strings.field_programme_accelerator],
|
||||
["edih", strings.field_programme_edih],
|
||||
["een", strings.field_programme_een],
|
||||
["agency", strings.field_programme_agency],
|
||||
["other", strings.field_programme_other],
|
||||
] },
|
||||
{ name: "message", label: strings.field_message, input: "textarea" },
|
||||
];
|
||||
|
||||
@@ -62,6 +46,7 @@ const note = type === "founders" ? strings.form_founders_note : strings.form_hub
|
||||
<h2 id="lead-form">{title}</h2>
|
||||
<p class="lead-note">{note}</p>
|
||||
<p class="cap-selection" id="cap-selection" hidden></p>
|
||||
<p class="cap-selection" id="price-selection" hidden></p>
|
||||
{fields.map((f) => (
|
||||
<label>
|
||||
{f.label}{f.required ? " *" : ""}
|
||||
@@ -87,6 +72,7 @@ const note = type === "founders" ? strings.form_founders_note : strings.form_hub
|
||||
aria-hidden="true"
|
||||
/>
|
||||
<input type="hidden" name="capabilities" value="" />
|
||||
<input type="hidden" name="price_range" value="" />
|
||||
<input type="hidden" name="locale" value={locale} />
|
||||
<input type="hidden" name="source" value={type} />
|
||||
<label class="consent">
|
||||
@@ -105,26 +91,36 @@ const note = type === "founders" ? strings.form_founders_note : strings.form_hub
|
||||
sending: form.dataset.sendingLabel,
|
||||
};
|
||||
|
||||
// capability CHECKLIST (the multi-select above the form): collect the
|
||||
// checked boxes at submit time so the selection rides the payload —
|
||||
// both as machine keys and as a human-readable line in the message.
|
||||
const capField = form.querySelector('input[name="capabilities"]');
|
||||
const capsHover = document.getElementById("cap-selection");
|
||||
const refreshCaps = () => {
|
||||
const checked = [...document.querySelectorAll("[data-cap]:checked")];
|
||||
if (!capsHover) return;
|
||||
capsHover.textContent = checked.length
|
||||
? checked.map((c) => c.dataset.capLabel || c.dataset.cap).join(", ")
|
||||
: "";
|
||||
capsHover.hidden = !checked.length;
|
||||
};
|
||||
document.querySelectorAll("[data-cap]").forEach((el) => {
|
||||
el.addEventListener("change", () => {
|
||||
const boxes = [...document.querySelectorAll("[data-cap]:checked")];
|
||||
if (capField) capField.value = boxes.map((c) => c.dataset.cap).join(",");
|
||||
refreshCaps();
|
||||
// CHECKLISTS above the form (capabilities on the hubs page, price
|
||||
// ranges on the founders page): collect the checked boxes at submit
|
||||
// time so each selection rides the payload — both as machine keys
|
||||
// and as a human-readable line in the message. One echo element per
|
||||
// checklist mirrors the live selection back to the visitor.
|
||||
const collect = (attrName, containerId) => {
|
||||
const field = form.querySelector(`input[name="${attrName === "data-cap" ? "capabilities" : "price_range"}"]`);
|
||||
const echo = document.getElementById(containerId);
|
||||
const refresh = () => {
|
||||
const checked = [...document.querySelectorAll(`[${attrName}]:checked`)];
|
||||
if (echo) {
|
||||
echo.textContent = checked.map((c) => c.dataset.capLabel || c.dataset.priceLabel || c.dataset.cap || c.dataset.price).join(", ");
|
||||
echo.hidden = !checked.length;
|
||||
}
|
||||
};
|
||||
document.querySelectorAll(`[${attrName}]`).forEach((el) => {
|
||||
el.addEventListener("change", () => {
|
||||
if (field) field.value = checkedKeys(attrName).join(",");
|
||||
refresh();
|
||||
});
|
||||
});
|
||||
});
|
||||
refresh();
|
||||
return { field, refresh };
|
||||
};
|
||||
const checkedKeys = (attrName) =>
|
||||
[...document.querySelectorAll(`[${attrName}]:checked`)].map((c) =>
|
||||
attrName === "data-cap" ? c.dataset.cap : c.dataset.price
|
||||
);
|
||||
const caps = collect("data-cap", "cap-selection");
|
||||
const prices = collect("data-price", "price-selection");
|
||||
|
||||
form.addEventListener("submit", async (event) => {
|
||||
event.preventDefault();
|
||||
@@ -136,7 +132,8 @@ const note = type === "founders" ? strings.form_founders_note : strings.form_hub
|
||||
// not the checkbox's literal "on"; an unchecked box never arrives)
|
||||
payload.consent = data.get("consent") === "on";
|
||||
if (payload.website) return; // honeypot: pretend success, send nothing
|
||||
if (capField) payload.capabilities = capField.value;
|
||||
if (caps.field) payload.capabilities = caps.field.value;
|
||||
if (prices.field) payload.price_range = prices.field.value;
|
||||
button.disabled = true;
|
||||
button.textContent = STRINGS.sending || "Sending…";
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user