Copied to clipboard

Flag this post as spam?

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


  • Mitchell Fenwick 5 posts 85 karma points
    Feb 07, 2020 @ 01:38
    Mitchell Fenwick
    0

    Preview Parent Page using Preview button on Child Page

    Hi All,

    I currently have a website setup where each page has a page components folder and within this page components folder are Documents each with thieir own template.

    Upon visiting a page, it will iterate through each "component" in the folder and render each ones' template, using the method @Umbraco.RenderTemplate(component.Id).

    This problem arises when I want to make a change to one of these components. If I make a change and then click on the preview button it will display only said components content which is not styled and not in context with the other components of the page.

    I can work around this by clicking preview and then visiting the website in another tab and it will have the preview cookie, allowing me to see the changes styled and in context.

    This is fine however it would be much more convenient to be able to preview the page straight from the component.

    I know the popular template company Uskinned have this feature so I believe it is doable.

    Is there a way to change the preview function to show the Parent page preview rather than the component preview?

    Example

    I am using Umbraco v7.15.3

    Thanks, Mitchell

  • Ryan Helmn 26 posts 188 karma points
    Feb 10, 2020 @ 14:17
    Ryan Helmn
    0

    You could make a content app (https://our.umbraco.com/documentation/Extending/Content-Apps/) and in the angular, using the content service grab the ancestor and build the preview url from that?

  • Mitchell Fenwick 5 posts 85 karma points
    Feb 12, 2020 @ 02:14
    Mitchell Fenwick
    0

    Hi Ryan,

    This is in Umbraco version 7 sorry. It seems that content apps were introduced with v8.

Please Sign in or register to post replies

Write your reply to:

Draft