Copied to clipboard

Flag this post as spam?

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


  • pcorreia 5 posts 25 karma points
    Dec 03, 2011 @ 15:08
    pcorreia
    0

    dynamic content with images

    Hello, I am developing an information site for my company. So far I have developed a .Net user control that gathers a random business company from our sql server database and display it. My problem is this, I have business info in the database but no logo or images, so I was planning to use umbraco to store those logos and images for each business. However I don't see how can I associate these images to their own businesses.

    Has someone implemented a similar situation? How do you manage these associations? How can a user upload an image in umbraco backoffice and associate with the correct business? Thank you.

  • Bo Damgaard Mortensen 719 posts 1207 karma points
    Dec 03, 2011 @ 18:56
    Bo Damgaard Mortensen
    0

    Hi pcorreia,

    The way I would do this would be something like:

    1. Build a ascx usercontrol that contains a dropdownlist with the company name as text and id as value.

    2. Go to Umbraco and create a new datatype, select the usercontrolwrapper and choose the usercontrol you've just created.

    3. Create a new mediatype that basically looks like the regular mediatype, but with the added property containing your usercontrol datatype.

    4. Whenever a mediaitem gets saved, hook up to the Umbraco AfterSave event and assign the umbracoFile (the url to the media item) to the company selected in the dropdownlist.

    Let me know if this dosn't make any sense :-)

    Also, keep in mind that this is just one way to do it.

    - Bo

  • pcorreia 5 posts 25 karma points
    Dec 04, 2011 @ 12:01
    pcorreia
    0

    Hi Bo,

    That makes sense. I haven't thought of datatype but the way you described it seems doable.

    Thank you for the quick reply, I will try that way and then let you know how it went. 

  • Bo Damgaard Mortensen 719 posts 1207 karma points
    Dec 04, 2011 @ 12:45
    Bo Damgaard Mortensen
    0

    Hi pcorreia,

    All good :) Just fire away if there's any trouble.

    - Bo

Please Sign in or register to post replies

Write your reply to:

Draft