SEARCH


Tag Archives: layout



Although macros are intended to be very flexible and usable everywhere (to make you build the desire page layout exactly as it's needed to be), there are some situations that must be avoided. 

 

In general, when macro is parsed on the page, it's replaced by single or set of HTML tags and appropriate data for these tags. Thus it has some kind of structure, and it's really important this structure to be kept.

Breaking the macro structure also breaks the page structure, what leads to improper layout or even to not functional page elements.

 

Here are some rules that must be kept to avoid breaking the page because of a macro structure break:

  1. Use object macros' start and end tag on a separate line.
    • Object macros - complex macros that contain other macros and elements inside them.
    • Example

      %OBJECT_MACRO(

      %title% %date%

      ...
      %link%

      )%

  2. If page provides more than one object macro, do not cross them
    • Example
      Wrong Right
      <FORM_AREA>
      %OBJECT_MACRO(   
          ....

      )%

      <FORM_AREA>
         %OBJECT_MACRO(
            ......
         )%
  3. Do not cross object macro with some area elements (div, table, etc)
    • Example
      Wrong Right

      %OBJECT_MACRO(
       .......
      )%
      %OBJECT_MACRO(
      ...........................
      ...........................
      )%
  4. Do not apply styling or anything similar to only part of the macro
    • Example
      Wrong Right
      %OBJECT_MACRO( 
      ........
      )%
      %OBJECT_MACRO(
      ........
      )%
    • This is right, but not always, so better try to avoid if possible!


• macros • positioning • layout