Hi,
I’m new to Toolset and I’m feeling a tad overwhelmed by something I’m sure is quite easy to set up. So for practice I’m setting up a site with quotes. I’m fine with setting up the main parts like CPT’s and Custom fields. It’s getting it all together I’m struggling with. I currently have one Source and 3 Quotes set up.
I need some help in finding the best way to set it up.
The site will have:
Quotes
Sources
Topics (Categories?)
Sub topics (Tags?)
When you click on a Source, see all Quotes by that Source
When you click on a Quote, see the Quote, random/popular related quotes by topic/subtopic
A Quote can only belong to one Source
A Quote can belong to many Topics
A Quote can belong to many Sub topics
A Source can belong to many Quotes
Template for Quotes (many)
3 column grid
Source -> Link to source
Title -> Link to quote
Main topic -> Link to all quotes within that topic
Template for Quote (one)
Title (short title + short url"
Quote - Single line (or editor) -> How do I create this as a link
Category (should I create category or Custom post types?)
Template for Source
Title
Other info (custom fields, ok)
All other Quotes by Source
Questions:
Should I set up CPT’s for Topics and Sub topics or use Categories and Tags?
How can i make the custom field Quote as a clickable link to the Quote (instead of Title)
How do I set up the views and templates
How do I make a link to Source on the Quote?
Should I set up CPT’s for Topics and Sub topics or use Categories and Tags?
The concept of a subtopic seems more related to hierarchy within a single taxonomy. Use a single custom taxonomy for Topics and Subtopics, if that is the case. If you choose "Hierarchical" when creating the custom taxonomy, you can include hierarchical terms for topics and subtopics. There's no need to separate this into separate taxonomies, unless you have a good reason.
How can i make the custom field Quote as a clickable link to the Quote (instead of Title)
Is a custom field required? You might consider using the main content editor to hold the Quote instead of a separate custom field. Either way, you can use Views shortcodes and custom HTML to build a custom link tag:
Main post content as quote text: <a href="[wpv-post-url]">[wpv-post-body view_template="None"]</a>
Custom field content as quote text: <a href="[wpv-post-url]">[types field='your-wysiwyg-field-slug'][/types]</a>
How do I set up the views and templates
This is a rather broad question. I'm not going to be able to effectively address this in one ticket I'm afraid. In general, here are the steps. If you have questions about these steps, please open separate tickets. We have a one topic per ticket policy, and each of these is enough for a separate topic.
- Set up a View of the Quotes post type with no Query Filters. In the Loop, insert the Quote content, based on the example I shared above. Insert links to the Topic taxonomy using the wpv-taxonomy-archive shortcode (https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-taxonomy-archive). Insert a link to the parent Source. See this document for more information about using the Post Selection tab: https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/
- Place this View in your Home Page.
- Set up a Content Template for Source single posts.
- Insert the same View of Quotes you used earlier. This time, edit the View and set up a Post Relationship filter, where the post parent is set by a shortcode attribute. Pass the current post's ID into the shortcode attribute, so that the View only displays Quotes that are related to the current Source. More information about passing arguments into Views here: https://toolset.com/documentation/user-guides/passing-arguments-to-views/
- Create a Content Template for single Quotes. Insert the Quote content with either the post body shortcode or the custom field shortcode, depending on the decision you made earlier.
- Create a View of Quotes, and add a Query Filter for the Topics taxonomy, where the taxonomy term is set by the current post or page. Insert this View of Quotes in the single Quote Content Template.