Skip Navigation

[Closed] Displaying a Content Template in my Custom Post Type

This support ticket is created 3 years, 5 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
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

This topic contains 6 replies, has 2 voices.

Last updated by Jamal 3 years, 4 months ago.

Assisted by: Jamal.

Author
Posts
#1859695

Tell us what you are trying to do?
1) Create a Content Template for my Custom Post Type, so when I create a new post using said Custom Post Type, the different content elements that I put into the Content Template will appear in the new post as they do in the Template. Currently, I've created a Content Template, but when I select to create a new post for the correlating Custom Post Type, the elements in my template don't appear in the new post.

2) I'd like to have an Accordion element in my Content Template. I'm using the CSV Uploader plugin, and I'd like to upload CSVs into new posts for a Custom Post Type, and I'd like some of the content from the CSV to feed directly into an Accordion in the post, similar to how I can upload and image via the CSV that will automatically display in the post. Currently, I do not see an Accordion block by Toolset, so I'm trying to find ways to use the Accordion block by WordPress, or find a plugin that will work; but I'm having difficulty finding an Accordion into which I can upload text from a CSV, and my troubles with the Content Templates are adding a layer of difficulty.

Is there any documentation that you are following?
I followed the video on this page: https://toolset.com/course-lesson/using-toolset-conditional-block/. I'm able to create the template, but I don't see how to bring that template into new posts.

Is there a similar example that we can see?
No. This is the first time I've tried to do this.

What is the link to your site?
djmartin3.wpcomstaging.com -->The site is essentially a sandbox now, so it's pretty discordant. I'm just testing to see if Toolset has the functionalities I need after deciding to move from another website builder.

Thanks for your help.

#1859991

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello and thank you for contacting the Toolset support.

I am not sure to understand your first question, can you take two screenshots for the post that appears correctly and a new post that presents issues?

Regarding the 2nd question, I think that you can use the WordPress accordion, or a third party plugin accordion and put types data inside of it. This needs to be added to the content template assigned to the post type. This way, any post that has data will be rendered using the same content template and the accordion will have the relevant post data.

Please add more details about the first question, and if possible allow me temporary access to check this closely and I'll get back to you as soon as possible. Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **

#1861695

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Unfortunately, the provided credentials are not working for me or my colleagues. Please update your last reply or your next one with working credentials.

Please note that the content template is responsible for displaying the post content, taxonomies, and custom fields. What you are showing in the screenshot "Screen grab 2.PNG" is the content or the body of the post, it won't get populated from the content template. Check our glossary for more details about templates:
- https://toolset.com/glossary/template/
- https://toolset.com/glossary/

Regarding the 2nd question, I would say that the accordion is just a mean to display some information, we can configure the accordion and what it should hold in the content template(responsible for displaying the post) and we can import data from the post(content+custom fields+taxonomy terms). In the end, we'll have our post data displayed inside an accordion.

#1864037

Thanks. I was unable to add a guest user with the "Users" tab in my site admin panel. I contacted WP, and they said I needed to create new users via email. Is there an email or WP username I can use to send you a guest login?

It seems I don't quite understand what templates do. I look into the links you sent.

As for accordions, I've looked at many different types, since I need to put blocks inside them, so I can connect them to custom fields. I've found a few different plugins that offer accordions in which I can put block into the expanded part of the element, but I haven't found any accordion that allows me to put a block inside the title area of the element (the part of the accordion that is always visible). If there was a way somehow connect the title of an accordion to a custom field, that would save me a great deal of time, since I will be constantly creating new posts with the same format involving several accordions. My goal is that I simply upload a CSV with each new post and don't have to worry about much design work.

#1865833

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

My apologies for the late reply but I do not work on Wednesdays and Thursdays.

You can create an account using my email jamal.b(at)onthegosystems.com, after that please reply to this ticket so I can see it on my active queue and reply as soon as possible.

I can understand why the accordion plugins developers do not allow to fully customize(Exp: use Toolset) in the title area. As this element needs to be clickable, I assume that the developers decided to keep it restricted to a block that won't have a possible link or button inside it.
Unfortunately, I am not aware of any plugin that offers an accordion block that can do this.

But, I'll suggest trying Toolset shortcodes inside the title area, maybe an accordion plugin allows it. Read more about the shortcodes here https://toolset.com/documentation/programmer-reference/views/views-shortcodes/

If that does not help, we can always build this view with the legacy views editor and make use of the Twitter Bootstrap accordion. Then, you can create a separate content template using blocks, that can be added inside the expandable area of the accordion.

I still think, that knowing more details about what you want to achieve(post types, custom fields, taxonomy, csv files) is essential for me to give you better advice.

I am settings your next reply as private to let you share the credentials safely. I would prefer that my user be an administrator so I can check whatever I need to in the backend.

#1872685

I am developing a post that will show what I'm trying to do, and I'll send another message soon when that post is finished, so you'll be able to see what I'm doing if you need to. As for the content templates, I think I understand what they are, and I think it would be better for me to duplicate posts, so that resolved.

My remaining question is for the accordions, as we've discussed. Your suggestion about the Twitter bootstrap tool sounds interesting. However, be aware that I only have a very basic understanding of HTML. I will have many accordions in my site, so if there is a way to make their title sections connected to a custom field, that would help save some time.

#1873033

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

I am sure we can find a way. But I'll need to see a concrete example. Once you build the example and you tell me what fields would you like to use in the accordion title and content areas I'll see what we can come up with.

I am setting this ticket as waiting for your feedback, it should be kept open for 3 weeks. Let me see an example of your custom post type and the custom fields and I'll see what we can do.

The topic ‘[Closed] Displaying a Content Template in my Custom Post Type’ is closed to new replies.