Jump to content

Designme - Visually Layout Your Edit Screens - Preview


joshuag

Recommended Posts

2 hours ago, elabx said:

Namespace issue?? Try adding namespace ProcessWire at the very top

I'd already done that it just changes the message from "Call to undefined function _(), did you mean d()?" to "Call to undefined function _(), did you mean processwire\__()? "
 

Edit: if I add wire()-> then the error goes (until the next  _(‘...’)  ). I could try doing that throughout but it seems like there ought to be a better answer than hacking the code like that. 

Link to comment
Share on other sites

Ta @bernhard - $this fixes that error (without adding namespace), but there seem to be other issues. $out on line 68 of inc/sidebar.php is 'not defined' - I'll investigate more, but I'd be interested if  anyone else has had to make changes, or whether it might be something to do with my environment. (I downloaded the files from the zip link that was posted above).

Edit: Just replace $out .= by $out = on line 68 and it all seems to be working. It looks interesting - could speed up dev time quite a bit - but need to use it for a while to see.

Link to comment
Share on other sites

Having got it working, I'm pretty impressed. The only problem so far is that the js (something in Designme.2.js) interferes with an InputfieldPageListSelect in the site I am testing it on. This is not a standard PageListSelect field (those seem to be OK), but one in an iframe created by a hanna tag attribute input using HannaCodeDialog. I have a hook thus:

wire()->addHookAfter('HannaCodeDialog::buildForm', function(HookEvent $event) {
    // The Hanna tag that is being opened in the dialog
    $tag_name = $event->arguments(0);
    // The form rendered in the dialog
    /* @var InputfieldForm $form */
    $form = $event->return;

    if($tag_name === 'ImagePage') {
        $modules = $event->wire('modules');
        // Generate page list
        $f = wire()->modules->InputfieldPageListSelect;
        $f->set('parent_id', 1025);
        $f->name = 'imagePage';
        $f->id = 'imagePage';
        $f->label = 'Select image page';
        $form->add($f);
    }
});

(thanks to @Robin S for the idea). This hook enables me to select image pages with additional metadata (e.g., caption, url) which is then rendered by the template. Without Designme installed, the interactive attribute entry works correctly as a page list select. With Designme, it just shows a text box with the imagePage id. Turning off Designme.2.js also fixes it, without doing a complete uninstall (but obviously, then Designme does not work!).

Link to comment
Share on other sites

On 7/24/2020 at 7:34 PM, MarkE said:

The only problem so far is that the js (something in Designme.2.js) interferes with an InputfieldPageListSelect in the site I am testing it on. This is not a standard PageListSelect field (those seem to be OK), but one in an iframe created by a hanna tag attribute input using HannaCodeDialog.

Problem solved (sort of): The problem is caused by the HannaCodeDialog iframe effectively removing the <div id="dm-editor-content"> from the current DOM. This causes an error in Desigme as ACE can't find #dm-editor-content. Ideally, Designme should detect that #dm-editor-content is missing and not call ACE. My temporary inelegant fix/hack is to add <div id="dm-editor-content"></div> to the HannaCodeDialog iframe_form.php. Maybe someone cleverer than me can suggest the best way of fixing Designme (in designme.editor.js - the problem is line 58) ?

EDIT: In the absence of better ideas, I have modified design.me.editor.js as follows (line 419 et seq)

$(document).ready(function(){
	if ($('#dm-editor-content').length) {
		designme.editor.init();
	}
});

@elabx - Is this on Github or some such for PR (I have 2 mods now) or do users just keep their own branches?

Link to comment
Share on other sites

  • 4 months later...
  • 6 months later...

Hey guys,

I'm quite new at the forum but not new on PW.

I've been reading lately here in the forum about page builders implementation and things like that, for PW next step, honestly there should be a community collaboration on this one.
This is the one that everyone should work on and make PW shine on it. This is where every single cms/cmf have been failing, including WP.

Think about it community. There are really strong coders here that picking up this one could take PW to the next level, its own freaking awesome level.

Great job for those two dudes that started this and thanks for sharing it with the community.

Is there any git repo for this?

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...