Copied to clipboard

Flag this post as spam?

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


  • Mikkel 14 posts 115 karma points
    Jul 18, 2017 @ 10:58
    Mikkel
    0

    Image slider from Media Type

    I've been trying to create an image slider on my "home" page, showing images, as well as caption etc., from a specific folder of a specific, custom media type.

    Looking through a bunch of threads on here, as well as other pages, hasn't helped me out. So i was hoping someone here could help me.

    What im looking for, is basically some help to pull out the content onto the page, and then from there i will be able to make the functionality and design of the slider myself.

    I would prefer not to use any thirdparty or package sliders, as I will have multiple people working on the site in the future, uploading content etc. and therefore would prefer a custom build that would make it 'easy' to create new content for people who are new to the site.

    Info: Custom media type, including image, alt-text, caption, link and content picker. Called "Slider Entry" (alias: sliderEntry)

    All aliases for media type properties: image altText caption link post

    the media types are created in a subfolder called "Slider Entries" in the Media tab.

    Slider is located on the 'home' page (Root).

    Hope there's someone who can guide me in the right direction.

    Thanks in advance!

    /Mikkel

  • Alex Skrypnyk 6150 posts 24110 karma points MVP 8x admin c-trib
    Jul 18, 2017 @ 11:56
    Alex Skrypnyk
    0

    Hi Mikkel

    Try these steps:

    1. Create partial view for Slider
    2. Add Partial view to page template, on which page do you want to use it
    3. Render Slider

    Can you show some code example how HTML of your slider should looks like?

    Thanks,

    Alex

  • Mikkel 14 posts 115 karma points
    Jul 18, 2017 @ 12:55
    Mikkel
    0

    Hey Alex,

    Thanks for the reply :) I'll try those steps out!

    as for the HTML structure, i was thinking something like this:

        <div id="slider">
            <ul>
                <li>
                    <a href="link or  content picker">
                        <img src="image from mediatype" alt="alt text from media type">
                        <span>Caption</span>
                    </a>
                </li>
                <li>
                    <a href="link or  content picker">
                        <img src="image from mediatype" alt="alt text from media type">
                        <h2>Maybe a caption header</h2>
                        <span>Caption</span>
                    </a>
                </li>
            </ul>
        </div>
    

    /Mikkel

Please Sign in or register to post replies

Write your reply to:

Draft