locked
webmatrix RRS feed

  • Question

  • User1519602350 posted

    Hello,

    I am using Mike's cms. How to add Razor code if pages created using cms.

    Thanks

    Tuesday, June 25, 2013 4:14 PM

Answers

All replies

  • User-821857111 posted

    Where do you want to add Razor code?

    Tuesday, June 25, 2013 4:47 PM
  • User1519602350 posted

    Suppose i am creating new page in admin selecting theme "_sitelayout" and default as a layer. I would like to add Razor code for specific pages in the area called RenderBody() using HTML text editor, is it possible?. If not kindly me an alternative solution.

    Thanks

    Wednesday, June 26, 2013 12:14 AM
  • User-821857111 posted

    What code do you want to add? What do you want it to do?

    Wednesday, June 26, 2013 12:55 AM
  • User1519602350 posted

    Sure Mike. Below is the picece of razor code i would like to add in the specific pages only not in all the pages.

        <div id="home-slider-container">
     
                <div id="home-slider">
                    @{ 
                       foreach (var comment in posting) {
                    <div class="home-slider-item">
                        <img class="large-photo" alt="" style="" src="@Href("~/Thumbnail/", comment.id, new { size="large" })" unselectable="on" />
                        <div class="slider-caption">
                            <h2>@comment.Heading</h2>
                            <p>
                                Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque.
                            </p>
                        </div>
                    </div>
                    }
                     } 
                </div>
                <div id="slider-controller" class="content-width">
                    <a href="#" id="slider-prev"><i class="icon-angle-left"></i></a>
                    <a href="#" id="slider-next"><i class="icon-angle-right"></i></a>
                </div>
                <div id="header-image-shadow" class="content-width"></div>
     
            </div>

    Wednesday, June 26, 2013 1:25 AM
  • User-821857111 posted

    If you want to include Razor like that, you need ot create a folder widget: http://www.webpagescms.com/documentation/folder-widgets

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, June 26, 2013 1:56 AM