View Issue Details

IDProjectCategoryView StatusLast Update
0001207Composr documentation[All Projects] General / Uncategorisedpublic2015-09-25 20:19
ReporterChris GrahamAssigned To 
SeverityFeature-request 
Status closedResolutionwon't fix 
Summary0001207: Adding blocks to templates
DescriptionAdding blocks direct to templates, without having to use Comcode.

This is a simple example of stripping down the main_quotes block and placing it in the footer above the copyright. I have presented it in diff format. "-" means removed line. "+" means added line. The actual tutorial should indicate the changes more clearly, and be done using proper template edits (i.e. saving the edited templates into your own theme).

diff --git a/themes/default/templates/BLOCK_MAIN_QUOTES.tpl b/themes/default/templates/BLOCK_MAIN_QUOTES.tpl
index 924883e..5916119 100755
--- a/themes/default/templates/BLOCK_MAIN_QUOTES.tpl
+++ b/themes/default/templates/BLOCK_MAIN_QUOTES.tpl
@@ -1,14 +1 @@
-<section class="box box___block_main_quotes"><div class="box_inner">
- {+START,IF_NON_EMPTY,{TITLE}}<h3>{TITLE}</h3>{+END}
-
- <blockquote class="quotes_block">
- {CONTENT}
- </blockquote>
-
- {+START,IF_NON_EMPTY,{EDIT_URL}}
- <ul class="horizontal_links associated_links_block_group">
-
  • {EDIT_URL*}

  • -
    - {+END}
    -</div></section>
    -
    +{CONTENT}
    diff --git a/themes/default/templates/GLOBAL_HTML_WRAP.tpl b/themes/default/templates/GLOBAL_HTML_WRAP.tpl
    index 0db2319..3e68355 100644
    --- a/themes/default/templates/GLOBAL_HTML_WRAP.tpl
    +++ b/themes/default/templates/GLOBAL_HTML_WRAP.tpl
    @@ -192,6 +192,7 @@ Powered by {$BRAND_NAME*} version {$VERSION_NUMBER*}, (c) ocProducts Ltd
                                            <div class="global_copyright">
                                                    {$,Uncomment to show user's time {$DATE} {$TIME}}
     
    + {$BLOCK,block=main_quotes}

                                                    {$COPYRIGHT`}
     
                                                    {+START,IF,{$NOT,{$MOBILE}}}
    TagsNo tags attached.
    Time estimation (hours)
    Sponsorship open

    Activities

    Rajesh Kumar

    2015-08-10 17:52

    reporter  

    blocks_to_templates.odt (15,771 bytes)

    Rajesh Kumar

    2015-08-10 17:52

    reporter   ~0003062

    Assigned to Anoop for review

    anoops

    2015-08-11 07:06

    reporter  

    blocks_to_templates_new.odt (68,992 bytes)

    Chris Graham

    2015-09-25 20:19

    administrator   ~0003098

    Covered well enough already, and the verbosity here just re-explains core concepts.

    Issue History

    Date Modified Username Field Change
    2023-02-26 18:29 Chris Graham Category General => General / Uncategorised