0

Can you set up a default widget to ipBlock(), same as you can create a slot and set defaults in

ipSlot('name',array('id'='id','tag'=>'tag','default'=>'default whatever));

?

demongolem
  • 9,474
  • 36
  • 90
  • 105

2 Answers2

0

No, you cannot set up default widget to blocks. However, you can show your example content.

ipBlock('block-name')->exampleContent('<p>Any HTML you want.</p>');

Most common usage is to create a real widget, copy the source code that is rendered (HTML) and paste as example.

I hope this will help.

  • What about creating a page where you have widgets places through ipSlot with some default data and then render this page into this block using `exampleContentFrom($filename)` ? – user3794253 Jul 02 '14 at 07:45
  • you can create a feature request on GitHub. And we'll see what we can do about it. – Audrius Jankauskas Jul 03 '14 at 20:39
-1

I tried this with the following code. It works fine with IP 4.5.2 and 4.6.0

<?php echo ipSlot('text', array(
    'id' => 'my_text_slot_1' . ipContent()->getCurrentPage()->getId(),
    'default' => '<img src="http://localhost/ImpressPages/Theme/MyTheme/images/my-image.png" alt="">')); ?>

okay, wrong answer but very nice to set non-static dummy-content into IP ;)

Snoopy
  • 1
  • 1