How to determine new Challenge Rating when applying Shadow Dragon template?

The Monster Manual contains a template whereby any true dragon may be turned into a shadow dragon. A shadow dragon differs from a true dragon in the following ways:

  • It has resistance to necrotic damage always, and resistance to all other forms of damage except force, psychic and radiant, when in dim light or darkness.
  • It has double proficiency in Stealth.
  • It can Hide as a bonus action when in dim light or darkness.
  • It has sunlight sensitivity (disadvantage on attack rolls and Perception checks involving sight when in sunlight).
  • The damage type of both its bite and its breath weapon is necrotic (regardless of type of dragon).
  • A shadow rises from the corpse of any humanoid killed by its breath weapon.

Otherwise, the shadow dragon has the same stats as the true dragon. How do you evaluate these differences to come up with a new Challenge Rating? Right now I am specifically looking for the CR of a Black Shadow Dragon Wyrmling, but the best answer will explain how to determine the CR of all types of shadow dragon.

One clue: The Monster Manual provides one example stat block for a shadow dragon: a Young Red. The CR of a Young Red Shadow Dragon is 13, while the CR of a Young Red Dragon is 10. Is merely adding 3 to the CR a good rule of thumb?

Use custom template for custom entity in D8

I have created a custom entity via drupal console, and it created template item_entity.html.twig in template folder, but the entity is being rendered in some other way because any changes in template not work. How to figure out how this process works and to make it rendered through a custom template?

Entity definition:

* @ContentEntityType(  *   id = "item_entity",  *   label = @Translation("Item entity"),  *   handlers = {  *     "view_builder" = "Drupal\Core\Entity\EntityViewBuilder",  *     "list_builder" = "Drupal\item\Utils\Item\ItemEntityListBuilder",  *     "views_data" = "Drupal\item\Entity\ItemEntityViewsData",  *     "translation" = "Drupal\item\Utils\Item\ItemEntityTranslationHandler", 


entity.item_entity.canonical:   path: '/item/{item_entity}'   defaults:   # Calls the view controller, defined in the annotation of the item entity     _entity_view: 'item_entity'     _title: 'Item Content'   requirements:   # Calls the access controller of the entity, $  operation 'view'     _entity_access: 'item_entity.view' 

In twig file data is rendered from:

<!-- BEGIN OUTPUT from 'core/themes/stable/templates/layout/region.html.twig' --> 

Save site as a template for Modern Team and Communication Site in SharePoint Online

Is there a way to save site as a template if you are using Modern sites? I have followed some tutorials online where you use a script to enable scripting on site. I have also made sure if the Publishing features are disabled.

Is there a way to save modern sites as template. It was easy to do in Classic sites. Is this even an option for modern sites?

How to skip any category in seo meta title template?

We have magento 2 on website we have 4 categories, we sell photocopier parts, let me give an example what issue we are facing and what we want.

Konica Minolta – Bizhub Color Series- Bizhub 203 – Toner Cartridges Category 1 – Category 2 – Category 3 – Category 4

We have magewrox seo suit installed on website , we made a template for meta titles when we call categories in this template the meta title goes like this

“Konica Minolta Bizhub Color Series Bizhub 203 Toner Cartridges”

We want to skip series category in seo templates , but when we change the sequence like Category 1 – Category 3 – Category 4 on different pages and stages it catches the sequence at current stage of ccategory breadcrumbs and does not skip. We want to show this category to customers but want to hide and skip it in meta titles. We talked with magewrox they said that it is not possible in their extension. Do we have any customization in which we can show category on front end but it should be hidden in seo templates. Like on any page when we call category 2 in any template it should not consider the series category it should consider next one as category 2. Hope it make sense if you dont understand I will try to elaborate it more

How can I change the css attributes of the sub-item of theme template in my custom module?

I use the system built-in block of “User account menu” in my page. The twig file is core/themes/classy/templates/navigation/menu.html, and this is the html output:

<ul class="menu">     <li class="menu-item">         <a href="/en/user" data-drupal-link-system-path="user">My account</a>     </li>     <li class="menu-item">         <a href="/en/user/logout" data-drupal-link-system-path="user/logout">Log out</a>     </li> </ul> 

But what I really want to get is like this, just simply remove the little black dot before each <li> element:

<ul class="menu">     <li class="menu-item" style="list-style: none">         <a href="/en/user" data-drupal-link-system-path="user">My account</a>     </li>     <li class="menu-item" style="list-style: none">         <a href="/en/user/logout" data-drupal-link-system-path="user/logout">Log out</a>     </li> </ul> 

How can I do that in my custom module without change the core twig template?

I’ve tried this which only change the style for the top element of <ul>, the black dot before each <li> still exists:

function xylogin_preprocess_menu(&$  variables) {   $  variables['attributes']['style'][] = "list-style:none;"; } 

Getting values on twig node template

I have installed ECK module in my website. Using it I have created a “report eck” entity in which I have different bundles like section, notes, etc., each containing different fields. I have my content type “Report” in which I have referred “report eck” entity using entity reference field. Now, in my nice template, I need to get various values including the bundle type, in which I am facing lots of trouble. My bundle type is coming up as following when I am doing kint() on my reference field, but I am not able to get this bundle type and many other values, please guide. enter image description here

Also, it seems to be a protected values, so I navigated to “Available Methods” tabs and found method ‘getEntityKey()’ which seems to be useful, but how can I use it in twig template??

enter image description here

Custom file template for C files in CLion

I want to create author header for C file in CLion (it use Apache Velocity template language) wich looks like this:

/*********************************/ /* $  {FILE_NAME}                  */ /*                               */ /* By: $  {USER}                   */ /*                               */ /* Created: $  {DATE} by $  {USER}   */ /* Updated: $  {??} by $  {USER}     */ /*                               */ /*********************************/ 

There are two problems:
1. How to add Updated date and how can I change it format?
2. I want to fix the width of header, now its width varies depending on length of the FILE_NAME and USER. How can I fix it?

Theme preprocess for module’s template variables using dynamic path

I am doing templating for a module that adds a block in the module’s folder so that the template can be there, and it may be overridden in the theme if desired. I want the module to support different “sources” (but only one will be active/used at a time), which may each have a separate template and variable preprocessing. I have hook_theme() working, and the template works. But the .vars.php file I have contains the preprocess function, and it doesn’t get called.

Here is a basic example of what I have:


function MODULE_theme($  existing, $  type, $  theme, $  path) {   $  source = '';   switch ($  source) {     case 'SRC_A':       $  path .= '/sources/SRC_A/theme';     default:       $  source = 'default';       $  path .= '/theme';   }    return array(     'MODULE_block' => array(       'path' => $  path,       'variables' => array('data' => array(), 'source' => $  source),       'template' => 'MODULE-block',     )   ); } 


(contains template HTML with references to PHP variables) 


/**  * Implements template_preprocess_HOOK() for theme_MODULE_block().  */ function template_preprocess_MODULE_block(&$  vars) {   // Add variables before they get to the template file.   $  vars['some_key'] = 'some_value'; } 

I originally was trying to modify the $ template value in hook_theme() to MODULE-block--SRC-A, but I decided that didn’t matter, and if only one template is active at once I should just call them all MODULE-block.tpl.php regardless of the source, since they are all in different folders.

The template works, and adding a template in my theme will correctly override it. But the .vars.php file with the preprocess function does not seem to do anything unless it is in my actual theme and is THEME_preprocess_MODULE_block instead.

I’m still pretty new to this, but I looked at a lot of pages online, and there aren’t any similar examples in my code base that have a module-specific .vars.php file that is located in the module’s folder rather than in the theme.

I do not know what I am doing wrong. Any ideas?

Get related items while looping in Django template

I am trying to access a related object (PaymentDetail if it exists) while looping through a _set list of objects (Registrations).

My models look like this:


class Registration(models.Model):     person = models.ForeignKey(Person, on_delete=models.PROTECT)     course_detail = models.ForeignKey(         CourseDetail,         on_delete=models.PROTECT     )     comments = models.CharField(max_length=200, blank=True, null=True)      def __str__(self):         return '%s' % (      class PaymentDetail(models.Model):         payment = models.ForeignKey(Payment, on_delete=models.PROTECT)         registration = models.ForeignKey(             Registration,             on_delete=models.PROTECT) 

In my views I’m just getting a queryset of desired people and passing it to the template (these display fine).


def index(request, **kwargs):     people = Person.get_related_people('first_name')     return render(request, 'people_app/index.html', {         'people': people,     }) 

As I am looping through them in the template – I am displaying the associated Registrations for these people. While I’m looping through those registrations – I’m trying to see if there is a PaymentDetail associated with that Registration

In my template I’m looping through the registration_list like this:


{% for person in people %}     {% for registration in person.registration_set.all %}         {{ }}          {% if registration.paymentdetail_set|length > 0 %}             PAID         {% else %}             NO PAYMENT         {% endif %}     {% endfor %} {% endfor %} 

As you may imagine – this doesn’t work and always shows as NO PAYMENT even when the PaymentDetail exists.