AAD Web Team Posted January 2 Share Posted January 2 I'm looking to add an icon next to the page title in the page tree, similar to how pages in draft state (with ProDrafts) can be identified by the little paperclip icon. What is the best way to go about this? I tried diving through the source code of a few modules and I suspect I need to hook into 'ProcessPageListActions::getExtraActions'? Link to comment Share on other sites More sharing options...
bernhard Posted January 2 Share Posted January 2 You can use custom page classes and add a getPageListLabel() method: It can be a problem though that this markup also ends up in the main navigation and also in page select fields. You can hide those elements via CSS though: // site/classes/YourPageClassPage.php public function getPageListLabel() { return "<span class=foo>foo</span> " . $this->title; } /* /site/templates/admin.less */ .PageListPage.label .foo { border: 2px solid red; } Another option is to use RockMigrations + MagicPages, then you can simply add "pageListLabel()" instead of "getPageListLabel()" and you'll get the modified label in the pagetree but not in the menu. This is the hook I'm using: https://github.com/baumrock/RockMigrations/blob/85c28fb97411f2af1ab3c77d3911b777d3f77ccf/MagicPages.module.php#L268-L290 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now