Skip Navigation

[Resolved] "Design with Layouts" not showing on Category pages

This support ticket is created 5 years, 1 month 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 10 replies, has 3 voices.

Last updated by Christian Cox 5 years, 1 month ago.

Assisted by: Christian Cox.

Author
Posts
#1214787

I am trying to: Use "Design with Layouts" - as described here: https://toolset.com/2016/09/toolset-page-builders-now-coming-soon/

Link to a page where the issue can be seen: There is no front-end page. We want to use Design with Layouts as the visual editor for either the "Description" content body, or a Custom 'wysiwyg' field - in the admin-edit area of a category page.

I expected to see: The "Design with Layouts" button on the wysiwyg editor.

Instead, I got: no button.

#1214837

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Casey,

Thank you for contacting our support forum.

I'm a little confused here. You said here We want to use Design with Layouts as the visual editor for either the "Description" content body, or a Custom 'wysiwyg' field - in the admin-edit area of a category page.

Are you referring to creating a design for the category page on the backend ?

Please let me know.
Thanks,
Shane

#1215030

We want to use Design with Layouts as the visual editor for either the "Description" content body, or a Custom 'wysiwyg' field - in the admin-edit area of a category page.

The "Design with Layouts" button on the wysiwyg editor.

hidden link

#1216495
Toolset-DesignWithLayouts_Capture.JPG

The use case is this: An end-user (editor) can log into wp-admin, create a new category - and be able to layout the content for that page (in standard 'description' field or custom wysiwyg field) - with rows & columns (without writing html).

The "Design with Layouts" button I am referring to is in the attached image.

#1216587

Hi, it's not currently possible to design individual content layouts for each term in a taxonomy. One way you can work around this is to allow your editors to create Template Layouts, then use custom code to apply those Layouts dynamically to each term. We have an API available that will allow you to choose specific templates for each term programmatically. I can provide examples of that if you'd like.

If you would like to see the Content Layout feature added to support Content Layouts per term, I encourage you to submit your request over here: https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/

Those requests go directly to our product leaders for evaluation.

#1216623

dang.

We aren't exactly looking for 'content layouts per term'. What we want is to give editors control over the design of content on each term. The only other way we've found to do it is with "Enhanced Category Edit" plugin. But this just creates a separate CPT and links the category to it (treating the content body as a page w/Visual Composer editor available). Of course - we could do a similar thing with types & views (by linking a page or other cpt in a view). BUT this doesn't solve the core issue - which is the content for the category isn't part of that item in db/api. Meaning - it's far more difficult to get/post to it via wp-api.

#1217030

We aren't exactly looking for 'content layouts per term'. What we want is to give editors control over the design of content on each term.
I'm not sure I understand how these two things are different. For example, if you go to a custom post type editor page and click "Design with Layouts", then you are creating a Content Layout, per post. It sounds like this is exactly what you want to do, except for terms instead of posts. Can you explain how what you want to do per term is different? I want to be able to be able to ask my team for the correct information here.

#1217250
KH-Capture-CategoryPageEdit.JPG
KH-Capture_CategoryPageLayout.JPG
KH-Capture_CategoryPage-FrontEnd.JPG
KH-Capture_CategoryPage-CustomField.JPG

I'm uploading 4 screenshots:

1. KH-Capture_CategoryPageLayout
--from Toolset > Layouts > Templates for Archives.
2. KH-Capture-CategoryPageEdit
--the post>category>edit screen (where we would like "Design with Layouts" on the custom wysiwyg field "maincontent")
3. KH-Capture_CategoryPage-CustomField
--the "maincontent" wysiwyg field on category edit screen
4. KH-Capture_CategoryPage-FrontEnd
--the result on the front end.

**Currently, the basic category description isn't coming through ( [wpv-taxonomy-description] ), nor is the custom field ( [wpv-taxonomy-field name='wpcf-maincontent'] ).

And we haven't even gotten to the part we want: the simple category description, and full layout design (ie. with columns & images) in the 'maincontent' custom field.

#1218232

**Currently, the basic category description isn't coming through ( [wpv-taxonomy-description] ), nor is the custom field ( [wpv-taxonomy-field name='wpcf-maincontent'] ).
These shortcodes are intended for use in a View of taxonomy terms, not in a taxonomy archive. See the documentation here, and check the "context": https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-taxonomy-description

In an archive, the best way to display a custom term field is to use the Types field shortcode: https://toolset.com/documentation/customizing-sites-using-php/functions

The taxonomy description isn't as easy to display, but one of my colleagues wrote a custom shortcode you can use. Add the following code to your child theme's functions.php file, or to a new snippet in Toolset > Settings > Custom Code:

/**
 * Register shortcode to output current taxonomy
 * for use on taxonomy archive page outside or inside loop
 * att['output'] string taxonomy | name (default) | slug | term_id | description | count | field (requres att['field'])
 * att['field'] string key
 */
add_shortcode('taxonomy', function ($atts = [], $content = null) {
 
    // provide defaults
    $atts = shortcode_atts(
        array(
            'output' => 'name',
            'field' => '',
        ),
        $atts
    );
    extract($atts);
 
    $return = '';
 
    global $wp_query;
    $obj = $wp_query->get_queried_object();
 
    if ($output != 'field') {
 
        $return = $obj->$output;
    } else {
        if (isset($field)) {
            $return = get_term_meta($obj->term_id, $field, true);
        }
    }
 
    return $return;
});

Then in your WordPress Archive, use it like this:

[taxonomy output='description']

And we haven't even gotten to the part we want: the simple category description, and full layout design (ie. with columns & images) in the 'maincontent' custom field.
Okay so you want to be able to design a WYSIWYG custom field using Layouts, and theoretically implement a WordPress Archive cell in that design so the design can be used as the term archive page. Designing a WYSIWYG with Layouts isn't supported right now, and I think that would be required to implement first. You could submit a feature request to add that to the current software here: https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/
That information will get to our Product leadership team, and they can evaluate the request.

#1218488

Thanks for your prompt reply & understanding Christian.
The tax function for shortcode works great - much obliged.

Regarding the other part - it's unfortunate that we can't have visual/builder control on category page descriptions.
We'll try to do this another way - by using a view to pull in a 'page'. In this way, we'll use Divi page builder to design the page, give it an associated category - and use the category as the query filter on the archive page. This seems to work so far - still sorting out the container/rows to get it to display full width.

We'd also like to use a content template for the header part of the archive (yoast breadcrumbs, tax title, etc.). Unfortunately, putting a content header above the loop doesn't seem to work:

[wpv-post-body view_template="cat-header"]
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
[wpml-string context="wpv-views"]empty[/wpml-string]
[/wpv-no-items-found]
[wpv-layout-end]

Any idea why?

#1219197

There's nothing inherently wrong with placing a Content Template before the wpv-layout-start shortcode. However, if you have a Divi designed block inside another Divi designed block, that can lead to problems. If you need more specific assistance with that Content Template, feel free to open a new ticket so we can discuss in more detail.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.