Try Now
More in this section

Forums / General Discussions / Change image in block based on logged in user tag/custom field

Change image in block based on logged in user tag/custom field

2 posts, 0 answered
  1. James
    James avatar
    1 posts
    20 Jan 2015
    23 Mar 2015
    Link to this post


    Could someone tell me how I can have an image block (for example) that changes the image based on the user logged in, and the category/tag they have assigned


    2 users - custom field for home town, one user is set as OXFORD the other LONDON

    Image block on a page, shows the "Oxford" image when Oxford user is logged in, and the "London" image when London user is logged in

    If no user logged in, it shows another image

    I am not good with code, so if there is a way to do this without much code / its easy to understand I would be very grateful



  2. Grisha 'Greg' Karanikolov
    Grisha 'Greg' Karanikolov avatar
    156 posts
    10 Oct 2016
    23 Mar 2015
    Link to this post
    Hi James,

    What you would typically do is Get the currently logged in user, query data from his profile (e.g. the location he has set in his profile) and execute your logic against that.

    Here's our documentation article on how to get the currently logged in user and any properties that are related to him.

    Please let me know if that helps of you need more info!

    Grisha 'Greg' Karanikolov
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
2 posts, 0 answered