Page 1 of 1

How to add an 'Edit' button on Mediumish theme?

Posted: Wed Feb 20, 2019 6:06 pm
by Renaud
I tried to copy and paste the following Blekathlon Theme code after he H1, but it does not work :

Code: Select all

<?php if($login->isLogged()) if($canEdit = checkRole(array('admin', 'editor'))):?>
	<a href="<?php echo HTML_PATH_ADMIN_ROOT.'edit-content/'.$page->slug() ?>" style="float:right" target="_blank">
		<svg class="icon" viewbox="0 0 32 32">
			<use xlink:href="#icon-pencil"></use>
		</svg>
		<span>Edit</span>
	</a>
<?php endif; ?>
It's a cool feature, is it possible :?:

Re: How to add an 'Edit' button on Mediumish theme?

Posted: Thu Feb 21, 2019 10:18 am
by bayerberg
you can have that functionality by using https://gum.co/adminbar. if you are an admin edit button will appear in the bar on any editable page

Re: How to add an 'Edit' button on Mediumish theme?

Posted: Thu Feb 21, 2019 10:29 am
by Renaud
OK, thank you very much.

Re: How to add an 'Edit' button on Mediumish theme?

Posted: Thu Feb 21, 2019 10:48 am
by Renaud
bayerberg wrote: Thu Feb 21, 2019 10:18 am you can have that functionality by using https://gum.co/adminbar. if you are an admin edit button will appear in the bar on any editable page
Could you tell me how to make it less high?
I added "padding-top: 2px; padding-bottom: 2px;" for #admin-strip, but it's just the black strip.

Thank you.

Re: How to add an 'Edit' button on Mediumish theme?

Posted: Thu Feb 21, 2019 10:53 am
by Renaud
In fact it's OK, thank you.