Some facts you most know about Blogger Macro XML Template code

Blogger supported macros for all templates in version 2. This article will help you understand about the macro in XML template code. What

Blogger Macro XML Template Code
Blogger Macro XML Template Code

What are macros?

Macros are Blogger XML functions which allow parameters. Those functions will process parameters and output specific codes depending on values of the parameters. A macro has two parts: includable (declaration code) and include (call to action code)
The includable code is usually placed under the </body> tag. Syntax is like below:

<macro:includable id='your_function_name' var='name_of_param_list'>
 <!-- output a param -->

 <!-- compare a param -->
 <macro:if cond='data:name_of_param_list.name_of_param_2 == 2'>
  <!-- do something here -->
You can use any texts you want for your_function_namename_of_param_list and name_of_param. For Loops and Branching syntaxes in your function, please follow: Loops and Branching in Blogger XML code, but replace b: with macro:.
The include code can be called inside <body>...</body> tags. The syntax is:

<macro:include id='name_of_macro_include' name='your_function_name'>
 <macro:param default='default-value-here' name='name_of_param_1' value='current-value-here'/>
 <macro:param default='1' name='name_of_param_2' value='10'/>

Code Examples

The below includable code is a macro declaration for sneeit_example function:

<macro:includable id='sneeit_example' var='my_params'>
 <macro:if cond='data:my_params.num == 0'>
  <b:section mexpr:class='data:my_params.class' mexpr:id='data:my_params.idPrefix + &quot;-2-2&quot;'/>
Then I will call my macro function somewhere in my template with the below include code

<macro:include id='display-column-sections' name='sneeit_example'>
 <macro:param default='2' name='num' value='4'/>
 <macro:param default='div' name='idPrefix'/>
 <macro:param default='div-block' name='class'/>
 <macro:param default='&quot;Your number is empty&quot;' name='message'/>

Special Blogger Macros

You can use any texts for name_of_macro_include. But Blogger has some special macro include names: main-column-left-sections or main-column-right-sections (must come together) or footer-sections which are used for Blogger Template Designer Layout. Look the below picture for more information:Understanding about Blogger Macro XML Template CodeBelow is the example code of those special macro includes:

<aside id='sidebar-left'>
 <macro:include id='main-column-left-sections' name='sections'>
   <macro:param default='0' name='num' value='0'/>
    <macro:param default='sidebar-left' name='idPrefix'/>
    <macro:param default='sidebar' name='class'/>
    <macro:param default='true' name='includeBottom'/>

<div id='main'>
 <b:section id='content'>
  <b:widget id='Blog1' locked='true' title='Blog Posts' type='Blog'/>

<aside id='sidebar-right'>
 <macro:include id='main-column-right-sections' name='sections'>
  <macro:param default='2' name='num' value='1'/>
  <macro:param default='sidebar-right' name='idPrefix'/>
  <macro:param default='sidebar' name='class'/>
  <macro:param default='true' name='includeBottom'/>

<footer id='footer'>
 <macro:include id='footer-sections' name='sections'>
  <macro:param default='2' name='num' value='1'/>
  <macro:param default='footer' name='idPrefix'/>
  <macro:param default='foot' name='class'/>
  <macro:param default='false' name='includeBottom'/>

Advantages of Macro

First, if you use a b:section inside an HTML5 tag in your template code, your template users will not see this section in their admin Layout page. So you can use macros to output your sections at anywhere you want without worry about missing anything in admin dashboard.
Second, your users can change their template layout dynamically if you use special macro includes above. Of course, you will need to work harder to make sure your template can work properly in all cases.



Ads Earning Guide,4,AdSense Alternatives,1,Affiliate Marketing,1,Anti-Hacking Solution,2,Bitcoin,1,Blogger SEO,1,Blogger Tutorials,26,Blogger Widget,1,Blogging Tips,13,Business and Marketing,11,BuySellAds,1,Content Marketing,4,Contextual Marketing,2,Copyrighting,1,CPC Keywords,1,Digital Marketing,6,Download,1,Drupal Theme,1,Drupal Tutorials,8,Earning Guide,4,eCommerce Solution,1,Email Marketing,3,Facebook Marketing,1,Games Source Code,2,Google AdSense,4,HTML Script,1,Infographics,2,Information Technology,8,Instagram Marketing,1,Joomla Tutorials,1,jQuery Script,1,JS Script,1,Keyword Research,3,Learn Code,3,Learn CSS,1,Learn HTML,1,Learn XML,2,Make Money Online,6,Media Dot Net,1,MySQL Tips,1,Off Page SEO,1,On Page SEO,2,Online Tools,4,Paid URL Shortener,1,PC Tutorials,7,PHP Development,1,PHP Script,3,PPD File Sharing,1,Reviews,1,SEO Tips,4,Social Marketing,3,Template and Theme,2,Video Marketing,3,Web Design,8,Web Hosting Reviews,1,Website Script,4,WordPress Plugin,2,WordPress Script,1,WordPress Security,2,WordPress Theme,1,WordPress Tools,1,WordPress Tutorial,2,WordPress Tutorials,5,YouTube,1,
Teach Sansar - Leading Digital Technology: Some facts you most know about Blogger Macro XML Template code
Some facts you most know about Blogger Macro XML Template code
Blogger supported macros for all templates in version 2. This article will help you understand about the macro in XML template code. What
Teach Sansar - Leading Digital Technology
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy