I have a Content Template showing my cpt.
I would like to insert (still within this model) a link to another content model of the same cpt.
In practice I would like to give the browser the possibility to switch between 2 viewing modes of the same post.
Can you give me some suggestions?
Hello and thank you for contacting the Toolset support.
You have disconnected from the chat before reading my reply. Yes, it is possible to display a post with different content templates, however, this will depend on how do you choose the content template. Can you explain more?
- Would you allow the user to choose what content template to use?
- Would you choose the content template based on a custom field or some logic?
A custom post type cannot be assigned to more than one content template, so I'll suggest the following:
- Create content template A for the first design.
- Create content template B for the second design.
- Create a content template and assign it to the custom post. Inside of it, use conditional shortcodes or blocks to display either content template A or content template B.
Does it make sense?
You can also programmatically choose what template to choose using the wpv_filter_force_template
https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_force_template
I hope this helps. Let me know if you have any questions.
I probably misplaced the problem.
At this link you see a cpt in a content template
hidden link
(It is a form relating to a training course)
I need to be able to provide the navigator with the possibility of printing this sheet in pdf.
As it is very difficult to adapt the print via plugins or @media print commands
(I can't remove the side buttons and other disturbing elements) I had thought of creating a second display mode with a cleaner and more synthetic structure. The idea was to put a "print version" link inside the form (stamp attached) that would lead to the second mode.
I guess my idea is conceptually wrong.
I am pretty sure you can remove the button or other elements from the print version using CSS. For example, you can remove elements using the following CSS:
@media print
{
.no-print, .no-print *
{
display: none !important;
}
}
Then, add the "no-print" class to those elements or their parent elements.
You can also display a post using a different content template using the "content-template-id" URL parameter. For example, you can display the same post with a different content template with the following URL hidden link
Where 1234 is the ID of that content template.