Skip Navigation

[Resolved] Creating 2 pages templates for my first Toolset site

This support ticket is created 4 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 5 replies, has 2 voices.

Last updated by GeoffS1889 4 years, 9 months ago.

Assisted by: Nigel.

Author
Posts
#1613211

Hi there,

I spoke to Nigel during pre-sales and then I purchased and he redirected me to post here. Here is my old post - https://toolset.com/forums/topic/is-toolset-suitable-to-create-a-site-with-related-posts/?key=t7kMfSubOclV
--

I am primarily focused on creating 2 template pages right now. I have 2 custom post types (stores and coupons) with a one to many relationship.

1 - The Store Page - an image/description/widget area in left column + a list of the coupons that are related to the store that shows the coupon title and button for the custom field = URL in the right column
2 - The Home Page - a row of three featured (taxonomy) coupons + a list of the most recent 16 coupons in a grid format below it

Here’s link to the mock up where I have my layout set up – hidden link (PASSWORD = 1234).

My questions -

- I have spent about an hour or so trying to get it set up and am challenged to make the design / layout work. I am used to working with servers / WP and something is not clicking for me... I am happy the work but are the instructions on how to do it something your team can help me with?

- My current site has about 500 pages indexed. I want to keep URL structure of blippr.com/coupon-codes/store/{store-name} while keeping the site within a single WordPress install. Is it possible to insert /coupon-codes/store/ before my store slug?

Would you mind helping me get this started?

Thanks so much!

Geoff

PS - I have some related questions about dynamic content (you may see in the mockup) but we don't need to go there, yet 🙂

#1613773

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Screenshot 2020-05-06 at 13.39.53.png

Hi Geoff

Let me take this, as I'm familiar with your original question.

1. The Store Page

By this I take it you mean a template for single store posts.

Create a template for store posts at Toolset > Content Templates.

Assuming you installed the Toolset Blocks plugin (rather than the classic Views plugin) you'll be able to design this template in the block editor. Because you are using a supported theme (GeneratePress) you should be able to update theme settings for this template, e.g. to use a full-width layout for this template.

You'll want to add the Toolset Grid block to be able to use columns. (You can use the built-in columns block if you prefer, and you are free to mix and match blocks from different plugin providers.)

In the left column output fields from the store post being displayed (e.g. use a Single Field block to output some custom field value via a dynamic source).

In the right column insert a View block, which will be used to display fields from the related coupons. So choose coupons as the content type and a format for the output that makes sense (unformatted might make sense in your case). You'll need to add a Query Filter to tell the View to only load coupons related to the store being shown. To do that you need to have the View block itself selected (you may need to use the block navigator at the top, see the screenshot).

Then in the block settings at the bottom you will see Query Filter, where you will add the Post relationship filter (specifying the relationship, and choosing The post where this View is shown).

So this View should only return the correct related coupons.

You can include whatever content you like in the View output (you'll probably want to group fields inside a Toolset Container block).

2. The home page
Add two Views, one to display coupons where you include a Query Filter, this time for the taxonomy to specify the featured term, and a second View that just lists all coupons in date order where you set a limit of 16. You might want to add a Query Filter to that second View to exclude featured coupons, so you don't have any coupons repeated.

Regarding your store post slugs, go to Toolset > Post types and edit the Store post type.

In the Options section under Rewrite settings switch to a custom URL format and enter "coupon-codes/store" and save. Edit a store then visit it on the front end, you should see the URL in the desired format.

#1613903

Hi Nigel, I am currently working on #1 this morning. This is a great help so far!

I have the store page showing up in the way it should column wise but am having trouble getting more than 1 of the coupons to show up. I have the query set up correctly and have set the limit to 10 (I believe). I feel like I am missing something obvious.

Here is a screenshot of the WP admin - hidden link

Here is the page on the front end - hidden link

Also, if I want to add some dynamic headline text at the top with the output of {Store Name} Coupon Codes (static value)... how can I do that? Or is it better to do that with a custom field on the store itself?

#1613929

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Screenshot 2020-05-06 at 15.29.42.png

Those settings look correct.

Are you sure there are more coupons attached to that store than the one that appears on the front end?

(Edit the store in the backend; the related posts are shown at the bottom of the editor.)

Your dynamic headline text, I'm not quite sure what you are aiming for, but you can use the Fields and Text block to mix and match static text and dynamic text from some field (standard field such as post title or custom fields), rather than using a Single Field block that outputs a field value in isolation.

You use the little "Add Field or View" button to insert fields in situ.

#1620177

That was it! Thanks for the help. I have a few other questions I am going to open tickets for shortly. Thanks again for your help!

#1620179

My issue is resolved now. Thank you!