CMS Development

AzharBondi
Contributor

How to identify where a function or a specific file is being used in all parts of your code ?

SOLVE

Hi guys ! 

is there a way that faciltates the findings of all the places a specific image(path) is being used in all your code. Same goes for functions and specific tags !!


All this to save me time instead of me going manually over all theme folders one by one and searching for where it's being used 

Thanks!!

0 Upvotes
1 Accepted solution
Anton
Solution
Recognized Expert | Diamond Partner
Recognized Expert | Diamond Partner

How to identify where a function or a specific file is being used in all parts of your code ?

SOLVE

Hi @AzharBondi

I don't think that there's an "easy" way to look up where each file is located. I could imagine that you could get some informations from the files API for files located in the file manager. But to be honest - I've never done that.

 

The only way I know is:

For files located in the file manager you can select one and look in the "File usage" area.

Bildschirmfoto 2023-07-29 um 00.37.06.png

 

For files located in the Design-Tools/Design-Manager you can right-click on a certain file and select "Show dependents"

Bildschirmfoto 2023-07-29 um 00.43.53.png

 

 

hope this helps.

 

 

Maybe some fellow dev community masterminds know some solution to this -> @Jnix284@amwilie@Teun 

 

best, 

Anton

Anton Bujanowski Signature

View solution in original post

3 Replies 3
amwilie
Recognized Expert | Elite Partner
Recognized Expert | Elite Partner

How to identify where a function or a specific file is being used in all parts of your code ?

SOLVE

@Anton 's suggestions are the only I can think of for in portal. If you know your way around a desktop code editor you could just download the files to your computer with the HubSpot CLI, open the folder in your editor, and run a search.

If this answer solved your question, please mark it as the solution.

Alyssa Wilie Profile Image

Alyssa Wilie

Web Developer at Lynton

Learn HubL | Get Marketing Insights

Jnix284
Thought Leader | Diamond Partner
Thought Leader | Diamond Partner

How to identify where a function or a specific file is being used in all parts of your code ?

SOLVE

@AzharBondi you could write a script to search your code for specific paths...

 


Jennifer Nixon - Director of Revenue Operations at WORQFLOW

connect with Jen on Linkedin
Anton
Solution
Recognized Expert | Diamond Partner
Recognized Expert | Diamond Partner

How to identify where a function or a specific file is being used in all parts of your code ?

SOLVE

Hi @AzharBondi

I don't think that there's an "easy" way to look up where each file is located. I could imagine that you could get some informations from the files API for files located in the file manager. But to be honest - I've never done that.

 

The only way I know is:

For files located in the file manager you can select one and look in the "File usage" area.

Bildschirmfoto 2023-07-29 um 00.37.06.png

 

For files located in the Design-Tools/Design-Manager you can right-click on a certain file and select "Show dependents"

Bildschirmfoto 2023-07-29 um 00.43.53.png

 

 

hope this helps.

 

 

Maybe some fellow dev community masterminds know some solution to this -> @Jnix284@amwilie@Teun 

 

best, 

Anton

Anton Bujanowski Signature