How to add custom template to block

Permalink 1 user found helpful
I have changed the view.php file in the search block so that there is no title. I am trying to install it as a custom template, but after I put it in the templates folder and try to use it, it does not show up in the dropdown menu. What am i doing wrong?

Thanks

hawkman4188
 
cannonf700 replied on at Permalink Best Answer Reply
cannonf700
double check and make sure your trail is correct. It should look something like this:

root/blocks/search/templates/yourcustomsearch.php

Also, you should rename the file from view.php to something more descriptive. I like to use the theme's title for example rustic_search.php or something like that.
hawkman4188 replied on at Permalink Reply
hawkman4188
I did that and it still doesn't show up. Do I have to refresh something under the dashboard?
cannonf700 replied on at Permalink Reply
cannonf700
no - no updates from the dashboard are necessary. I can only think of two things:
1 double check the spelling of your file trail... is templates plural? is search spelled correctly?

2 make sure your custom template is at the ROOT/Blocks level and NOT at the ROOT/concrete/blocks level.

If that doesn't work then you could try this file trail:
root/blocks/search/templates/yourcustomtemplate/view.php
hawkman4188 replied on at Permalink Reply
hawkman4188
I figured it out. I had the wrong file structure. It had to be:
ROOT->blocks->content->templates->User_template_name

thanks for the help!

This website stores cookies on your computer. These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media. To find out more about the cookies we use, see our Privacy Policy.