backdrop-contrib / conditional_content_block

A module that let's you provide different content options for different roles.
GNU General Public License v2.0
0 stars 0 forks source link

Feedback - Ideas - Feature Requests #1

Open stpaultim opened 2 years ago

stpaultim commented 2 years ago

General Feedback on this Module

This is what the UI looks like right now.

block-visibility

yorkshire-pudding commented 2 years ago

One thought I had is allowing this to be defined for other roles also rather than just authenticated and unauthenticated. You might then have n fields where users can add a line, select the role and define the content.

docwilmot commented 2 years ago

As far as code goes:

stpaultim commented 2 years ago

One thought I had is allowing this to be defined for other roles also rather than just authenticated and unauthenticated. You might then have n fields where users can add a line, select the role and define the content.

Thanks. I did have this in mind as one possible route forward. I appreciate the feedback.

@docwilmot - thanks for all the suggestions. They look very helpful, I need to dive in and look them closer. We are getting into areas in which I'm very much a beginner and rely a lot on hacking existing code. At this point, my main goal was to get SOMETHING that worked - a simple version. Now, I'm trying to figure out next steps.

stpaultim commented 2 years ago

@docwilmot - Implemented all your suggestions. All good and helpful in terms of me understanding what I'm doing. Started out hacking existing code without fully understanding it, as of now I have a better understanding of what most of the code is doing.

Big thanks.

docwilmot commented 2 years ago

Glad to help. One small thing, filter_xss_admin only takes strings, but you're passing it an array.

stpaultim commented 2 years ago

@docwilmot - Is this better?

      $block_first_text = $settings['ccb_first_message'];
      $block_second_text = $settings['ccb_second_message'];
      $block_first_message = filter_xss_admin($block_first_text['value']);
      $block_second_message = filter_xss_admin($block_second_text['value']);
docwilmot commented 2 years ago

Yep that looks good