We will develop a mobile app to feed the post content into a webview, we need to remove all menu, header, sidebar and footer. I know how to design a content template but how can I remove the above elements when the post is viewed by mobile? There is 3 possible view to the content, web-base for desktop and responsive for mobile view, if parameter ?webview=1 is passed to the url, then I need to remove all menu, header, sidebar and footer. Should I build one content template for all views or I need to have different content template for different view?
Toolset content templates only replace the content part of the page (concretely, what is output by the core WordPress function the_content in the theme PHP templates). Everything else is generated by the theme, the header, menus, sidebars, footers etc.
So if you want to control the visibility of those then you will need to create custom PHP templates in your theme that modify what is and is not output depending on your webview url parameter.
If there is no replacement to the Toolset Layout, how can I use a different content template to same post type but determine the url parameter, below is what I expect to do
hidden link ( use content template A to view the post on desktop ) hidden link ( use content template B to view the post on mobile responsive ) hidden link ( use content template C to view the post in mobile webview )
As Nigel had mentioned this functionality has since been removed/deprecated with our Layouts plugin.
Currently we have mobile/tablet/desktop views available when you're using the Gutenburg editor. What this means is that you're able to customize the display of your single content template to look differently whether it is on desktop , mobile or tablets.
This feature allows you to hide the elements that you don't want to be seen on the various screen sizes.
how can I use a different content template to same post type but determine the url parameter, below is what I expect to do
However I do recommend that you use the features that the Gutenburg editor offers in terms of hiding/displaying different elements per your display screen.
A custom post type can only assign to one content template usage, how can I change the content template for different view and determine the url parameter? Once I view the custom post, the Toolset will apply the corresponding content template, there is no way for me to select which content template to be used if different url parameter.
Refer to the screenshot, I use the Gutenburg editor but there is no mobile/tablet/desktop views available from the content template setting. Please advise how with some screenshot.
A custom post type can only assign to one content template usage, how can I change the content template for different view and determine the url parameter?
The render_view_template function can dynamically assign a content template to your post when it is being viewed.
I use the Gutenburg editor but there is no mobile/tablet/desktop views available from the content template setting. Please advise how with some screenshot.
The content template itself won't be able to be change when viewed on the different devices however you can disable various toolset elements.
If you click on a Block on your template and scrolled to the Advanced tab, you should see the text "Hide element" from there you can select which device you want this element to be hidden on.
Apart from this there is not much else that can be done.