-
Notifications
You must be signed in to change notification settings - Fork 13
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
Promo component: admin URL field #139
Comments
Spoke to the legend that is @damonjagger https://github.com/nhsuk/wagtail-nhsuk-frontend/blob/master/wagtailnhsukfrontend/blocks.py#L161
It currently uses a URLBlock, which is good for external links. If you use a PageChooserBlock, you'll be able to do what you want for internal links (and they are much better than URLBlocks for internal content, since they automatically update when you move/delete/update the page/slug. http://docs.wagtail.io/en/v2.0/topics/streamfield.html#pagechooserblock You could either specify whether it's an Internal Promo, or External Promo, and overwrite the |
I've not been working much with Wagtail the past couple of months so you might know better. I know we had the same requirement Adam has for a project we were working on recently and I think we extended the template/block to add this functionality. We rarely used promos with external urls, but maybe thats a misuse of the component. |
We've done this sort of thing before on the NHS Website: Define two blocks, a page chooser and a URL block.
The issue with this is a clunky UI. It would be really nice if we could get the same UI as the drafttail link picker. |
For the
URL
field of the Promo component, I have to manually enter a full relative URL into the field, I cannot enter/frontend-library
as I get an error sayingEnter a valid URL.
Entering a relative URL would cause problems on staging environments vs live environments (all URLs will be pointing to the live website when on the staging environment).Would it also be possible to have an option to use the native Wagtail page chooser? The page I want to link to exists within Wagtail CMS, but I only have the option to enter a full URL. This would help if the page ever got renamed or moved.
Attached is a screenshot of the page chooser available in a regular DraftTail content block. I can link to both internal pages and external pages.
This potentially could apply to more than the Promo component.
The text was updated successfully, but these errors were encountered: