Template:CodeBox: Difference between revisions

From PZwiki
m (add ToggleBox to see also)
m (Automated CodeBox update)
Line 21: Line 21:
   | code =
   | code =
item BucketEmpty
item BucketEmpty
{
{
  DisplayCategory = WaterContainer,
    DisplayCategory = WaterContainer,
  Weight = 1,
Weight = 1,
  CanStoreWater = TRUE,
CanStoreWater = TRUE,
  Type = Normal,
Type = Normal,
  DisplayName = Bucket,
DisplayName = Bucket,
  Icon = MetalBucket,
Icon = MetalBucket,
  ReplaceOnUseOn = WaterSource-BucketWaterFull,
        ReplaceOnUseOn = WaterSource-BucketWaterFull,
  MetalValue = 20,
        MetalValue = 20,
  RainFactor = 1,
        RainFactor = 1,
  Tooltip = Tooltip_item_RainFromGround,
Tooltip = Tooltip_item_RainFromGround,
  EatType = Bucket,
        EatType = Bucket,
  SurvivalGear = TRUE,
        SurvivalGear = TRUE,
  WorldStaticModel = Bucket_Ground,
        WorldStaticModel = Bucket_Ground,
}
}  
  }}
}}
}}
}}
</pre>
</pre>
Line 50: Line 50:
   | code =
   | code =
item BucketEmpty
item BucketEmpty
{
{
  DisplayCategory = WaterContainer,
    DisplayCategory = WaterContainer,
  Weight = 1,
Weight = 1,
  CanStoreWater = TRUE,
CanStoreWater = TRUE,
  Type = Normal,
Type = Normal,
  DisplayName = Bucket,
DisplayName = Bucket,
  Icon = MetalBucket,
Icon = MetalBucket,
  ReplaceOnUseOn = WaterSource-BucketWaterFull,
        ReplaceOnUseOn = WaterSource-BucketWaterFull,
  MetalValue = 20,
        MetalValue = 20,
  RainFactor = 1,
        RainFactor = 1,
  Tooltip = Tooltip_item_RainFromGround,
Tooltip = Tooltip_item_RainFromGround,
  EatType = Bucket,
        EatType = Bucket,
  SurvivalGear = TRUE,
        SurvivalGear = TRUE,
  WorldStaticModel = Bucket_Ground,
        WorldStaticModel = Bucket_Ground,
}
}  
  | hidecat = true
}}
  }}
}}
}}



Revision as of 13:50, 26 March 2024

Notebook.pngTemplate Documentation

The {{CodeBox}} template is used to hide and display a code snippet, to reduce page length for the average user.

Usage

Usage: {{CodeBox|This text will be hidden}}

Produces:
Code icon.png Code snippet! This section contains source code from Project ZomboidShow / Hide

This text will be hidden

Examples

The below is an example of typical usage alongside {{CodeSnip}}.

{{CodeBox
| {{CodeSnip
  | lang = java
  | line = true
  | start = 92
  | source = items.txt
  | retrieved = true
  | version = 41.78.16
  | code =
item BucketEmpty
	{
	    DisplayCategory = WaterContainer,
		Weight	=	1,
		CanStoreWater	=	TRUE,
		Type	=	Normal,
		DisplayName	=	Bucket,
		Icon	=	MetalBucket,
        ReplaceOnUseOn = WaterSource-BucketWaterFull,
        MetalValue = 20,
        RainFactor = 1,
		Tooltip = Tooltip_item_RainFromGround,
        EatType = Bucket,
        SurvivalGear = TRUE,
        WorldStaticModel = Bucket_Ground,
	} 
}}
}}

Produces:

Code icon.png Code snippet! This section contains source code from Project ZomboidShow / Hide

Source: ProjectZomboid\media\scripts\items.txt

Retrieved: Build 41.78.16
item BucketEmpty
	{
	    DisplayCategory = WaterContainer,
		Weight	=	1,
		CanStoreWater	=	TRUE,
		Type	=	Normal,
		DisplayName	=	Bucket,
		Icon	=	MetalBucket,
        ReplaceOnUseOn = WaterSource-BucketWaterFull,
        MetalValue = 20,
        RainFactor = 1,
		Tooltip = Tooltip_item_RainFromGround,
        EatType = Bucket,
        SurvivalGear = TRUE,
        WorldStaticModel = Bucket_Ground,
	}

How to translate

This template doesn't need to/shouldn't be translated, but you can translate the documentation of this template with the following steps:

  1. Create a subpage of this template with the language code of the language you want to translate to.
  2. Copy the code wrapped in the <noinclude> tag in this template into the page you created.
    {{Translation guide}} template should be removed from the translated documentation.
  3. Translate the page according to the translation requirements of normal pages.

See also

Editors can experiment in this template's sandbox.