php - Multiple widget intances on ImpressPages 4.x -



php - Multiple widget intances on ImpressPages 4.x -

i created new widget generate sample data. examle:

contactwidget named widget makes contact template:

plugin/contactwidget/widget/contactwidget/skin/default.php

<?php $random_id = rand(100, 999); ?> <div class="iconbox"> <h4> <?php echo ipslot('text', array('id' => 'contact_'.$random_id.'_title', 'default' => 'title')); ?> </h4> <?php echo ipslot('text', array('id' => 'contact_'.$random_id.'_desc', 'default' => 'lorem ipsum dolor sit down amet, consectetur adipiscing elit. ut pharetra, erat commodo fringilla consequat, urna velit ultrices orci, vel tincidunt risus ex in nisl.', 'tag' => 'p')); ?> </div>

i used random() because of should unique id. when refresh page, missing data.

how can generate widget multiple instances editable slots

you generating id in skin. means id beingness generated on 1 time again on each page-view.

the right way extend default widget controller class , override defaultdata info method. place generate unique id , homecoming in array of default data. able utilize id in skin. aware going work new widgets.

how extend method: http://www.impresspages.org/docs/widgets (read php side section) http://www.impresspages.org/docs/class-ip-widgetcontroller (default widget controller class)

php impresspages

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -