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.
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 ?
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.
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.
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.
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.
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.
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.
**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
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.
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:
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.