How to docreate a function to do if conditions dependign on content type name {% if logged_in == false %} 
 &lt;div id="promoiton"&gt;
  &lt;div id="promotion-image"&gt;
   &lt;div id="promotion-bg"&gt;
   &lt;div id="promotion-text"&gt;
   &lt;h2&gt;Heading&lt;/h2&gt;
   &lt;p&gt;some text.&lt;/p&gt;
  &lt;ul&gt;
     &lt;li&gt;something here&lt;/li&gt;

   &lt;/ul&gt;
    &lt;button&lt;a class="btn btn-primary btn-lg" href="#" role="button"&gt;Learn
    more&lt;/a&gt;&lt;/button&gt;
   &lt;/div&gt;
  &lt;/div&gt;
 &lt;/div&gt;
&lt;/div&gt;
{% else %}

 &lt;iframe{{ attributes }}{% if url is not empty %} src="{{ url }}{% if 
 query is not empty %}?{{ query | url_encode }}{% endif %}"{% endif %}&gt;    
 &lt;/iframe&gt;
 {% endif %}


Hi Folks, in the code example above I have tried do doing some twig foo. It works greate if th user is looged out. 

But what if I like to seperate contnet types by machine name?

So for example you have two names lets say article and block

How to make shure that the field is visible on block but not on artivle for logged out users? in short what is the required functioon to get false or true bi a string containing the content type machine name to do something like 

 {% if logged_in == false || somefunction= 'content_type_machine_name' %}


Is that possible?
You can set a variable in hook_preprocess_Hook function which has the content type and then use that variable in twig file.

$node = \Drupal::routeMatch()->getParameter('node');
  $nids = $node->nid->value;
  if($nids){
    $variables['content_type'] = $node->bundle();
  }