Copied to clipboard

Flag this post as spam?

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


  • Rocoeh 65 posts 86 karma points
    Jun 14, 2012 @ 16:09
    Rocoeh
    0

    Creating a list of faqs

    Hi,

    I want ot create a list of faqs each item should have a title and a bit of copy. I jsut want to list them out with a bit of Razor and they should not have their own page (helpfultips.aspx). I have no idea how to do this in Umbraco as I am coming from a drupal background.

     

     

  • Kasper Dyrvig 246 posts 379 karma points
    Jun 15, 2012 @ 11:35
    Kasper Dyrvig
    0

    In a website I am working on right now I have done it like this:

    1. Created a Document type called "Question Group" (containing "title" and "intro") and another one called "Question" (caontaining "question" and "answer"). They don't inherit from anything. (Ofcause I allow the "Question Group" to be a child node of my "Frontpage" document type)
    2. Then I create my FAQ in the content tree. The Question Group allows me to group the questions in a logic that fits my website. E.g. I can relate a product category to a specific group of questions. You can just skib that if you don't need it.
    3. In Razor I've made the following code:
    @{
       var faq Library.NodeById(1172);
       <h3>@faq.faqGroupTitle</h3>
       foreach(var item in faq.Children.Where("Visible"))
       {
        <p><strong>@item.faqQuestion</strong></p>
        @item.faqAnswer
       }
     }

    Now just insert the macro on the page that should view the FAQ and your done.

    Hope it gives you an idea...

  • Rocoeh 65 posts 86 karma points
    Jun 18, 2012 @ 11:51
    Rocoeh
    0

    am working on it now,   it looks good!

  • Kasper Dyrvig 246 posts 379 karma points
    Jun 18, 2012 @ 15:25
    Kasper Dyrvig
    0

    Great. Don't hesitate to let me know if you have any troubles with it.

  • Rocoeh 65 posts 86 karma points
    Jun 18, 2012 @ 16:01
    Rocoeh
    0

    Thanks, the only thing is I do not need the link to document

     

    Anyway I can loose this or at least hide it?

     

    Thanks again.

  • Kasper Dyrvig 246 posts 379 karma points
    Jun 18, 2012 @ 21:17
    Kasper Dyrvig
    0

    Not that I know of. But since you don't link to the node (suposeing you use the code I posted) users will never get to it. So it won't be a problem. The link is only presented in the backend of Umbraco.

Please Sign in or register to post replies

Write your reply to:

Draft