910
Views
5
Comments
Solved
Placeholders in a block
Question

Hi

I've been watching the learning path about blocks for a web reactive application.

And i dont understand the diference of using a input parameter instead of a placeholder.

As you can see in the image, the photo is in a placeholder of the block and the name, or job of the person are received by a input parameter..

Why the photo is not received by a input parameter ?



Captura de ecrã 2022-10-29, às 12.12.00.png
2023-10-21 19-42-11
Tousif Khan
Champion
Solution

To elaborate about this more, this is the structure we have for CardItem,

Placeholders On CardItem

  • Left,
  • Title ,
  • Content,
  • Right

In actual when you haven't placed anything into it it looks like this


For each thing which you want to use there is a place defined (placeholder)

However If you don't want to place your content according to it you can use it according to you. Its up to you how you will use it.

Hope it is clear !

2023-10-21 19-42-11
Tousif Khan
Champion

Hello

As it is alredy mentioned 

Place holder reserves space in your block for filling when the block is used.

It will reserve that space and when you will use that block on your screen then you have Idea that this is the place where I have to use this widget.

Example:

  • A block have 3 different placeholders
  • One For Image
  • One for Icon
  • One for label

For each placeholder space is defined, and when you will use this block on screen , you have an Idea where to place which thing so that it will be well organized.

For Input parameter In a block we have to create it, then from the screen if you want to pass some value to block you can pass the value and when any value is passed to block via input parameter

OnparameterChange event is triggered on a block.

We cannot receive binary data from input parameter  directly.

I hope this helps 

Thanks



2023-02-16 13-21-02
Joana Vieira

I dont understand your awsnwer... why the photo are in a placeholder and the name and the job dont?

2023-10-21 19-42-11
Tousif Khan
Champion
Solution

To elaborate about this more, this is the structure we have for CardItem,

Placeholders On CardItem

  • Left,
  • Title ,
  • Content,
  • Right

In actual when you haven't placed anything into it it looks like this


For each thing which you want to use there is a place defined (placeholder)

However If you don't want to place your content according to it you can use it according to you. Its up to you how you will use it.

Hope it is clear !

2021-09-06 15-09-53
Dorine Boudry
 
MVP

Hi @Joana Vieira ,

Input parameters and placeholders have completely different purposes.

In short and general terms, you use input parameters to pass information that can be used by the block's logic, you use placeholders to make ui elements subject to the blocks layout and styling.

Although this is not 100% airtight, as with javascript you could execute logic on the elements that were put in a placeholder or affect ui elements whose id was passed in as a parameter.

Dorine

2016-04-22 00-29-45
Nuno Reis
 
MVP

Hello Joana.

Most answers here are quite complete.

Just like in actions, an input parameter passes a value to the block scope and the block will use it (can change it) and discard it. There is no relation with the original value that stays safe on parent.

A placeholder is a bit different. Like the name says, it holds a place. So the block will get info from the parent, yes, but no specific type like inputs, and not editable. You can use that space to place an expression (to have a behaviour similar with what you are thinking about inputs), or an image (the most common example), or a block.... 

Imagine you have an commerce site and a page that lists all the products with an image. If you want to open a popup with more details, sure you pass the ProductId and fetch it all again, but you can also use the GetProducts from the main page, and simply send the texts and images to places in a new structure, saving a DB call.

The easiest way to see it, is by looking at Layouts. There you can see multiple skeletons of pages, where you are asked to place specific contents. Title, Actions, Breadcrumbs, Footer, Menu, Footer, etc.



Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.