Copied to clipboard

Flag this post as spam?

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


  • linuxod 1 post 21 karma points
    Jan 29, 2014 @ 19:07
    linuxod
    0

    Using Umbraco 7 as MVC developer

    Last few days i've been reading tutorials, documentation, books, watching some videos e.t.c. I catched the idea and philosophy of Umbraco CMS but still have questions.

    First one - as I understood everything you do in Umbraco is saving in database in one or another way, which leads to a question: how to develop it in team? I mean any project you can save into repository with version control, application instance stays at developer's computer and so on. How do Umbraco handles this if it saves document types, templates, macroses in database? Should I deploy the application to public server and work there with my collegues only in backoffice part of CMS? In this case to make a local copy of our hard work I should copy the database and connect my local application to this database copy? I'm not sure if it's easy to maintain.

    Second - can I work with database entites or is it only with nodes? If I'll need to develop a search - should I do it on nodes level? In this case as I undersand - I need to find my parent node where my, let's say products, are, read all his subnodes and then perform any actions?

    Third - is how to save anything from the page side? If someone leaves a feedback to a particular product, how should I obtain introduced values and then save them into database with relation to the product? So, it would be great if you know where to find any info how to work with entities in code level.

    Fourth - how to make data types basing on products name (if we are discussing products catalogue). For example - dropdown with products names? Is it macros where I'm rendering an html tag <select> and putting there an <option> with product name? In this case how do I obtaind a product Id?

    Thank you all in advance for your time and help.

  • Sebastiaan Janssen 5058 posts 15520 karma points MVP admin hq
    Jan 29, 2014 @ 22:18
    Sebastiaan Janssen
    0

    Here's the short answers:

    1. Use a central database
    2. You shouldn't have to work with the database at all, without a deep understanding of it chances are you'll mess it up
    3. Depends on your needs. Save it in a custom table if you want, or use Contour which will do this for you, or create a new node under the product node using the ContentService
    4. I don't know what exactly you're asking but if you need to present them on the frontend, something like this will do assuming that your products are under a parent page, for example:

    Shop
    - Product 1
    - Product 2
    - Product 3

    On the shop (current page) page you would do:

    <select>
      @foreach(var product in CurrentPage.Children) {
         <option value="@product.Id">@product.Name</option>
      }
    </select>
    

    There's many more ways to traverse the content tree, have a look at the documentation and this cheatsheet: http://our.umbraco.org/projects/developer-tools/umbraco-v6-mvc-razor-cheatsheets

Please Sign in or register to post replies

Write your reply to:

Draft