Copied to clipboard

Flag this post as spam?

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


  • Stefan Joseph 19 posts 120 karma points
    Sep 05, 2017 @ 09:18
    Stefan Joseph
    0

    Best method for replicating content across a website?

    Looking for some help in regards to replicating content across the website I'm working on.

    I want the content editor to be able to create a list of products, ideally using a macro picker, containing a:

    • Title
    • Short Description
    • Link

    I would then like to re-use these listed products in various situations i.e 'Similar products'.

    What is the best method in order to achieve this?

  • Georgs Bormanis 25 posts 122 karma points admin hq c-trib
    Sep 05, 2017 @ 11:22
    Georgs Bormanis
    0

    Hey Stefan!

    Why don't you just create a document type with these properties and then allow that document type to be used under all producs?

    Then you will be able to create content with that doc type wherever you need to.

    Or am I misunderstanding something? :D

  • Stefan Joseph 19 posts 120 karma points
    Sep 05, 2017 @ 11:41
    Stefan Joseph
    0

    Not 100% sure that would accomplish what I need..

    so lets say I have a Products Page : The editor can create a product listing via a macro picker - he creates oranges and apples.

    When a user is on the apples page, I'd like a section that says:

    "You may also like these products"

    There I would like to list the product/macro I created earlier - oranges

    -

    I would like to apply this to things like case studies and news listings etc. Hope this gives you a better idea!

  • Georgs Bormanis 25 posts 122 karma points admin hq c-trib
    Sep 05, 2017 @ 11:47
    Georgs Bormanis
    0

    Oh then I misunderstood you, sorry.

    Davids solution should work like a charm! :) #H5YR

  • Stefan Joseph 19 posts 120 karma points
    Sep 05, 2017 @ 11:47
    Stefan Joseph
    0

    Not a problem Georgs, appreciate the help!

  • David Armitage 508 posts 2076 karma points
    Sep 05, 2017 @ 11:44
    David Armitage
    101

    Hi Stefan,

    1. Create a docType to contain your list of products. Maybe docType: Products
    2. Create a docType for the actual product. Maybe docType: Product
    3. Create a content node for products and add a few product nodes below this.

    This will be a central store for your products

    1. Now create a multi-tree node data type called featuredProducts and set the start node to be your product list node.

    2. You can now add this to which ever page or node you want. For instance you could add a featured products data type to the homepage and then render the products in the frontend with razer script.

    I have done something similar a load of times. Here is an example of some razor script that does exactly this.

    In my case I have a list of popular job searches rather than in your case products.

    @if (Model.Content.FeaturedJobPopularSearches != null)
                {
                    foreach (JobPopularSearch jobPopularSearch in Model.Content.FeaturedJobPopularSearches)
                    {
    
                        <div class="item col-md-4">
                            <h3>
                                <a href="@(siteSettings.JobListingsPage + jobPopularSearch.SearchTerm.FormatForUrl() + "/")">
                                    @jobPopularSearch.Title Jobs
                                </a>
                            </h3>
                            @if (!string.IsNullOrEmpty(jobPopularSearch.Description))
                            {
                                <p>
                                    @jobPopularSearch.Description.ToString().Truncate(140);
                                </p>
                            }
    
                            <hr />
                        </div>
                    }
                }
    

    Hope this helps.

    Kind Regards

    David

  • Stefan Joseph 19 posts 120 karma points
    Sep 05, 2017 @ 11:47
    Stefan Joseph
    0

    Think this is exactly the sort of thing I was after, appreciate the help David!

  • David Armitage 508 posts 2076 karma points
    Sep 05, 2017 @ 11:58
    David Armitage
    0

    No problems. Let me know if you have any trouble. Happy to help.

Please Sign in or register to post replies

Write your reply to:

Draft