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

Forums / Developing with Sitefinity / Preview theme correct, published incorrect

Preview theme correct, published incorrect

11 posts, 0 answered
  1. Louis Farrell
    Louis Farrell avatar
    37 posts
    Registered:
    24 May 2010
    28 Jun 2010
    Link to this post
    Hey,

    As the title suggests, i have set a page to have a certain theme, which works well, it can be seen to be using the chosen theme in both edit mode and in preview mode. However, as soon as i publish it, it uses a different one of my themes. All the settings are set how they should be, and i have gone through it over and over again and i see no logical reason why it is ignoring the theme i have set it to use.

    Many thanks,

    Louis
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    28 Jun 2010
    Link to this post
    Hi Louis Farrell,

    Thank you for using our services.

    Have you enabled workflow? If yes the page's changes will not be seen until you go through the workflow steps and publish the page. If this is not the case could you please open a support ticket and send us your project and database we would like to see what might be going wrong.

    Sincerely yours,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Ian Muir
    Ian Muir avatar
    13 posts
    Registered:
    26 Jan 2010
    06 Dec 2010
    Link to this post
    I have the same problem. On our site, every page is using the same template as the home/root page.

    We are not using any workflow and the status of the page is listed as published. We've attempted to re-publish the page several times but it isn't working.

    The template is correct in edit and preview, but is incorrect live.

  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    06 Dec 2010
    Link to this post
    Hello Ian ,

    Can you create a new master file without any controls on it, just ScriptManager and then create a new page and try to replicate this issue. I am not able to reproduce the problem locally and I think that you have some custom code that alters that page or its saving.

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Ian Muir
    Ian Muir avatar
    13 posts
    Registered:
    26 Jan 2010
    06 Dec 2010
    Link to this post
    We did have a custom event handler that we attached to the Telerik.Cms.CmsManager.Executed event in the Global.asax.cs

    However, we deleted that from the Global.asax.cs file and the issue is still there. We've tried both creating a new page and editing an existing page and the templates are still incorrect.
  6. Ian Muir
    Ian Muir avatar
    13 posts
    Registered:
    26 Jan 2010
    07 Dec 2010
    Link to this post
    Is there a stored proc that gets the current page & template? If so, I can look at that and try to see what is going on.

    At this point, our client's site is broken, so we need a solution ASAP.
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    07 Dec 2010
    Link to this post
    Hi Ian,

    You can use SQL profiler to see the actual queries that are send to the database, but this is controlled by the datalayer that we use.
    If you want you can provide me with an external link from where I can download sample project and database where I can see the issue.

    All the best,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  8. Ian Muir
    Ian Muir avatar
    13 posts
    Registered:
    26 Jan 2010
    07 Dec 2010
    Link to this post
    I don't think profiling tools will be helpful. The site shares a database with several other sitefinity installs and the site is live, so I don't think it would be possible to isolate calls from this specific site.

    The site that is broken is http://groceryoutlet.com/berkeley-ca/

    You can see that all of the interior pages , such as http://groceryoutlet.com/berkeley-ca/Default/ContactUs.aspx use the home template. If you add the pagemode variable in the query string, it displays correctly. http://groceryoutlet.com/berkeley-ca/Default/ContactUs.aspx?cmspagemode=preview

    Is there somebody at Sitefinity that can explain which database calls are made for these page requests? This is a live site, that was working fine for months.

    We're especially frustrated because we followed the Sitefinity support team's guidance when implementing the code that you say broke this site.

  9. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    10 Dec 2010
    Link to this post
    Hi Ian Muir,

    Unfortunately we are not able to tell which requests get the theme information. We are also not sure how you separated the information. What matters is, from how many databases do you get the pages, and how are the templates distributed. 

    Can you please give a little bit more information, we really want to simulate this locally so we can help you.

    All the best,
    Georgi
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  10. Ian Muir
    Ian Muir avatar
    13 posts
    Registered:
    26 Jan 2010
    10 Dec 2010
    Link to this post
    All of the pages are coming from a single database. We are using one database to manage multiple Sitefinity installs. I'm not sure how to answer your template question. The templates are stored in the filesystem, and were uploaded via the templates page in the admin.

    I highly doubt that this is something easily reproducible. We have dozens of sites running on the same server, under the exact same circumstances with no issues. Part of the reason I've been asking for insight on what queries are being run is to enable me to attempt to diagnose what's happening in our environment.

    Can you ask one of the engineers to provide a rough outline of how the CMS determines which master page to use when rendering a page? Clearly there is a difference between how the master pages are used in live and preview modes. Are their any stored procs I can run to get some insight? Any API calls I can make via the code to see what is going on?
  11. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    11 Dec 2010
    Link to this post
    Hello Ian,

    How page preview mode works

    1. You make a request to a page and inside url code we get the page id

    HttpContext.Current.Items[UrlHelper.PageIdKey]

    2. We call CmsManager class and its GetPage method where we pass the id returned from the query string

    3. We cast the page to ICmsPage and check wheter the current user has view permissions

    4. After we get the page through the CmsManager we use the staged version of the page by calling page.Staged. This returns the staged object which should be the same as this one used in "EDIT" mode.

    5. We read the template of the page by using stagedPage.Template.MasterPage. If there is no master page associated with this page we load Sitefinity/Dummy.master. If there is a master page we load the master page from your App_Master folder

    The SteagedPage has a data class which uses Nolics data layer which gets/sets data to the database. In this case StagedPageContent table is queries where we get MasterPage value for the current page
    The actual query to the database uses the latest staged version stagedPage.Version and staged.ID as an identifier. The the value is returned as an object in our code.

    6. Then we call stagedPage.Controls and add each control to its ContentPlaceHolder

    Is it possible for you to provide us with credentials to the website? You can open a support request and send them to use together with 2 screenshots that represents the issue  and link to the website.

    Have you tried to edit an publish this page? Do you see any difference when you are in edit and preview mode or this happens only on the live page? The Edit and Preview mode should show the same page. There we use the staged version of the cms page. Can you reproduce the issue on another newly created page or the problem is related only to a single page? If the issue is related to a single page then there were some manual changes to the database or you used some code to alter the staged version.

    So page preview and page edit shows staged version. The live view shows published version.

    Regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
11 posts, 0 answered