Override smartdocs.views_default.inc

Not applicable

Hi,

I am trying to override the default SmartDocs Method Listing view provided by Apigee. I have noticed that any config changes I make to the SmartDocs Method Listing view using the UI (saved in the database) are not applied when I create a new model. Instead it applies the view provided by the module code, more specifically in the smartdocs.views_default.inc (apigee/modules/custom/devconnect/smartdocs). When I export my new view and copy paste the view into this file and then create a new model the new view is generated.

So coming to my question. Is there a way to override smartdocs.views_default.inc file, or is changing the original smartdocs.views_default.inc the only way?

I am looping in @Anil Sagar because I saw your comment on the post (https://apigee.cloud.answerhub.com/questions/24568/how-to-customise-smartdocs-method-listing-views-nu-1.html) which helped me to get to this stage. Can you please provide more insight on this?

Thank you,

Abdullah

0 5 157
5 REPLIES 5

@Abdullah Nasim , It should apply to all the new models. I believe fix is rolled out. Which version of developer portal are you using ? Find the version by navigating to /buildInfo . Keep us posted.

@Anil Sagar I am aware that it applies to all new models and I also found the other post where it said that the problem was fixed, however, I am still facing this problem.

Our portal is on premises. We are running OPDK-4.16.05.01.

On a more general level how would one override a core apigee module view? Do I have to create custom module to override the hook?

@Abdullah Nasim , I am not sure whether the fix rolled out into opdk. @Daniel Johnson Any idea ?

Yes, You should create custom module & use hooks. Never ever edit any Developer portal core modules. All customisations should go into sites/all folder.

custom-smartdocs.zip @Anil Sagar, I was able to figure out how to create a custom module and use alter hooks. I enabled my custom module, cleared cache and went to /admin/structure/views and found the updated SmartDocs Method Listing View. However, now I am facing a different issue. Although my SmartDocs Method Listing View is updated to my new view, when I create a new model the view of the new model is still the default (unformatted list).

I created custom_smartdocs module in sites/all/modules. It has 3 files: custom_smartdocs.info, custom_smartdocs.module and custom_smartdocs.views_default.inc. I am attaching the three files. Can you please tell me why the new model views are not being generated based off the newly altered SmartDocs Method Listing View?

Thank you,

Abdullah

@Anil Sagar @Daniel Johnson, any response to the above question?