Custom template as default globally for a block

Permalink 1 user found helpful
Hi!

Is there a way to set a custom template as default? So every time the client insert for example a gallery block, it uses a custom template without selecting "custom template" and choosing the appropriate one?

I may have read something about this a long time ago, but I can't find it in the forums.

Thanks in advance.

View Replies: View Best Answer
Job replied on at Permalink Best Answer Reply
Job
Override the blocks default view.php with your template.

I don't have the Gallery block, but if you were wanting to do this with the autonav block ...

/siteroot/blocks/autonav/view.php

In that file, copy the contents of your template, and that'll be used as the default throughout the site.

This method of overriding is standard throughout Concrete and can be done with controllers and models as well as views.

Be sure to mark this reply as an answer if it helps you ...

Job.
gd42 replied on at Permalink Reply
Does this works with packages too?
Job replied on at Permalink Reply
Job
Yup!

Don't forget to mark the above as an answer if it helps.

Job.
gd42 replied on at Permalink Reply
Thanks!
joemc replied on at Permalink Reply
joemc
This is not working for me from within a package.

I can override the view.php if I place my custom template within root/blocks folder but not within my package/blocks folder.

I can only change the view from within my package if I create a custom template (templates folder) and then manually change the template of the block on my site.

I would much rather prefer to override the default block views with my packaged theme.

Any advice?
joemc replied on at Permalink Reply
joemc
I am also not able to set a template view from within my package if I use this structure:

my_package/blocks/tags/templates/my_template/view.php

The template does display if I use:

my_package/blocks/tags/templates/my_template.php

There seems to be some issue with using files called "view.php" when trying to override within my package.