1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Lack of Interest Multiple values for notice page criteria conditions?

Discussion in 'Closed Suggestions' started by RobParker, Jan 23, 2013.

  1. RobParker

    RobParker Well-Known Member

    The conditional page for notices (as well as various addons like Robbo's ad manager) has various options as below

    Screen Shot 2013-01-23 at 20.41.16.png

    What I'd like to do is have some of these fields contain multiple values (e.g. if there are several view class or content templates I'd like the notice to appear with).

    Is there a way to pass multiple variables into these fields?
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Nope. You would have to modify this code to check multiple values:

    library/XenForo/Helper/Criteria.php

    Code:
    				// browsing within the specified view
    				case 'view':
    				{
    					if (!isset($params['viewName']) || strtolower($params['viewName']) != strtolower($data['name']))
    					{
    						return false;
    					}
    				}
    				break;
    
    				// viewing the specified content template
    				case 'template':
    				{
    					if (!isset($params['contentTemplate']) || strtolower($params['contentTemplate']) != strtolower($data['name']))
    					{
    						return false;
    					}
    				}
    				break;
    
     
  3. RobParker

    RobParker Well-Known Member

    Does it make sense to request this as a change to the core? Is there any reason why multiple entries are bad?
     
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Yeah it's a good suggestion.
     
  5. RobParker

    RobParker Well-Known Member

    Can this be moved to Suggestions please?

    Was hoping Mike might notice while he's on a mission ;-)

    Edit: A "not" conditional, I.e. not using content template Xxxx would be another very useful addition.
     
  6. Brogan

    Brogan XenForo Moderator Staff Member

    Multiple values in the fields has already been suggested, but a "not" condition hasn't so I have moved it to Suggestions.
     
  7. RobParker

    RobParker Well-Known Member

    Thanks :)

    Either would make it much easier to add notices to only certain sections.
     

Share This Page