1

I have two view modes for the user profiles, the default one and a custom view mode called "Header". In the default view mode I have chosen to show the user history information ("Member for...") but in the Header view mode it shouldn't be shown.

I have included the user account settings in a feature in order to be able to export them. Everything else is fine but I don't find how to include the history visibility settings in it. When I reinstall the site with my feature, the "Member for..." information is shown in both of the view modes. I can manually hide it in the configuration page, but I must find how to export it into the code.

Does anyone know how this can be done?

1 Answer 1

0

If you've added a custom visibility option to User accounts. You'll need to figure out a way to export it to code. if they are just Fields then they should show up under export options for Fields when building a feature.

If on the other hand you've created a custom tab of sorts on the User Accounts page and have a bit of code managing some settings there -- you need to inform Drupal of those pieces of custom data.

Features Extras supports exporting visibility settings for blocks, and blocks in general.

To export a block, install FE Block, edit your block, give it a "machine name," export it with Features. You can export block settings (region settings, visibility settings, ...) of any block, and the content of blocks created with the Block module from Drupal core.

I recommend looking at that module and seeing how they export these settings. If I had to guess I'd say they use the Ctools Export API. There is a drupal handbook page on how to get started exporting configuration for your module.

3
  • Thank you for your answer. My problem isn't actually the custom fields etc. – those are included in the feature and exported, but I cannot find the core's 'member_for' visibility when I try to recreate my feature. It's not a field instance, a field base, nor a variable. I cannot see anything that would allow me to include it into the feature...
    – omun
    Commented Jun 2, 2014 at 15:21
  • right, so did you look at features extra to see how they achieve the same thing with block visibility settings ... ?
    – tenken
    Commented Jun 2, 2014 at 15:22
  • Thank you! That's it, I'm sorry I didn't understand that at the first lecture of your message. In the Features Extra module there is FE Profile module that allows to add a variable for that setting.
    – omun
    Commented Jun 2, 2014 at 15:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.