Smartdocs Model description defaults to plain text

When we create a smartdocs model and enter a description we would like to be able to enter HTML in the description field but when you click create the Global: Text Field is set to Plain Text. Is there any way to change that default?

I tried changing the /admin/config/content/formats weights and permissions but nothing seemed to work.

0 6 352
6 REPLIES 6

Hi @daniel.biales

I'm going to make some assumptions about the fields you mean, but these steps may work for you.

You're adding a smartdocs model by going to the menu item "Content -> SmartDocs" and then clicking the "New model" link, which takes you to this form:

8286-add-model-new-apigee-site.png

After importing an OpenAPI spec, the resulting page will look like:

8287-new-apigee-site-model-with-html-plain.png

Then edit the view by clicking the gear icon, then click on the global: text area

8288-model-with-html-method-listing-content-new-apigee.png

In the modal window that appears

8289-model-with-html-modal.png

Then save, and the view will now display as:

8290-new-apigee-site-model-with-html.png

So that is my exact problem and that is how I am currently solving it but I would like it to default to full HTML (not have to make that change every time). The reason that I want that to default to Full HTML is because I am using smartdocs_service to upload the smartdocs programatically.

The views for each model are cloned from a base view called "Smartdocs Method Listing". If you edit that once, all future clones views should have that change as well.

If you're comfortable writing custom code, I think you could do this with a hook_views_pre_render() call instead.

Editing the Smartdocs Method Listings view did not seem to work. That view does not have a header Global: Text View. I tried adding one but it didn't seem to do anything.

arg, you're right, strike 2!

Looks like that text header is added via code in smartdocs_create_model_view(). I think the only way to modify this would be to implement a hook_views_view_presave() unfortunately.

Presuming this is a Drupal-based Edge (local) implementation, as I'm using Edge on Google Cloud and cannot modify the SmartDocs rendering at all.