question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[A3] footerJs block

See original GitHub issue

The problem to solve

It would allow adding scripts after the core utils directly within the layout template. Currently A3 boilerplate proposes development workflow with wrong JS order - modules browser JS will end up before the core utils. No matter there is a workaround (defer attribute, dom loaded event), an extra layout block in the default core base layout would simplify the task of simply adding custom browser JS.

Proposed solution

Add {% block footerJs %}{% endblock %} at the very end of template:outerLayoutBase.html, just before the closing body tag. Change the a3-boilerplate implementation to use this new block as a good example usage.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
boutellcommented, Mar 2, 2021

Have you tried putting your javascript files in modules/modulename/ui/public?

When you do that, they should become part of our javascript bundle automatically and go at the end.

I can see that we might need to provide another block that goes after our script tag for other reasons, but let’s talk about this solution first.

On Tue, Mar 2, 2021 at 4:39 AM Miro Yovchev notifications@github.com wrote:

I think it’s good to have the option to inject both before and after the core utils. Keeping the extraBody block how it is might be good for BC.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/apostrophecms/apostrophe/issues/2770#issuecomment-788769791, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAH27ILRHOJMMCWXLM7PQLTBSW3TANCNFSM4YMXISAA .

THOMAS BOUTELL | CHIEF TECHNOLOGY OFFICER APOSTROPHECMS | apostrophecms.com | he/him/his

0reactions
abeacommented, Jul 14, 2021

In A3 there is an {% block afterAposScripts %}{% endblock %} block that is essentially the last thing in the body tag.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Wide Base A3 Print Press Lino Cut Press Block Printing
A3 : 11.7 x 16.5 inç. It is the perfect machine for those who want to print larger than A4. 36 mm thick...
Read more >
a3-boilerplate/layout.html at main · apostrophecms/ ...
Simple, minimal starting point for new Apostrophe 3 projects - a3-boilerplate/layout.html at main · apostrophecms/a3-boilerplate.
Read more >
Team Backpack
The A3 Performance Backpack is built to handle the toughest demands. We use a durable polished polyester fabric, reinforced stitching and nylon zippers....
Read more >
Single lever locking panel base with cover. For use with A3, A4
Single lever locking panel base with cover. For use with A3, A4, D7 and D8 series. ; MFR: ABB - Installation Products ;...
Read more >
CREATING A TITLE BLOCK for your Plans in Layout - YouTube
In this video, learn the basics for creating a title block in Layout! Learn to save your title block so that it shows...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found