Copied to clipboard

Flag this post as spam?

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


  • Pat O'Callaghan 34 posts 56 karma points
    May 31, 2010 @ 05:17
    Pat O'Callaghan
    0

    Rendering a value differently on the CMS frontend than how it is stored

    Hey all,

    first time posting on the forums...

    On my site when a member asks a question the member's id is stored (as a "textstring" datatype) with the question to show who asked it. This is what I want but the only problem is when an admin user views the question in the umbraco CMS the user appears as an id. While this is correct, it isn't very user friendly.

    I was wondering is there some way of taking the member's id just before the question page loads in the CMS and render the field with the Member's name instead (which I can get using new Member(id).getProperty("name")....etc)? Maybe some sort of event I could use? I don't want to change how the value is stored, just how it is displayed for this particular page in the CMS.

    Thanks for your help,

    Pat :-)

  • Aaron Powell 1708 posts 3046 karma points c-trib
    May 31, 2010 @ 05:31
    Aaron Powell
    1

    There's a member picker data type that ships with Umbraco, that should do what you require. Otherwise you will need to write your own data type. Then you control the functionality of what (and how) the data is rendered.

  • Pat O'Callaghan 34 posts 56 karma points
    May 31, 2010 @ 23:47
    Pat O'Callaghan
    0

    Thanks slace. Someone had suggested to me already the custom datatype approach but I just wanted to make sure it wasn't the only way of doing it. I hadn't thought of the member picker approach so that will come in handy down the line. For this one though I think the custom datatype is the preferred route.

     

    Thanks

Please Sign in or register to post replies

Write your reply to:

Draft