Displaying text/banners (page specific)

We often come up with a requirement that the specific page require banner images,  for example the default landing home pages. The most common requirement is that of carousel on the home page.

The general approach is to create page layouts for different design patterns. Below I am mentioning another approach to implement it.

  • Add an empty contentplaceholder in the master page.

In master page we set an ID in the contentplaceholder tag. This ID will be mentioned in the page layout where we insert content tag. This will insert an empty div into the html page that will be generated.

If you wish to add banner images or carousel we will add the following code in page layout, eliminating the need for another page layout specifically only for banner images or carousel images.

  • Add content tag in the page layout with the html markup.

Next when we visit the page with above mentioned code present in master pages and page layout respectively. The page will display “Sample text”.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s