• I am hoping this is simple enough for you to help me here.

    I have created a custom list template and want to do the following:

    I have a number of fields i.e. email, address, phone etc which for some records I do wish to be displayed. I also have a field named do_not_show which contains a multi-select array with a list of fields which should not be shown for that particular record.

    Where and how in the loops do I put my code to check the contents of the do_not_show field to then be able to blank out the display of the particular field.

    I am of a mind to put a piece of php code inside the record re-iteration to set a flag for each of the possible fields and then use these flags to determine wether the field content is shown or not. What I am not sure of is how to do the first part.

    Malcolm

Viewing 1 replies (of 1 total)
  • Plugin Author xnau webdesign

    (@xnau)

    Is there a reason why you don’t just set that field to not be displayed in the list? The global setting for that is in the field definition on the Manage Database Fields page…the “display column” field…set that to 0 to not display that field in your list.

    If you need to show it for some records and not others, this is best done in your custom template for your list. In that template there is a loop that goes through every field for each record. In that loop, you set up a condition that checks whether the field should be displayed or not.

    You can see the basic idea (but for a different purpose) in this tutorial:

    Adding an Edit Record Link to the Frontend List

Viewing 1 replies (of 1 total)
  • The topic ‘Hide a fields content dependant on content of another field’ is closed to new replies.