1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / How to display the dynamic sitefinity content on statci pages.

How to display the dynamic sitefinity content on statci pages.

11 posts, 0 answered
  1. sarath
    sarath avatar
    24 posts
    Registered:
    24 Jan 2010
    28 Jan 2010
    Link to this post
    How to display the dynamic sitefinity content on statci pages. The content that the user chooses to insert into content areas in the templates section of sitefinity. Since the static pages use the same master pages as the sitefinity content, the content is not showing in the static pages. How the content can be pulled from sitefinity based on the content area name. Where the content area name will get stored and how to identify the content area name.

    Thanks,
    Sarath
  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    29 Jan 2010
    Link to this post
    Hello Sarath,

    I am not sure that I understood the question. 

    If you have a static page, this means that there will be no server code on it, which means you cannot process any server code to get the content. The only option here will be to have web service that could serve the content. Then you can use JSON or XML parsing to get the content and display it with javascript on the page. 

    Let me know if I am missing something. 

    Sincerely yours,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. sarath
    sarath avatar
    24 posts
    Registered:
    24 Jan 2010
    29 Jan 2010
    Link to this post
    Hello Georgi,

    The problem here is, I have sitefinity cms managed pages(i.e dynamic pages) and non cms managed pages(i.e static pages). For cms pages I am using a parent.master page and static pages I am using nested master page say child.master pages. Now, the content that the user chooses to insert into content areas in the “Template” section of Sitefinity. Since the static pages use the same master page as the Sitefinity content, they look the same but are missing this template content. How to pull the content from Sitefinity instead so that both static and dynamic pages are updated at the same time automatically, when the user added any content for cms managed pages.

    Thanks,
    Sarath
  4. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    29 Jan 2010
    Link to this post
    Hi sarath,

    Thank you for getting back to us. 

    Well you have two options here. The first one is to use the Sitefinity controls declaratively. The sample bellow will display all news from the news provider on a regular .aspx page:
    <%@ Page Language="C#" %>
    <%@ Register Namespace="Telerik.News.WebControls" Assembly="Telerik.News" TagPrefix="sfWeb"  %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
           <sfWeb:NewsView ID="NewsView" runat="server" BehaviorMode="Master"></sfWeb:NewsView>
        </div>
        </form>
    </body>
    </html>

    However the best method would be to use the Sitefinity API to get content through code and then output it to the page or as Georgi has suggested in the previous post. You can take a look at the following webinar on how to work with Sitefinity API: Sitefinity API Tips & Tricks; and this link to the API documentation pages: Modules API Overview

    Regards,
    Radoslav Georgiev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. sarath
    sarath avatar
    24 posts
    Registered:
    24 Jan 2010
    29 Jan 2010
    Link to this post
    Thank you for quick reply.

    I don't want to get the entire page content, i just want to pull the one content area content of the template. for example if i update the footer content in the paren.master template, the updated content will be displayed to all cms managed pages, but it will not display in the non cms managed pages. how to pull the som part of the page content. please advice.

    Thanks,
    sarath
  6. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    29 Jan 2010
    Link to this post
    Hi sarath,

    Please take a look at the linked webinar. There are samples on how to access controls on a page/template. Help articles on this topic are: Finding Controls. You can get all controls from a container and get their contents.

    Kind regards,
    Radoslav Georgiev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  7. sarath
    sarath avatar
    24 posts
    Registered:
    24 Jan 2010
    29 Jan 2010
    Link to this post
    I am new to sitefinity, i have a basic question...when i add any content through cms in the template where this content will get sotred and in which format. Generally in other CMSs if we do any changes to page that content will go and store in a xml file and we can pull the content from a xml and we can display it where ever we want......just want to understand in sitefinity.....
  8. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    29 Jan 2010
    Link to this post
    Hi sarath,

    In Sitefinity we do use database for storing content. This is why we have publicly exposed API. You can always get content from all pages and modules using the API. Please refer to the developer manual I have linked in previous posts.

    Kind regards,
    Radoslav Georgiev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  9. sarath
    sarath avatar
    24 posts
    Registered:
    24 Jan 2010
    29 Jan 2010
    Link to this post

    thank you for your help...the below is the actual problem.......
    from paren.master:
    <

    div id="Footer" class="footer">

     

    <div id="contact" class="contact">

     

    <h4>Contact Us: </h4>

     

    <asp:contentplaceholder id="ContactusContent" runat="server"></asp:contentplaceholder>

     

    </div>

     

    <p>&copy; 2010 Company Name. All rights reserved.</p>

     

    </div>

    through cms i edited this master template and i added phone number : 123456789. This phone number is coming in all the cms managed pages, but it's not coming in the non cms managed pages. In cms master i am not using any user control also...it's a just content area of master page. I have to pull the update phone number data from sitefinity and display it in the static pages. can u pls advice.

    thankx,
    sarath

     

  10. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    29 Jan 2010
    Link to this post
    Hello sarath,

    What kind of control are you putting in the ContactusContent content place holder? As I said you can use the API to write some server code in order to get the cotnrols in the  ContactusContent  content place holder and based on the type of the control get the text you have entered. Sample bellow is taken from the manual pages, if lets say you have added the telephone using Generic Content control:

    CmsManager cmsManager = new CmsManager();
    //get template by name
    IPageTemplate template = cmsManager.GetTemplate("Default");
    foreach (ICmsWebControl control in template.Controls)
    {
        if (control.ContainerID == "ContactusContent")
        {
            //check if type is generic content. if yes then get the content
            if(control.GetType()==typeof(Telerik.Cms.Engine.WebControls.GenericContent))
            {
                GenericContent gcControl = (GenericContent)control;
                string content = gcControl.Content;
            }
        }
    }

    You should really take a look at the articles and webinar I have linked.

    Sincerely yours,
    Radoslav Georgiev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  11. sarath
    sarath avatar
    24 posts
    Registered:
    24 Jan 2010
    29 Jan 2010
    Link to this post
    Thank you for your kind reply. yeah....i am looking at the articles and webinar...thank you....
Register for webinar
11 posts, 0 answered