We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36776
    • 31 Posts
    tropicaljuice Reply #1, 15 years ago
    Hello,

    I'm trying to create a plugin so i can use e.g. this code:
    [[Slider? &SliderImage=`slider/image.jpg` &SliderTitle=`The <span class="titlecolor">Best</span>` &SliderSubTitle=`Lorem ipsum dolor
     sit amet` &SliderText=`Lorem ipsum dolor sit amet, consectetur adipisicing elit` &SliderDocNr=``]]


    This should be the output, where i have changes the output text to the variables over:
    <li>
      <div class="header-left">
        <div class="slider-image"><img src="&SliderImage" alt="" /></div>
      </div>
      <div class="header-right">
        <h1>&SliderTitle</h1>
        <h2>&SliderSubTitle</h2>
        <p>&SliderText</p>
        <a href="&SliderDocNr" class="button">Read More</a>
      </div>
    </li>


    Then I want to use GetRecources or similar to create a resource folder named Slides (lets say with container ID 5), and for every new document i add inside container 5, the system will add a new slide to my template.

    I hope you guys understand and can help me do this. If i understand this one think, it will help de do alot of other things I also want to do smiley
    [ed. note: tropicaljuice last edited this post 15 years ago.]
      • 36776
      • 31 Posts
      tropicaljuice Reply #2, 15 years ago
      Or
      <h1>[[*longtitle]]</h1>
      as the title for that matter.. smiley Maybe thats the best.
        • 33968
        • 863 Posts
        You could do this:
        [[!getResources? &parents=`5` &tpl=`slideTpl` &includeTVs=`1` &processTVs=`1` ]]
        

        Where slideTpl contains:
        <li>
          <div class="header-left">
            <div class="slider-image"><img src="[[+tv.sliderImage]]" alt="[[+pagetitle]]" /></div>
          </div>
          <div class="header-right">
            <h1>[[+pagetitle]]</h1>
            <h2>[[+longtitle]]</h2>
            <p>[[+introtext]]</p>
            <a href="[[~[[+id]]]]" class="button">Read More</a>
          </div>
        </li>
        
          • 36776
          • 31 Posts
          tropicaljuice Reply #4, 15 years ago
          Hi,

          Thank you! I'll guess all I need now is to create a TV for the image?

          And the link on the bottom, how do i add documents for that? Do i need a TV for that too?

          Thanks again
            • 36776
            • 31 Posts
            tropicaljuice Reply #5, 15 years ago
            I managed to create the TV. Wasn't that hard.. Only thing missing now is the ID smiley