Making a custom theme default for a block

Permalink
Hi,

just done a jquery drop down menu for auto-nav block and name it as "drop_down". It is of course under my_siteroot/blocks/autonav/templates/drop_down/ folder. There is a view.php, view.js and view.css.

How can i make this custom template as 'default' for the auto-nav block in every page of the site. When I edit a page and select a custom template for the block it is ok, but there must be a way to make it default, isn't it?

tolga
 
Remo replied on at Permalink Reply
Remo
tolga replied on at Permalink Reply
tolga
you have my vote :)
powermick replied on at Permalink Reply
powermick
you can overide everything on "on_page_view" function in class controler of the block

yan can see this here:

http://www.concrete5.org/community/forums/block_requests/jquery_dro...
andrew replied on at Permalink Reply
andrew
If you really want this to be the default for the autonav block in the site, just do this.

1. Rename blocks/autonav/templates/drop_down/view.php to blocks/autonav/view.php
2. Rename blocks/autonav/templates/dropdown/view.js to blocks/autonav/view.js.
3. Rename blocks/autonav/templates/dropdown/view.css to blocks/autonav/view.css
4. Remove the drop_down directory.

Basically, this will replace all instances of the autonav template with the one that you've made. The view.css and view.js should be autoloaded as well, when added to the page.
Remo replied on at Permalink Reply
Remo
Thanks Andrew!

Quite easy.. Should have had that idea on my own
tolga replied on at Permalink Reply
tolga
Thanks andrew,

I thought this also, however, if you have a large site with complex navigation, or if you just want to have drop down menu (custom template for any specific block) you have to navigate to each page and set custom template to the block. Your users also have to do it *ohh!*

One more thing; if i use the same block type in a page more than once, say autonav block, but want them to have different themes, the idea of having an option to have a 'default template of a block' makes more sense.

Ah, also if i want to package it to be a custom package/block, it should override the default theme for the autonav block in you solution. (ps: i've no idea how to package it to be just a custom autonav block theme)
ScottC replied on at Permalink Reply
ScottC
while not used often, $a = new Area('a');
$a->setCustomTemplate()? Admittedly this is page type specific or any pagetype that inherits from default since it doesn't have an associated pagetype in the currently active theme, it does in fact work :)
Remo replied on at Permalink Reply
Remo
Why not add a drop down menu in the "dashboard - add functionality - options"?
trolink replied on at Permalink Reply
Hi Guys,

This topic is from 2009.. I'm new with Concrete5 and i have the same question as the topic starter. Is there in 2011 a standard function for this?

Its not my idea to insert on every page the footer and top menu block, its not easy for potentiel clients.

I'll hope someone can help me, i dont know exactly how this is called in Concrete

Thanks!
Mnkras replied on at Permalink Reply
Mnkras
You can use page defaults
trolink replied on at Permalink Reply
Hi!

Thanks Mnkras, i've found it now, awesome!

http://www.concrete5.org/community/forums/usage/handy-trick-with-pa...

Br,
Thomas