• Join Now
  • Sign In
  • Cart
  • Instant Setup
  • Download
Logo
  • About
    • For Developers
    • For Agencies
    • For Designers
    • For Anyone
    • Testimonials
    • Showcase
    • Our Philosophy
    • Blog
    • Instant Setup
  • Community
    • Members
    • Forums
    • Chat
    • Karma
    • International
    • Jobs
    • eNewsletters
  • Developers
    • Download concrete5
    • Join Beta Team
    • Translate concrete5
    • Bug Tracker
    • Submit to Marketplace
    • Code Submissions
    • News
    • Community Leaders
    • Related Projects
  • Marketplace
    • Add-Ons
    • Themes
    • Hosting
    • Training
    • Add-on Installation
    • Deal Of The Day
    • Swag
  • Enterprise
  • Documentation
    • Getting Started
    • Editor's Guide
    • Learn concrete5
    • Developers Index
    • How-Tos
  • How-Tos

Customize a Block's Appearance

Posted byandrew in Designers on Mar 08, 2010.
8 people like this.

There are a number of spots that a block's presentation template can be found in Concrete5, and if you know about them they'll make your life infinitely easier.

Is your block using a custom template?

To see if your block is using a custom block template, put the page you're working on in edit mode, roll over the block in question, and click. Then, select "Change Template" from the menu. A Concrete5 dialog will open. If your block is using a custom template it will be displayed here.

Custom templates are located within the "templates/" directory inside the particular block type's directory. So, say you're working with Autonav block and your block is using the "Header Menu" custom template. Your block's template is either here:

/concrete/blocks/autonav/templates/header_menu.php

or here:

/blocks/autonav/templates/header_menu.php

The second listing will be interpreted before the first. The name of the template is automatically determined based on the filename. In this case, "header_menu.php" becomes "Header Menu" automatically.

These custom templates are found by the system automatically, so if you need to create a new custom template, called "Secondary Nav List" for example, you would copy concrete/blocks/autonav/templates/header_menu.php to blocks/autonav/templates/secondary_nav_list.php and make the changes there. Then when editing the site the custom template selector should pick up both the custom templates in concrete/blocks/autonav/templates and blocks/autonav/templates. Note: custom template filenames should not exceed 32 characters in length.

If your block doesn't use a custom template...

then it's even easier to find. If you open the custom template chooser and find no custom templates, or custom templates but your particular block is currently set to "(None Selected)" your block is pulling from either

concrete/blocks/your_block_name/view.php

or

blocks/your_block_name/view.php

or

blocks/your_block_name.php

Don't edit the templates within the concrete/ directory!

In the example above, the latter two items are templates in your root web directory. Whenever possible, if you need to change the template of block's that ship with Concrete, you should do so by copying their templates from concrete/ into your own root blocks/ directory and making changes there. That way, when you upgrade Concrete you can replace your entire concrete/ directory without worrying about merging changes you've made into the new directory.

Recent Discussions on this Topic

  • View More
  • Ask a Question

Customizing a Block's Appearance

Are there more pages to read? This How-To seems to focus on preparing to customize a block's appearance rather than actually doing the customization. I did not find any "next page" links off the article. Thanks.
Started by gandsnut on 07/06/10 at 4:24 PM

1

reply

How-To Tags

block, blocks, customize, custom, template, templates, Custom Template, custom templates

Related How-Tos

None.

  • Documentation
  • How-Tos
  • Designers
  • Customize a Block's Appearance

Do you have questions

  • What are users saying?
  • Who is using concrete5?
  • What makes concrete5 easy?
  • Why develop on concrete5?
 

We’re on “The Twitter”

@concrete5 been working on a #joomla project this week and it's reminded me why I love #concrete5 so much

Follow concrete5

About

  • For Developers
  • For Agencies
  • For Designers
  • For Anyone
  • Testimonials
  • Showcase
  • Our Philosophy
  • Blog
  • Instant Setup

Community

  • Members
  • Forums
  • Chat
  • International
  • Jobs
  • eNewsletters

Developers

  • Download concrete5
  • Join Beta Team
  • Translate concrete5
  • Bug Tracker
  • Beta
  • Submit to Marketplace
  • Code Submissions
  • News
  • Community Leaders
  • User Doc Group
  • Related Projects

Marketplace

  • Add-Ons
  • Themes
  • Hosting
  • Training
  • Add-on Installation
  • Deal Of The Day
  • Swag

Documentation

  • Getting Started
  • Editor's Guide
  • Learn concrete5
  • Developers Index
  • How-Tos

Legal

  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Contact Us
© 2008 to 2013 Concrete CMS Inc. All Rights Reserved.

Sign In?

You must have a user account and be signed to perform this action.

  • Sign In
  • Register