I'm using Django 1.10.5 with Wagtail 1.8. I just noticed there's no
'generate url' in the Images section. Was it removed?
And, when I go to create a new entry, there aren't any 'justification'
buttons in the edit. Were those removed, also?
Neither of those features have been removed from Wagtail. The 'generate URL' link is an optional feature which can be enabled as described here: http://docs.wagtail.io/en/v1.8/advanced_topics/images/image_serve_view.html
The only thing I can think of in Wagtail that could be described as a 'justification' button is the set of options for choosing image format (which default to left, right and full-width). This is still present in Wagtail (although note that it only appears when inserting an image into a rich text area, not when the image is an individual field). The Wagtail editing interface intentionally doesn't provide text justification options, because page layout is more correctly handled in the template, rather than inside page content.
Related
We are using the wagtailuserbar templatetag on our site and it works fine for published pages. We get the "Edit this page" and "View in admin" options etc.
The documentation says that wagtailuserbar can also be used by moderators to approve/reject drafts but I can't get this work.
Quote from the documentation:
Moderators are also given the ability to accept or reject a page being previewed as part of content moderation.
This screenshot shows the admin website with a page that has been submitted for moderation:
Clicking the preview link opens a new tab but the wagtail userbar is not visible.
If one instead uses the View Draft feature in the page explorer then again, new tab but no userbar.
Looking at the source code here these lines seem to remove the userbar for any preview view:
# Don't render if this is a preview. Since some routes can render the userbar without going through Page.serve(),
# request.is_preview might not be defined.
if getattr(request, 'is_preview', False):
return ''
My question is:
How can I use the wagtail userbar to approve or reject previews of pages submitted for moderation? The documentation suggests this is possible but experience and my understanding of the code suggests not.
It's a feature I'd really love to use.
Thanks for any help.
Thanks for this very clear description of the problem. I think this is a bug, which I've raised here:
https://github.com/wagtail/wagtail/issues/6008
How to insert dynamic gist code in the middle of posts generated by Wagtail (Django Cms)?
I searched the documentation of wagtail but did not find anything that could help me automatically insert the github codes.
Gist is one of the built in content types supported by Wagtail's embedded content feature. Within a rich text field, editors can use the 'media' toolbar icon to enter the URL to the Gist page, and it will appear embedded in the rich text content. Within a StreamField, the developer can EmbedBlock to the set of available block types, and the editor will then be able to enter the Gist URL into that field.
I'm looking to edit Drupal's admin pages.
Some of the things I'm trying to achieve:
Remove is the the filter setting on the Content page/node/view. In other words, if I go to to the Content page and I filter by a certain type of node, then I leave that page, then come back, the filter setting is saved, I'd like it to reset each time I visit the Content page.
I would like to modify some of links associated with these pages, as an example on that Same Content page, the titles of the pages are linked to their 'front-end' views, I'd rather have them link to their 'edit' screens.
While I have been successful in modifying the front-end theme of Drupal, by editing the actual php files. I can't find the the same php files for the Admin theme. In our case we are using Seven (7.21). I've read something about views, and thought maybe the entire Admin theme is built as views, aka there no php files involved like the front-end theme has, but under the Views section I did not find any either. I'm still pretty new at this and coming from the Wordpress world, this is a Drupal is a lot different.
The logic for that section of the admin area is at (from the public root):
/modules/node
Specifically "node.admin.inc"
That being said, I don't recommend editing core scripts, as they will be overwritten when you update the core.
You could explore making your own module to supplement that page, or your own view or explore some pre-made modules, such as "Admin Views"
Find de view displayed and go to its configuration :
1 - Edit configuration view like suggested here : https://drupal.stackexchange.com/questions/44440/how-to-remember-exposed-filter-choices
2 - Rewrite output views to rewrite link : field https://www.drupal.org/node/1578524
Another option is to create and use your own dashboard/views to achive like you want http://definitivedrupal.org/suggestions/creating-custom-administrator-view-content
also you can see contrib module : https://www.drupal.org/project/admin_views
You don't have to use that default content overview page at all. Make your own instead:
Make a page view (you have to install views module if you already did not: https://www.drupal.org/project/views) and use table layout. Make sure that page paths starts with "admin" so it will use admin theme. Also pay attention about permissions, so only specific set of users (admins) can use it.
For that view you can freely select what columns you what to show. You can also allow ordering by any column and action if you click on some field.
Use exposed filters to add filtering form, again add any filters you need. You can even set the form to use AJAX, to do auto-submit when some filter field is changed, include reset button and more. Also for every exposed filed you can select (at fields settings) should it remember it's value or not.
At end, edit admin menu and add your new page to it so it will look and act as default one but will offer much more functionality. You can even totally remove default one from the admin menu.
Views module is very powerful, not only for front-end but also for back-end content handling.
I am currently building two sites out of a single Wagtail installation. The sites are for a company and it's sister company and there is some overlap in content. Ideally we don't want to have to post the same content twice. In particular we have an Events page on both sites and there may be events that are relevant to both companies.
The problem is that a Wagtail page can only exist in one place in the tree at once. I have considered creating a "MirroredEventPage" model with only one foreign key field to the original EventPage model, although this approach has it's problems when it comes to writing the EventIndex page and reusing templates.
I've also considered creating Events as a vanilla Django model which isn't ideal either.
Has anyone had a similar issue and found a good solution?
An idea would be to use a mix of using Wagtail Snippets and the RoutablePageMixin on your Events Index Pages.
1. Make an Events Snippet
Make the shared content of your Events page into a Wagtail Snippet. You will loose the ability to access versions of changes but gain the ability to share across sites.
http://docs.wagtail.io/en/v1.13/topics/snippets.html
2. Update your Events Index page model to use the RoutablePageMixin
http://docs.wagtail.io/en/v1.13/reference/contrib/routablepage.html
You can then hook into the URL calls for any of the Events Index pages if they have something like mydomain.com/events/123-event-name-as-slug. This can load a custom template (which can be shared or not, depending on the site), with the events index and the event snippet sent via the context.
These URLs will be their own unique URL but not actually have a page behind them. Remember to consider your SEO implications, ensure that the admin editors can manage things like meta description on the snippet (or work through how that will propagate automatically).
You can also hook into the Wagtail button (called Wagtail Userbar) so that when editors click the front end Wagtail button and click 'edit Event' it can take them directly to the Snippet editing page in admin.
http://docs.wagtail.io/en/v1.13/reference/hooks.html#construct-wagtail-userbar
3. Update Events Index Listing
If there are some events you do not want on both sites, you could add checkboxes (both ticked by default) for the two sites you operate. This means the Events Index page will only show the events relevant to that site.
You can do this by overriding the serve method on the page model.
Note: In this example you are not explicitly linking each and every event to each site's event index page. You are simply loading a query of relevant events and passing it to the events index template.
4. More Complex Integration
If you really want an individual page for each 'Event' under each site, you could create a custom signal on Snippet create/edit/delete.
Intro to Wagtail Signals:
http://docs.wagtail.io/en/v1.13/reference/signals.html
You would want to ensure that the fields are non-editable on the Page edit, but would be editable under snippets. Then you just keep things in sync with your signals, bit messy but gives you an actual 'Page' in the Admin.
When a custom form is created in Wagtail, I can see that it stores in the DB. What I'm not clear on is how to make it so that the admin UI contains the results in some manner. (A new link which lets you download a CSV would be fine, but I don't see how to do that)
How do I allow admin users the ability to see the results of the custom forms? Is this library the only way?
Once you create your first form page (i.e. a page of any page type that subclasses AbstractForm), a 'Forms' item will automatically appear in the left menu of the Wagtail admin. This provides a listing of all the form pages that exist on the site, allowing you to access the results of each one and download them as a CSV.