Package - Config -

Discussion in 'Subrion CMS Packages Discussions' started by wazza, Jan 19, 2013.

  1. wazza

    wazza Member

    Hi Guys,

    Is there a way to make config options invisible if the main config is set to 0?

    what i want to do is if recipes_navigation_block is set to 0.
    Then recipes_navigation_types_block, recipes_navigation_occasions_block, recipes_navigation_diets_block do not show in config section (invisible)? And if enabled shows the other options.

    Please see below.Hopefully im not missing something obvious :D

    Just want to do this to tidy up config screen as its starting to look quit long and messy.

    Code (Text):
       
    <config group="myrecipe" name="recipes_navigation_block" values="1,0" type="radio" description="Enable Navigation Block">1</config>
       
        <config group="myrecipe" name="recipes_navigation_types_block" values="1,0" type="radio" description="Enable Type in Navigation Block">1</config>

        <config group="myrecipe" name="recipes_navigation_occasions_block" values="1,0" type="radio" description="Enable Occasional in Navigation Block">1</config>

        <config group="myrecipe" name="recipes_navigation_diets_block" values="1,0" type="radio" description="Enable Diets in Navigation Block">1</config>
     
    I didn`t see an option in the PackageStructure if this is not an option. maybe it can be a feature request?

    Regards,
    Quentin
    Last edited: Jan 19, 2013
  2. Janur_J.

    Janur_J. Staff Member

    Hi Quentin!

    There currently is no such option, unfortunately, but this is a good idea and helps to shorten the options list!
    We will think on inclusion of this feature.
  3. wazza

    wazza Member

    Hi Janur,

    I figured it was not possaible. Would be a nice addition though :D
    I am adding many pre installed blocks for my package so administrators can pick and choose what and how they want things displayed. Doing this though does make the config quite long.

    Regards,
    Quentin
    Last edited: Jan 21, 2013
  4. Vasily_B.

    Vasily_B. Project Manager

    Hi Quentin,

    This feature was implemented. Please check it here:
    / - Repository - Subrion CMS

    Specifically check the latest version of the following file:
    admin/templates/common/configuration.tpl
    includes/classes/ia.admin.extras.php

    + you need to create extra column for configs table 'show' and put dependency there.

    Let us know the results please.
  5. wazza

    wazza Member

    Awesome! Great to hear. Ill check it out now.

    Thanks Vasily
  6. wazza

    wazza Member

    Hi Vasily,
    How is the new feature referenced in the install.xml file.

    Im looking at the changes and see field_hide $value.show

    How does it link to the main config option?


    Example main config option is recipes_navigation_block. If block value is set to 0 (off) the the remaining blocks in that divider are hidden?

    Code (Text):
       

    <config group="myrecipe" name="recipes_navigation_block" values="1,0" type="radio" description="Enable Navigation Block">1</config>
       
        <config group="myrecipe" name="recipes_navigation_types_block" values="1,0" type="radio" description="Enable Type in Navigation Block">1</config>

        <config group="myrecipe" name="recipes_navigation_occasions_block" values="1,0" type="radio" description="Enable Occasional in Navigation Block">1</config>

        <config group="myrecipe" name="recipes_navigation_diets_block" values="1,0" type="radio" description="Enable Diets in Navigation Block">1</config>
    Last edited: Jan 22, 2013
  7. Vasily_B.

    Vasily_B. Project Manager

    Use this file Quentin ;)

    /admin/templates/common/configuration.tpl - Subrion CMS
    It's the latest one..

    Regarding the referencing:
    PackageStructure - Subrion CMS

    Check the configs section:
    [xml]
    <!-- The list of options for configurations of the package -->
    <!-- @group the option is placed to predefined tab on the Configuration page -->
    <!-- @name the name of the option. Should be unique -->
    <!-- @type the type of the option. Available: text, textarea, checkbox, radio, select, combo, divider, hidden, password, image, itemscheckbox -->
    <!-- @values the values of the option. Available for: select, combo, radio, checkbox -->
    <!-- @description the left-handed text part of the option that describes the option-->
    <!-- @show config option dependency, format FIELD_NAME|value -->
    <config group="newpackage" name="items_divider" type="divider">Items</config>

    <config group="newpackage" name="allow_guests_to_submit" type="radio" values="1,0"
    description="Allow Guests to Submit Items" show="accounts|1">1</config>
    [/xml]

    show stands for the field name and 1 stands for the mandatory config value to be set for this option to be displayed

    In your case you need to add show="recipes_navigation_block|1" attribute for all the dependent values.
  8. Vasily_B.

    Vasily_B. Project Manager

    So basically it works in the following way:

    Options are displayed if:
    1. no value in show column in config table
    2. if value set and field column value = config value
    Setting will be printed in either of these ways.
  9. wazza

    wazza Member

    Hi Vasily,

    I uploaded both files and upon package installaton there is no configuration set for the package. I mean the package Configuration screen is blank and the link to "Goto Config" is also gone.
  10. wazza

    wazza Member

    removing the new ia.admin.extras brings back the config
  11. wazza

    wazza Member

    I noticed alot of differences in the files. Might have to wait and install or update to
    the latest version of subrion.
    Last edited: Jan 22, 2013
  12. wazza

    wazza Member

    Hi Vasily,

    Just installed 2.3.2 version. Still same result.... Blank Configuration for package Config
  13. Vasily_B.

    Vasily_B. Project Manager

  14. wazza

    wazza Member

    Hi Vasily,

    I just done it again.
    Works Great.
    No idea what i did before because it worked first time i tried.

    Working like a charm.

    Thanks for adding this to Subrion :D

    Regards,
    Quentin
  15. Vasily_B.

    Vasily_B. Project Manager

    Always at your service. Consider this issue closed then.
  16. wazza

    wazza Member

    Issue? I think the issue was me :D haha
  17. wazza

    wazza Member

    Hi Vasily,

    Just had another thought on this.
    Would it make sense to make the configuration dividers collapsible?

    Just a thought.

    Quentin
  18. Vasily_B.

    Vasily_B. Project Manager

    Yep, sounds nicce
    But I think this would be impossible in current configuration implementation :(

    We will leave this request for now and try to implement it when we complete the brand new admin panel template and functionality ;)

    I've added it to our private todo list. Thanks for the request.
  19. wazza

    wazza Member

    Sounds great :D. New admin templates? I cant wait to see that. Any screens shots? sneek peak? :D

    Will you be implementing administration themes at some point?
  20. Vasily_B.

    Vasily_B. Project Manager

    yes, we have tons of plans. No screenshots for now,

    Anyway, it's going to be bootstrap based, clean, and powerful at the same time.

    Yes, we will use some features from admin themes from 3rd party resources, but generally it's going to be a native intelliants one!

Share This Page