Copied to clipboard

Flag this post as spam?

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


  • Stefanie 3 posts 23 karma points
    Apr 10, 2015 @ 11:30
    Stefanie
    0

    Doesn't show a umbraco:Item

    Hi, I'm new with umbraco.

    I did this but it doesn't show the value.. anyone who knows why????

                    <div>

                        <div>

                            <div>

                                <umbraco:Item field="Text" runat="server" />

     </div>

                        </div>

                    </div>

                </div>

    I work in local and all divs are showing, but not the umbraco item. With an other project it's working.

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Apr 10, 2015 @ 11:34
    Dennis Aaen
    0

    Hi Stefanie and welcome to our :-)

    What exact version of Umbraco are you using, by knowing this, it can be easier to help.

    Looking forward to hear from you.

    /Dennis

  • Stefanie 3 posts 23 karma points
    Apr 10, 2015 @ 11:43
    Stefanie
    0

    Hi :) I use Umbraco v6.2.4

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Apr 10, 2015 @ 11:55
    Dennis Aaen
    0

    Hi Stefanie,

    Okay how did you insert the umbraco:Item did you use the Umbraco backoffice to insert it. If the alias should be good, if not then please check that the alias of the field is correct. It requires that you have access to settings section, and the document types folder.

    If it´s correct then place check the fields has a value on the page, that you are look on. The umbraco:Item is taking the value from the current page. And make sure that the page are saved and published

    That what I thinking you should try to get the text of the field to show up.

    Hope this helps,

    /Dennis

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 10, 2015 @ 11:57
    Jan Skovgaard
    0

    Hi Stefanie

    If what Dennis has suggested above does not work could you then please share the full code for your template?

    Cheers, Jan

  • Stefanie 3 posts 23 karma points
    Apr 10, 2015 @ 12:18
    Stefanie
    0

    Dennis I tried all and it's allright, but i did a check if an image are insert and the result was nothing inside :/ but i saved and published the page. And with an other project it's working fine but not here.

    I work with visual studio and the code it's :

    <div <%=GetImage()%>  >

                <a href="#">

                    <div>

                        <div>

                            <h1><umbraco:Item field="title" runat="server" /></h1>

                            <h3><umbraco:Item field="subtitle" runat="server" /></h3>

                            <p class="button">

                                <span>

                                    <umbraco:Item field="text" runat="server" />

                                </span>

                            </p>

                        </div>

                    </div>

                </a>

    </div>

     

    Where getimage is:

    public string GetImage()

        {

            var image = Umbraco.AssignedContentItem.GetPropertyValue<string>("image", "");

            if (!string.IsNullOrEmpty(image))

            {

                return "style='background-image:url(" + image + ")'";

            }

            return "";

        }

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Apr 10, 2015 @ 12:31
    Dennis Aaen
    0

    Hi Stefanie,

    First question. Did these fields <h1><umbraco:Item field="title" runat="server" /></h1> <h3><umbraco:Item field="subtitle" runat="server" /></h3> works fine, or? If not, did you template have this in first line

    <%@ Master Language="C#" MasterPageFile="~/umbraco/masterpages/default.master" AutoEventWireup="true" %>

    Or did it have something like this.

    @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
    @{
        Layout = null;
    }

    Looking forward to hear from you.

    /Dennis

Please Sign in or register to post replies

Write your reply to:

Draft