Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Tweeted twitter.com/StackDrupal/status/822123122270896129

How to add Visibility Settings option for node/content typeblock-like visibility settings to nodes?

I have created a custom content type for campaign'campaign' in my module using:

hook_node_info()

hook_node_info() and addadded fields using:

hook_field_group_info().

hook_field_group_info(). This campaign content type will be showingshown to userusers site wide in modalmodals/popuppop-ups using CTOOLCTool modal on page load.(hook_init  ()hook_init()).

What I'm looking for is, to give an option to ADMINadmins to restrict this popuppop-up/modal for different roles or paths. Same Same like BLOCKblock section is doing, for. For example whether to show a block on node/104node/104 or not.

OR
Show, or wether to show a block for (Anonymousanonymous) usersusers only or vise versanot. Like shown in the screenshot below.

So![enter image description here][1] [1]: https://i.sstatic.net/BccU1.png

My aim is that, while creating campaign ADMIN will'campaign' nodes, admins should be able to select pages or roles to show that particular campaign or not.

Can you please guide me that how can I use Drupal block section logic here,that will save my day, or should I? Or do you maybe can make some code for thissuggestions I can start with in my custom module?

enter image description here

Any help would be appreciated.

Cheers

-Zafar

How to add Visibility Settings option for node/content type

I have created a custom content type for campaign in my module using:

hook_node_info()

and add fields using:

hook_field_group_info().

This campaign content type will be showing to user site wide in modal/popup using CTOOL modal on page load.(hook_init())

What I'm looking for is, to give an option to ADMIN to restrict this popup/modal for different roles or paths. Same like BLOCK section is doing, for example whether to show block on node/104 or not.

OR
Show block for (Anonymous) users only or vise versa.

So while creating campaign ADMIN will be able to select pages or roles to show that particular campaign or not.

Can you please guide me that how can I use Drupal block section logic here,that will save my day, or should I code for this in my custom module?

enter image description here

Any help would be appreciated.

Cheers

-Zafar

How to add block-like visibility settings to nodes?

I have created a custom content type 'campaign' in my module using hook_node_info() and added fields using hook_field_group_info(). This campaign content type will be shown to users site wide in modals/pop-ups using CTool modal on page load  (hook_init()).

What I'm looking for is, to give an option to admins to restrict this pop-up/modal for different roles or paths. Same like block section is doing. For example whether to show a block on node/104 or not, or wether to show a block for (anonymous) users only or not. Like shown in the screenshot below.

![enter image description here][1] [1]: https://i.sstatic.net/BccU1.png

My aim is that, while creating 'campaign' nodes, admins should be able to select pages or roles to show that particular campaign or not.

Can you please guide me how can I use Drupal block logic here? Or do you maybe can make some code suggestions I can start with in my custom module?

Bumped by Community user
Bumped by Community user
Bumped by Community user