Author Topic: Assigning Map icons based on templates  (Read 1388 times)

Tursiops

  • Sr. Member
  • ****
  • Posts: 479
    • View Profile
Assigning Map icons based on templates
« on: November 15, 2015, 10:56:35 pm »
Hi,

I'd like to be able to assign map icons based on a template (e.g. to allow using per-vendor icons for printers, servers, etc.).
Current templates do not seem to support that functionality (at least there is no direct option for that within the template properties).
Any idea how else this could be achieved?

AleCoelli

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Assigning Map icons based on templates
« Reply #1 on: January 28, 2020, 10:21:27 am »
+1

Filipp Sudanov

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 445
    • View Profile
Re: Assigning Map icons based on templates
« Reply #2 on: January 29, 2020, 01:02:56 pm »
You could create Hook::ConfigurationPoll script and change icon for node with NXSL script. It is necessary to specify GUID of image, currently in image library GUIDs are not visible, but will be visible starting from version 3.2 that should be out soon.

AleCoelli

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Assigning Map icons based on templates
« Reply #3 on: January 29, 2020, 01:12:20 pm »
You could create Hook::ConfigurationPoll script and change icon for node with NXSL script. It is necessary to specify GUID of image, currently in image library GUIDs are not visible, but will be visible starting from version 3.2 that should be out soon.
Hi Filipp, I'm trying to to exactly what you wrote.. can you link some documentation or (better) one example?
thanks

Alessandro

Filipp Sudanov

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 445
    • View Profile
Re: Assigning Map icons based on templates
« Reply #4 on: January 31, 2020, 04:05:00 pm »
Code: [Select]
templates = $node->templates;
foreach(t : templates)
{
   if (t->name == "Windows") {
      $node->setMapImage("Windows");
      break;
   }
}