• Resolved Hozefa Saleh

    (@hozefasmile)


    Can we ustilize the filter mentioned in https://lazyblocks.com/documentation/php-filters/lzb-block_render-callback/ to create a different variation of output the a block is giving ? three variables $result, $attributes, $context is mentioned in the doc, but example is quite simple not utilized these, how to utilize $result specially in this case ? and can we use this filter to have two different frontend output for a registered single registered block ?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author nK

    (@nko)

    Hey.

    You can use $attributes to check your controls values and return custom output. The $output variable contains default block output. Also, you can use as many filters, as you want https://developer.www.ads-software.com/reference/functions/add_filter/

    I don’t quite understand your case and the problem.

    Regards, nK.

    Thread Starter Hozefa Saleh

    (@hozefasmile)

    Hi nK,

    Thanks for your reply,

    I mean to say, can I have a example code of case to understand this.

    Let suppose, we have a testimonial block, and I have to design output plan for it, one section have an another field and its html going to change its position too ( instead of coming first , going to come later )

    So in simple language let there be thumb image, name, testimonial text, and star rating in a testimonial block. We need an another version of same testimonial but fields in this order – thumb image, name, position ( extra field ), star rating and testimonial text. So how this filter can help us to output the html in that way ?

    Thanks
    Hozefa

    Plugin Author nK

    (@nko)

    Hey Hozefa.

    I think you can check our example of an Alert block. There is an example of PHP output with conditionally displaying the Close button using one of the available block attributes. https://lazyblocks.com/documentation/examples/alert-block-bootstrap/

    This is something like basic PHP coding, I don’t think I can help you write the block output, you will need to resolve it by yourself.

    Regards, nK.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘field control variation’ is closed to new replies.