Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#67] Add global fields to put scripts in head, body, footer #82

Open
wants to merge 3 commits into
base: 5.x
Choose a base branch
from

Conversation

joshuapease
Copy link
Contributor

@joshuapease joshuapease commented Feb 21, 2025

Overview

Adds global scripts as a Craft Single.

Also adds Verbb Expanded singles.

Entries Screen

Craft Admin

CleanShot 2025-02-21 at 07 12 01@2x

Frontend

CleanShot 2025-02-21 at 07 12 19@2x

@joshuapease joshuapease marked this pull request as ready for review February 21, 2025 15:15
@maxfenton
Copy link
Contributor

I have to say I don't like that this is in the starter kit because it’s something we usually don't want to give a client unless they ask.

Also, just as a note, this deviates from the Ad Council pattern so we'd remove it from the starter kit before adding it to a new Ad Council site: https://www.notion.so/viget/ADC-Code-Blocks-pattern-12d6c4ac83fe80c6aa5ae9335dd8ddfc?pvs=4

@joshuapease
Copy link
Contributor Author

it’s something we usually don't want to give a client unless they ask.

@maxfenton I don't believe the platform team has an official stance on global scripts. Each dev on the team probably has their own unique perspective.

I agree that there are lots of downsides to performance and page stability (clients forgetting to close a tag, etc).

But, when I weigh the tradeoffs, I tend to be in favor of giving clients more control and self sufficiency.

Here are some of the thoughts that bring me to that conclusion:

  • 9 times out of 10, clients ask for this feature anyway
  • Clients pay a lot for their sites. If they don't ask for this feature during development, it a poor customer experience to pay $200/hr for support work (or even worse, want to add a script after the support contract is over).
  • If we put Tag Manger on the site, they can stuff that full of scripts (and usually do).
    • But, inevitably there are scripts that clients need/want to load immediately (like A/B testing services)

It could be that your client experiences have been different than mine... (I've been on MW for a looong time, and they're certainly a unique client)

That Ad Council block pattern is cool... I especially like the ability to add notes about a script. I'd be interested in using that pattern in the site starter (although I do like how little code is needed for a text field + raw).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants