addHeaderItem from within template

Permalink
In addition to this discussionhttp://www.concrete5.org/index.php?cID=2465... (which in the meanwhile works).

I've been trying to create templates that take care of everything. Meaning I don't want to have to add any kind of css/javascript in the theme.

So let's say I'd like to build an autonav template which we could include in the core. It uses some javascript (a lot of people like suckerfish) and some css. I can echo that stuff at the beginning of my template but that generates code that doesn't validate.
Andrew modified addHeaderItem because of this..

But how can I add stuff into the header if I only have access the to V of MVC - the template?

I'd like to publish a few of my templates but the instructions would be quite complicated and I'm sure we would get a lot of questions about it and answering questions like "where to put that css" get boring...

Remo
 
ScottC replied on at Permalink Reply
ScottC
please search for: addHeaderItem() site:concrete5.org through google. It is 5:35 am here and I am going to bed :)

If you have any questions, please feel free to email me, I have this pretty figured out. Remember that addHeaderItem doesn't need to use the html helper to wrap a js in an appropriate string, or css for that matter. $this->getThemePath().'string of stuff' still works.

Anyways ultra tired night :)
Remo replied on at Permalink Reply
Remo
not sure which post you mean


that one:
http://www.concrete5.org/community/forums/customizing_c5/making_cor...
would mean that I have to override the controller core which I don't want! I just want to add a template (single file)

that one:
http://www.concrete5.org/community/forums/customizing_c5/order_of_i...
doesn't work in the template, only in the controller

same with that one:
http://www.concrete5.org/help/building_with_concrete5/developers/mv...

Hope you slept well (:
ScottC replied on at Permalink Reply
ScottC
I checked and yeah you are right. I wasn't aware of this :)

I took theme and template to mean the same thing last night.

Yeah this is a bit of an issue, not sure what would be the best way to go about getting it done outside of core code changes and certainly not in 1 file that has the scope of a view! :). The best case right now requires an overwrite of the controller and the view, which is ok I guess. I would however like to see this happen.
Remo replied on at Permalink Reply
Remo
I guess we need the c5 core team here ;-)

Overwriting the controller is easy but ugly for a simple template....

Franz, I'd like to publish a few of my templates but without instructions on how to install them (beside the copy directory thing). I don't want to answer questions about how to install a block template...

We already had too many requests for templates, I'd like to start "shipping" them!
powermick replied on at Permalink Reply
powermick
Following the discussion by:
http://www.concrete5.org/index.php?cID=6233...

The preceding discussion is the:
http://www.concrete5.org/index.php?cID=4437...