Where to change the top level view of an API, while it and its resources are being rendered?

Not applicable

When an API model and it's resources are being rendered, a view is created to link to all the resources.

3507-toplevelview.png

This top level view lacks information about the API, I would like to automatically add information to this view when it is created, but I do not know where the code is located. I would like to create a custom module from the code to add details to this top level view.

Does anyone know the location?

Thank you for your time,

Mitchel

Solved Solved
2 4 118
1 ACCEPTED SOLUTION

@Mitchel Skees ,

Smartdocs Method Listing view (admin/structure/views/view/smartdocs_methods/edit/modelindex) that you can find in Structure -> Views is the base view for all Views Listing generated for smartdocs module.

You can make the changes to above view, which will be applicable to all newly generated smartdoc views.

If you are interested in building a base view in code, take a look at "smartdocs.views_default.inc" file in profiles/apigee/modules/custom/smartdocs location.

Similar question asked here. Hope it helps. Keep us posted if any.

View solution in original post

4 REPLIES 4

@Mitchel Skees ,

Smartdocs Method Listing view (admin/structure/views/view/smartdocs_methods/edit/modelindex) that you can find in Structure -> Views is the base view for all Views Listing generated for smartdocs module.

You can make the changes to above view, which will be applicable to all newly generated smartdoc views.

If you are interested in building a base view in code, take a look at "smartdocs.views_default.inc" file in profiles/apigee/modules/custom/smartdocs location.

Similar question asked here. Hope it helps. Keep us posted if any.

Hey @Anil Sagar,

Setting the default view "admin/structure/views/view/smartdocs_methods/edit/modelindex" worked perfectly. I had to add relationships to the view to connect the methods with a separate content piece called a publishing form. Both were related by which API model they used.

Relationships

1. Content:Taxonomy terms on node\

Select "SmartDocs Models"

Required True

2. Taxonomy term: Content using API Model

"Relationship" select "Term"

Identifier Select "field_api_model"

Required True

Once I got the desired meta data exposed in the fields, I had to hide the data by selecting "Exclude from display" from the field options and then format and expose the data by adding global text using tokens ("Replacement Patterns"), which can be added in the header, footer or even the fields areas of the view. So now the APIs can have meta data provided by the API developer.

Thank you for your time,

Mitchel

Awesome @Mitchel Skees , Glad your query is resolved. Looks like you guys have been doing great work when it comes to smartdocs. Please feel free to post an article about your customizations when time permits so that it will be helpful for the others. Thank you in advance.

@Mitchel Skees ... Did you create a new views tpl file and add it to your sites/all/themes folder ? We also have a similar requirement and trying to follow a similar approach, but no luck yet