SmartDocs Template for Model Method Overview Page

Not applicable

I’m working on styling our API Product pages and specifically I’m trying to customize the look of the API methods overview/list page generated by the SmartDocs templates. I’ve already modified smartdocs.hbr to style a single API method, but I am now trying to find which template generates the model method list page. Does it exist and where can I find it? Thanks in advance for your help!

2 6 1,014
6 REPLIES 6

Dear @Dylan Scott ,

SmartDocs Method Overview list page is generated using Drupal Views module. For every rendered model you will find a new view with name (YOUR MODEL OVERVIEW) with path "YOUR-MODEL-NAME/apis".

You can able to find view by navigating to "admin/structure/views". See an example below. Click on Edit link to access view information.

470-screen-shot-2015-05-21-at-92310-am.png

View exposes many template files based on needs. You can see various template names by clicking on Advanced -> Theme : Information link in your view edit page.

471-screen-shot-2015-05-21-at-92455-am.png

To modify look & feel you can write CSS in your theme style.css to change the css of your APIs listing page. You need to use unique view id to target HTML elements while writing CSS. To modify HTML you can use above template files given by view.

Many online resources available regarding same. See detailed article here for more details.

Cheers,

Anil Sagar

@Anil Sagar .. since the views are generated dynamically for each API. The templates will have to be modified for each API. Is there a more generic solution? where in we can style a template only once and each new API model can pick up the layout.

We also have a similar requirement and are not able to find a generic solution

Thank you!! This worked for me!!

happy wheels

@run 3 Your answer is very detailed, thanks!

@Anil Sagar I noticed on the model index page, any HTML is stripped from the "Description" fields. Whereas on the specific in the method pages (/get/{endpoint}) the HTML comes through.

The original text is pulled my swagger spec.

How can i modify the template to allow <a href='''> to render correctly? I see the following:

Field Global: Custom text (ID: display): views-view-field.tpl.php, ....

Field Content: HTTP verb (ID: verb): views-view-field.tpl.php, ...

Field Content: Resource path (ID: resource_path): views-view-field.tpl.php, ...

Field Content: Title (ID: title): views-view-field.tpl.php, ....

but would expect to see something that told me the template that was used to render the description..

Thanks,
John

Hi Dylan, great article thanks for posting this! I was searching for solutions like these and I came across Paw. It might worth adding it here! unblocked games