Some facts you most know about Blogger Macro XML Template code

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 -->
 <data:name_of_param_list.name_of_param_1/>

 <!-- compare a param -->
 <macro:if cond='data:name_of_param_list.name_of_param_2 == 2'>
  <!-- do something here -->
 </macro:if>
</macro:includable>
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'/>
</macro:include>

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'>
  <data:my_params.message/>
 <macro:else/>
  <b:section mexpr:class='data:my_params.class' mexpr:id='data:my_params.idPrefix + &quot;-2-2&quot;'/>
 </macro:if>
</macro:includable>
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'/>
</macro:include>

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'/>
  </macro:include>
</aside>

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

<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'/>
 </macro:include>
</aside>

<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'/>
 </macro:include>
</footer>

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.

COMMENTS

Name

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,11,Business and Marketing,9,BuySellAds,1,Content Marketing,3,Contextual Marketing,2,Copyrighting,1,CPC Keywords,1,Digital Marketing,7,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,
ltr
item
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
https://4.bp.blogspot.com/-J_GRcvbEvBU/WmAiDzxJM0I/AAAAAAAAA4A/w83SpS86_8cSrhpKoXDZ1HE61cBHoLO7ACLcBGAs/s640/Blogger%2BMacro%2BXML%2BTemplate%2BCode.jpg
https://4.bp.blogspot.com/-J_GRcvbEvBU/WmAiDzxJM0I/AAAAAAAAA4A/w83SpS86_8cSrhpKoXDZ1HE61cBHoLO7ACLcBGAs/s72-c/Blogger%2BMacro%2BXML%2BTemplate%2BCode.jpg
Teach Sansar - Leading Digital Technology
https://www.teachsansar.com/2018/01/Some-facts-you-most-know-about-blogger-macro-xml-template-code.html
https://www.teachsansar.com/
http://www.teachsansar.com/
http://www.teachsansar.com/2018/01/Some-facts-you-most-know-about-blogger-macro-xml-template-code.html
true
5329405941980539054
UTF-8
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