Topic Closed
juergen
1.5K Posts
54.4K Downloads
16 Plugins
design, web development & visual effects

Josh, one more question for new section type plugins and default content + default attributes.

Like in my StickyNote plugin I want to not only set a default content but also default attributes like classnames and styles.
Up to 4.3 it worked by returning a $section array including attributes instead of returning only the $default_content string in the GetDefaultContent Hook.
Returning the array still works (no error) but the attribs wont be there.
Is there a possibility to make it work in 4.4?

  function DefaultContent($default_content,$type) {
    if( $type != 'sticky_note_section' ) {
      return $default_content;
    }
    $section = array();
    $section['content'] = '<h4>Hi, I’m a new <br/>Sticky Note!</h4>' .
                          '<p class="edit_me">Edit me&hellip; </p>' .
                          '<p>My size adapts to my content. <br/>' .
                           'Use [Shift]+Return for <br/>line breaks.</p>';
    $section['uniqid'] = "sn-" . crc32(uniqid("",true));
    $section['attributes'] = array ('class' => 'draggable closable', 'style' => 'position:absolute; top:1em; left:auto; right:36px;');
    return $section;
  }
5 years ago#7429

Josh S.
2K Posts
283K Downloads
16 Themes
18 Plugins
Hmm, let me take a look, this should be possible. I was mulling over how to do section combos last night and this would be an important piece for <row><col><col></row> combos.
5 years ago#7433

Josh S.
2K Posts
283K Downloads
16 Themes
18 Plugins
Ok, should be working better now. I just pushed the fix to github... though now that I think about it, there may be another problem. The classes and style that the StickyNote plugin give to the section are not editable by the user
5 years ago#7434

Josh S.
2K Posts
283K Downloads
16 Themes
18 Plugins
Ok, should be all set now
5 years ago#7435

Topic Closed

 

News

elFinder 2.1.50 in Upcoming Release
12/28/2019

A new release for Typesetter is in the works with a lot of improvements including the ... Read More

Typesetter 5.1
8/12/2017

Typesetter 5.1 is now available for download. 5.1 includes bug fixes, UI/UX improvements, ... Read More

More News

creisi productions

Dienstleistungen von creisi productions, Luzern (Schweiz): * Konzeption, Planung und Erstellung Ihres Internet-Auftritts * Betreuung und Aktualisierung/Pflege Ihrer Website * ...

Find out more about our Provider Spotlight

Log In

  Register