Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Tiene 2 posts 22 karma points
    Jun 03, 2013 @ 11:56
    Tiene
    0

    Individual Banners in each page

    Hello Guyz,

     

    I’m new to umbraco.

     

    I’m currently working on a project and I want the end user to create a page and have different banner for each page(inner pages). Please how will I go about it, using razor.

     

    Thanks guyz.

  • Fuji Kusaka 2203 posts 4220 karma points
    Jun 03, 2013 @ 12:05
    Fuji Kusaka
    0

    Hi Taiwo,

    You can easily get this working. What you could do is have 2 different templates, 1 homepage and the other one for the Innerpages.

    Then make use of ContentPlaceHolder where you want your banner to display. 

    Here is a simple razor for the upload field for your banner 

    @{
            if (!String.IsNullOrEmpty(@Model.yourAlias)){
    <img src="@Model.yourAlias" >

    }

     and here making use of recursive value

    @{
        var img = Model.AncestorsOrSelf().Where("yourAlias !=\"\"").Last().yourAlias;
         if (!String.IsNullOrEmpty(@img)){
    <img src="@img" >

    }
  • Tiene 2 posts 22 karma points
    Jun 04, 2013 @ 10:12
    Tiene
    0

    Thank you so much fuji, it worked. 

  • Fuji Kusaka 2203 posts 4220 karma points
    Jun 04, 2013 @ 11:20
    Fuji Kusaka
    0

    Hi,

    Good to hear you got it working !! :) 
     

Please Sign in or register to post replies

Write your reply to:

Draft