Skip to content
This repository has been archived by the owner on Oct 23, 2019. It is now read-only.

Hooking Assets to custom Models/Controllers #20

Closed
amjo opened this issue Jun 12, 2017 · 1 comment
Closed

Hooking Assets to custom Models/Controllers #20

amjo opened this issue Jun 12, 2017 · 1 comment

Comments

@amjo
Copy link

amjo commented Jun 12, 2017

Hello,
now, i know this is tagged with "Enhancement" here: #6

however, if i were to implement this on my own, manually (not minding to edit bootstrap.php for instance), what's the proper procedure?

Currently i've added my own Model under /Plugin/Assets/Config/boostrap.php

// TODO: make this configurable via backend
$actions = array(
	'Nodes/admin_edit',
	'Blocks/admin_edit',
	'Types/admin_edit',
	'Projects/admin_edit',
);

AND

// TODO: make this configurable via backend
$models = array('Block', 'Node', 'Type', 'Project');

the tab is being added under admin/projects/edit/14 (for example), but it doesn't seem to be calling the $this->fetch('actions'); under Croogo/View/Common/admin_edit.ctp for it to show the browse/upload/refresh buttons

<?php if ($actionsBlock = $this->fetch('actions')): ?>
<div class="<?php echo $cssClass; ?>">
	<div class="actions <?php echo $columnFull; ?>">
		<div class="btn-group">
			<?php echo $actionsBlock; ?>
		</div>
	</div>
</div>
<?php endif; ?>

right now my View/Projects/admin_edit.ctp only has this:

<?php $this->extend('/Common/admin_edit'); ?>

Actually, now that i brainstormed when preparing this issue here, i realized this issue may have nothing to do with Assets, rather than croogo? I'm still learning, and i u can't imagine how much i praise your work. but if this is a bug with a work-around, it would be awesome. :)

/avz

@rchavik
Copy link
Member

rchavik commented Jun 13, 2017

Yes, I can duplicate the issue, but have not had a chance to track the cause.

The easiest workaround is just make a 'complete' view using bake

Console/cake bake view -p Projects Projects admin_edit

@amjo amjo closed this as completed Jan 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants